module Result = struct type ('a, 'b) result = Ok of 'a | Error of 'b end open Result
module Eol_detect
= struct
#1 "eol_detect.ml"
type eol =
  | LF 
  | CRLF 
let show eol = match eol with | LF -> "lf" | CRLF -> "crlf"
let default_eol = match Sys.win32 with | true -> CRLF | _ -> LF
let get_eol_for_file filename =
  let ic = open_in_bin filename in
  let line = ref "" in
  let c = ref ' ' in
  let prev = ref None in
  try
    while (!c) <> '\n' do
      (prev := (Some (!c));
       c := (input_char ic);
       line := ((!line) ^ (String.make 1 (!c))))
      done;
    (match !prev with
     | None -> default_eol
     | Some '\r' -> CRLF
     | Some _ -> LF)
  with | End_of_file -> (close_in ic; default_eol)
end
module Eol_convert
= struct
#1 "eol_convert.ml"
open Eol_detect

let lf_to_crlf s =
  let rec loop sz =
    match String.index sz '\n' with
    | exception Not_found -> sz
    | idx ->
        let l = (String.sub sz 0 idx) ^ "\r\n" in
        let length = String.length sz in
        l ^ (loop (String.sub sz (idx + 1) ((length - idx) - 1))) in
  loop s

let get_formatter output_channel eol =
  let f = Format.formatter_of_out_channel output_channel in
  let out_functions = Format.pp_get_formatter_out_functions f () in
  let out_string s p n =
    match eol with
    | LF -> out_functions.out_string s p n
    | CRLF ->
        let str = String.sub s p n in
        let str = lf_to_crlf str in
        out_functions.out_string str 0 (String.length str) in
  let new_functions = { out_functions with out_string } in
  Format.pp_set_formatter_out_functions f new_functions; f

end
module Package
= struct
#1 "package.ml"

let version = "3.6.0"
let git_version = "8f71db0b88c31842d866d46a18b71a1ce1709567"
let git_short_version = "8f71db0"

end
module Migrate_parsetree_compiler_functions
= struct
#1 "migrate_parsetree_compiler_functions.ml"
# 1 "src/migrate_parsetree_compiler_functions.ml"
# 1 "src/compiler-functions/ge_406_and_lt_408.ml"
let error_of_exn exn =
  match Location.error_of_exn exn with
  | Some (`Ok exn) -> Some exn
  | Some `Already_displayed -> None
  | None -> None

let get_load_paths () =
  !Config.load_path

let load_path_init l =
  Config.load_path := l

let get_unboxed_types () =
  !Clflags.unboxed_types

let set_unboxed_types b =
  Clflags.unboxed_types := b

let may_map = Misc.may_map

end
module Locations
= struct
#1 "locations.ml"
# 1 "src/locations.ml"
type old_location_error                       = Location.error    = {
    loc: Location.t;
    msg: string;
    sub: old_location_error list;
    if_highlight: string;
  }

type location_msg = (Format.formatter -> unit) Location.loc

type location_report_kind (*IF_AT_LEAST 408 = Location.report_kind *) =
  | Report_error
  | Report_warning of string
  | Report_warning_as_error of string
  | Report_alert of string
  | Report_alert_as_error of string

type location_report (*IF_AT_LEAST 408 = Location.report *) = {
  kind : location_report_kind;
  main : location_msg;
  sub : location_msg list;
}

type location_error (*IF_AT_LEAST 408 = Location.error *)                       = old_location_error   

type error_type = [`Report of location_report | `Old_error of old_location_error]

let error_type_of_location_error : location_error -> error_type = fun x ->
  (*IF_AT_LEAST 408 `Report x *)
                        `Old_error x   

let location_error_of_exn : exn -> location_error = fun exn ->
  (*IF_AT_LEAST 408 match Location.error_of_exn exn with None | Some `Already_displayed -> raise exn | Some (`Ok e) -> e *)
                        match Migrate_parsetree_compiler_functions.error_of_exn exn with None -> raise exn | Some e -> e  

let extension_of_error ~mk_pstr ~mk_extension ~mk_string_constant (error : location_error) =
  match error_type_of_location_error error with
  | `Old_error old_error ->
    let rec extension_of_old_error ({loc; msg; if_highlight = _; sub} : old_location_error) =
      { Location.loc; txt = "ocaml.error" },
      mk_pstr ((mk_string_constant msg) ::
               (List.map (fun ext -> mk_extension (extension_of_old_error ext)) sub)) in
    extension_of_old_error old_error
  | `Report report ->
    let extension_of_report ({kind; main; sub} : location_report) =
      if kind <> Report_error then
        raise (Invalid_argument "extension_of_error: expected kind Report_error");
      let str_of_pp pp_msg = Format.asprintf "%t" pp_msg in
      let extension_of_sub (sub : location_msg) =
        { Location.loc = sub.loc; txt = "ocaml.error" },
        mk_pstr ([mk_string_constant (str_of_pp sub.txt)])
      in
      { Location.loc = main.loc; txt = "ocaml.error" },
      mk_pstr (mk_string_constant (str_of_pp main.txt) ::
               List.map (fun msg -> mk_extension (extension_of_sub msg)) sub) in
    extension_of_report report

let error_of_exn exn =
  try Some (location_error_of_exn exn) with _ -> None

let register_error_of_exn f = Location.register_error_of_exn f

let report_exception ppf exn = Location.report_exception ppf exn

let errorf ~loc fmt = Location.errorf ~loc ~sub:[] fmt

let raise_errorf ?(loc = Location.none) fmt = Location.raise_errorf ~loc ~sub:[] fmt

let _get_error_message_old location_error =
  location_error.msg

let _get_error_message_new location_error =
  let buff = Buffer.create 128 in
  let ppf = Format.formatter_of_buffer buff in
  location_error.main.txt ppf;
  Format.pp_print_flush ppf ();
  Buffer.contents buff

let get_error_message location_error =
                        _get_error_message_old location_error  
  (*IF_AT_LEAST 408 _get_error_message_new location_error*)

let _set_error_message_old location_error msg =
  { location_error with msg; }

let _set_error_message_new location_error msg =
  let txt ppf = Format.pp_print_string ppf msg in
  let main = { location_error.main with txt; } in
  { location_error with main }

let set_error_message location_error msg =
                        _set_error_message_old location_error msg  
  (*IF_AT_LEAST 408 _set_error_message_new location_error msg*)

let make_error_of_message_old ~loc msg ~sub =
  let sub = List.map (fun (loc, msg) -> { loc; msg; sub = []; if_highlight = msg; }) sub in
  { loc; msg; sub; if_highlight = msg; }

let make_error_of_message_new ~loc msg ~sub =
  let mk_txt x ppf = Format.pp_print_string ppf x in
  let mk loc x = { Location.loc; txt = mk_txt x; } in
  { kind = Report_error;
    main = mk loc msg;
    sub = List.map (fun (loc, msg) -> mk loc msg) sub; }

let make_error_of_message ~loc msg ~sub =
                        make_error_of_message_old ~loc msg ~sub  
  (*IF_AT_LEAST 408 make_error_of_message_new ~loc msg ~sub*)

let print_error ppf err =
                        Location.report_error ppf err  
  (*IF_AT_LEAST 408 Location.print_report ppf err*)

module type Helpers_intf = sig
  type nonrec location_error = location_error
  val error_of_exn : exn -> location_error option
  val register_error_of_exn : (exn -> location_error option) -> unit
  val report_exception : Format.formatter -> exn -> unit
  val get_error_message : location_error -> string
  val set_error_message : location_error -> string -> location_error
  val make_error_of_message : loc:Location.t -> string -> sub:(Location.t * string) list -> location_error
  val print_error : Format.formatter -> location_error -> unit
  val raise_error : location_error -> 'a
end

module Helpers_impl = struct
  type nonrec location_error = location_error
  let error_of_exn = error_of_exn
  let register_error_of_exn = register_error_of_exn
  let report_exception = report_exception
  let get_error_message = get_error_message
  let set_error_message = set_error_message
  let make_error_of_message = make_error_of_message
  let print_error = print_error
  let raise_error err = raise (Location.Error err)
end

end
module Ast_402
= struct
#1 "ast_402.ml"
# 1 "src/ast_402.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module Location = Location
module Longident = Longident

module Asttypes = struct
  (* Auxiliary a.s.t. types used by parsetree and typedtree. *)

  type constant (*IF_CURRENT = Asttypes.constant *) =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag (*IF_CURRENT = Asttypes.rec_flag *) = Nonrecursive | Recursive

  type direction_flag (*IF_CURRENT = Asttypes.direction_flag *) = Upto | Downto

  type private_flag (*IF_CURRENT = Asttypes.private_flag *) = Private | Public

  type mutable_flag (*IF_CURRENT = Asttypes.mutable_flag *) = Immutable | Mutable

  type virtual_flag (*IF_CURRENT = Asttypes.virtual_flag *) = Virtual | Concrete

  type override_flag (*IF_CURRENT = Asttypes.override_flag *) = Override | Fresh

  type closed_flag (*IF_CURRENT = Asttypes.closed_flag *) = Closed | Open

  type label = string

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance (*IF_CURRENT = Asttypes.variance *) =
    | Covariant
    | Contravariant
    | Invariant
end

module Parsetree = struct
  (** Abstract syntax tree produced by parsing *)

  open Asttypes

  (** {2 Extension points} *)

  type attribute = string loc * payload
         (* [@id ARG]
            [@@id ARG]

            Metadata containers passed around within the AST.
            The compiler ignores unknown attributes.
         *)

  and extension = string loc * payload
        (* [%id ARG]
           [%%id ARG]

           Sub-language placeholder -- rejected by the typechecker.
        *)

  and attributes = attribute list

  and payload (*IF_CURRENT = Parsetree.payload *) =
    | PStr of structure
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {2 Core language} *)

  (* Type expressions *)

  and core_type (*IF_CURRENT = Parsetree.core_type *) =
      {
       ptyp_desc: core_type_desc;
       ptyp_loc: Location.t;
       ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and core_type_desc (*IF_CURRENT = Parsetree.core_type_desc *) =
    | Ptyp_any
          (*  _ *)
    | Ptyp_var of string
          (* 'a *)
    | Ptyp_arrow of label * core_type * core_type
          (* T1 -> T2       (label = "")
             ~l:T1 -> T2    (label = "l")
             ?l:T1 -> T2    (label = "?l")
           *)
    | Ptyp_tuple of core_type list
          (* T1 * ... * Tn

             Invariant: n >= 2
          *)
    | Ptyp_constr of Longident.t loc * core_type list
          (* tconstr
             T tconstr
             (T1, ..., Tn) tconstr
           *)
    | Ptyp_object of (string * attributes * core_type) list * closed_flag
          (* < l1:T1; ...; ln:Tn >     (flag = Closed)
             < l1:T1; ...; ln:Tn; .. > (flag = Open)
           *)
    | Ptyp_class of Longident.t loc * core_type list
          (* #tconstr
             T #tconstr
             (T1, ..., Tn) #tconstr
           *)
    | Ptyp_alias of core_type * string
          (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
          (* [ `A|`B ]         (flag = Closed; labels = None)
             [> `A|`B ]        (flag = Open;   labels = None)
             [< `A|`B ]        (flag = Closed; labels = Some [])
             [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
           *)
    | Ptyp_poly of string list * core_type
          (* 'a1 ... 'an. T

             Can only appear in the following context:

             - As the core_type of a Ppat_constraint node corresponding
               to a constraint on a let-binding: let x : 'a1 ... 'an. T
               = e ...

             - Under Cfk_virtual for methods (not values).

             - As the core_type of a Pctf_method node.

             - As the core_type of a Pexp_poly node.

             - As the pld_type field of a label_declaration.

             - As a core_type of a Ptyp_object node.
           *)

    | Ptyp_package of package_type
          (* (module S) *)
    | Ptyp_extension of extension
          (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
        (*
          (module S)
          (module S with type t1 = T1 and ... and tn = Tn)
         *)

  and row_field (*IF_CURRENT = Parsetree.row_field *) =
    | Rtag of label * attributes * bool * core_type list
          (* [`A]                   ( true,  [] )
             [`A of T]              ( false, [T] )
             [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
             [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

            - The 2nd field is true if the tag contains a
              constant (empty) constructor.
            - '&' occurs when several types are used for the same constructor
              (see 4.2 in the manual)

            - TODO: switch to a record representation, and keep location
          *)
    | Rinherit of core_type
          (* [ T ] *)

  (* Patterns *)

  and pattern (*IF_CURRENT = Parsetree.pattern *) =
      {
       ppat_desc: pattern_desc;
       ppat_loc: Location.t;
       ppat_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and pattern_desc (*IF_CURRENT = Parsetree.pattern_desc *) =
    | Ppat_any
          (* _ *)
    | Ppat_var of string loc
          (* x *)
    | Ppat_alias of pattern * string loc
          (* P as 'a *)
    | Ppat_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
          (* 'a'..'z'

             Other forms of interval are recognized by the parser
             but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
          (* (P1, ..., Pn)

             Invariant: n >= 2
          *)
    | Ppat_construct of Longident.t loc * pattern option
          (* C                None
             C P              Some P
             C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
           *)
    | Ppat_variant of label * pattern option
          (* `A             (None)
             `A P           (Some P)
           *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
          (* { l1=P1; ...; ln=Pn }     (flag = Closed)
             { l1=P1; ...; ln=Pn; _}   (flag = Open)

             Invariant: n > 0
           *)
    | Ppat_array of pattern list
          (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
          (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
          (* (P : T) *)
    | Ppat_type of Longident.t loc
          (* #tconst *)
    | Ppat_lazy of pattern
          (* lazy P *)
    | Ppat_unpack of string loc
          (* (module P)
             Note: (module P : S) is represented as
             Ppat_constraint(Ppat_unpack, Ptyp_package)
           *)
    | Ppat_exception of pattern
          (* exception P *)
    | Ppat_extension of extension
          (* [%id] *)

  (* Value expressions *)

  and expression (*IF_CURRENT = Parsetree.expression *) =
      {
       pexp_desc: expression_desc;
       pexp_loc: Location.t;
       pexp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and expression_desc (*IF_CURRENT = Parsetree.expression_desc *) =
    | Pexp_ident of Longident.t loc
          (* x
             M.x
           *)
    | Pexp_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
          (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
           *)
    | Pexp_function of case list
          (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of label * expression option * pattern * expression
          (* fun P -> E1                          (lab = "", None)
             fun ~l:P -> E1                       (lab = "l", None)
             fun ?l:P -> E1                       (lab = "?l", None)
             fun ?l:(P = E0) -> E1                (lab = "?l", Some E0)

             Notes:
             - If E0 is provided, lab must start with '?'.
             - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
             - "let f P = E" is represented using Pexp_fun.
           *)
    | Pexp_apply of expression * (label * expression) list
          (* E0 ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pexp_match of expression * case list
          (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * case list
          (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
          (* (E1, ..., En)

             Invariant: n >= 2
          *)
    | Pexp_construct of Longident.t loc * expression option
          (* C                None
             C E              Some E
             C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
          *)
    | Pexp_variant of label * expression option
          (* `A             (None)
             `A E           (Some E)
           *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
          (* { l1=P1; ...; ln=Pn }     (None)
             { E0 with l1=P1; ...; ln=Pn }   (Some E0)

             Invariant: n > 0
           *)
    | Pexp_field of expression * Longident.t loc
          (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
          (* E1.l <- E2 *)
    | Pexp_array of expression list
          (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
          (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
          (* E1; E2 *)
    | Pexp_while of expression * expression
          (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
          (* for i = E1 to E2 do E3 done      (flag = Upto)
             for i = E1 downto E2 do E3 done  (flag = Downto)
           *)
    | Pexp_constraint of expression * core_type
          (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
          (* (E :> T)        (None, T)
             (E : T0 :> T)   (Some T0, T)
           *)
    | Pexp_send of expression * string
          (*  E # m *)
    | Pexp_new of Longident.t loc
          (* new M.c *)
    | Pexp_setinstvar of string loc * expression
          (* x <- 2 *)
    | Pexp_override of (string loc * expression) list
          (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string loc * module_expr * expression
          (* let module M = ME in E *)
    | Pexp_assert of expression
          (* assert E
             Note: "assert false" is treated in a special way by the
             type-checker. *)
    | Pexp_lazy of expression
          (* lazy E *)
    | Pexp_poly of expression * core_type option
          (* Used for method bodies.

             Can only be used as the expression under Cfk_concrete
             for methods (not values). *)
    | Pexp_object of class_structure
          (* object ... end *)
    | Pexp_newtype of string * expression
          (* fun (type t) -> E *)
    | Pexp_pack of module_expr
          (* (module ME)

             (module ME : S) is represented as
             Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of override_flag * Longident.t loc * expression
          (* let open M in E
             let! open M in E
          *)
    | Pexp_extension of extension
          (* [%id] *)

  and case (*IF_CURRENT = Parsetree.case *) =   (* (P -> E) or (P when E0 -> E) *)
      {
       pc_lhs: pattern;
       pc_guard: expression option;
       pc_rhs: expression;
      }

  (* Value descriptions *)

  and value_description (*IF_CURRENT = Parsetree.value_description *) =
      {
       pval_name: string loc;
       pval_type: core_type;
       pval_prim: string list;
       pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
       pval_loc: Location.t;
      }

  (*
    val x: T                            (prim = [])
    external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])

    Note: when used under Pstr_primitive, prim cannot be empty
  *)

  (* Type declarations *)

  and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
      {
       ptype_name: string loc;
       ptype_params: (core_type * variance) list;
             (* ('a1,...'an) t; None represents  _*)
       ptype_cstrs: (core_type * core_type * Location.t) list;
             (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
       ptype_kind: type_kind;
       ptype_private: private_flag;   (* = private ... *)
       ptype_manifest: core_type option;  (* = T *)
       ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
       ptype_loc: Location.t;
      }

  (*
    type t                     (abstract, no manifest)
    type t = T0                (abstract, manifest=T0)
    type t = C of T | ...      (variant,  no manifest)
    type t = T0 = C of T | ... (variant,  manifest=T0)
    type t = {l: T; ...}       (record,   no manifest)
    type t = T0 = {l : T; ...} (record,   manifest=T0)
    type t = ..                (open,     no manifest)
  *)

  and type_kind (*IF_CURRENT = Parsetree.type_kind *) =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
          (* Invariant: non-empty list *)
    | Ptype_record of label_declaration list
          (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration (*IF_CURRENT = Parsetree.label_declaration *) =
      {
       pld_name: string loc;
       pld_mutable: mutable_flag;
       pld_type: core_type;
       pld_loc: Location.t;
       pld_attributes: attributes; (* l [@id1] [@id2] : T *)
      }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration (*IF_CURRENT = Parsetree.constructor_declaration *) =
      {
       pcd_name: string loc;
       pcd_args: core_type list;
       pcd_res: core_type option;
       pcd_loc: Location.t;
       pcd_attributes: attributes; (* C [@id1] [@id2] of ... *)
      }
  (*
    | C of T1 * ... * Tn     (res = None)
    | C: T0                  (args = [], res = Some T0)
    | C: T1 * ... * Tn -> T0 (res = Some T0)
  *)

  and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
      {
       ptyext_path: Longident.t loc;
       ptyext_params: (core_type * variance) list;
       ptyext_constructors: extension_constructor list;
       ptyext_private: private_flag;
       ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      }
  (*
    type t += ...
  *)

  and extension_constructor (*IF_CURRENT = Parsetree.extension_constructor *) =
      {
       pext_name: string loc;
       pext_kind : extension_constructor_kind;
       pext_loc : Location.t;
       pext_attributes: attributes; (* C [@id1] [@id2] of ... *)
      }

  and extension_constructor_kind (*IF_CURRENT = Parsetree.extension_constructor_kind *) =
      Pext_decl of core_type list * core_type option
        (*
           | C of T1 * ... * Tn     ([T1; ...; Tn], None)
           | C: T0                  ([], Some T0)
           | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
         *)
    | Pext_rebind of Longident.t loc
        (*
           | C = D
         *)

  (** {2 Class language} *)

  (* Type expressions for the class language *)

  and class_type (*IF_CURRENT = Parsetree.class_type *) =
      {
       pcty_desc: class_type_desc;
       pcty_loc: Location.t;
       pcty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_type_desc (*IF_CURRENT = Parsetree.class_type_desc *) =
    | Pcty_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
          (* object ... end *)
    | Pcty_arrow of label * core_type * class_type
          (* T -> CT       (label = "")
             ~l:T -> CT    (label = "l")
             ?l:T -> CT    (label = "?l")
           *)
    | Pcty_extension of extension
          (* [%id] *)

  and class_signature (*IF_CURRENT = Parsetree.class_signature *) =
      {
       pcsig_self: core_type;
       pcsig_fields: class_type_field list;
      }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
   *)

  and class_type_field (*IF_CURRENT = Parsetree.class_type_field *) =
      {
       pctf_desc: class_type_field_desc;
       pctf_loc: Location.t;
       pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_type_field_desc (*IF_CURRENT = Parsetree.class_type_field_desc *) =
    | Pctf_inherit of class_type
          (* inherit CT *)
    | Pctf_val of (string * mutable_flag * virtual_flag * core_type)
          (* val x: T *)
    | Pctf_method  of (string * private_flag * virtual_flag * core_type)
          (* method x: T

             Note: T can be a Ptyp_poly.
           *)
    | Pctf_constraint  of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
          (* [@@@id] *)
    | Pctf_extension of extension
          (* [%%id] *)

  and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
      {
       pci_virt: virtual_flag;
       pci_params: (core_type * variance) list;
       pci_name: string loc;
       pci_expr: 'a;
       pci_loc: Location.t;
       pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr (*IF_CURRENT = Parsetree.class_expr *) =
      {
       pcl_desc: class_expr_desc;
       pcl_loc: Location.t;
       pcl_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_expr_desc (*IF_CURRENT = Parsetree.class_expr_desc *) =
    | Pcl_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
          (* object ... end *)
    | Pcl_fun of label * expression option * pattern * class_expr
          (* fun P -> CE                          (lab = "", None)
             fun ~l:P -> CE                       (lab = "l", None)
             fun ?l:P -> CE                       (lab = "?l", None)
             fun ?l:(P = E0) -> CE                (lab = "?l", Some E0)
           *)
    | Pcl_apply of class_expr * (label * expression) list
          (* CE ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pcl_let of rec_flag * value_binding list * class_expr
          (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
           *)
    | Pcl_constraint of class_expr * class_type
          (* (CE : CT) *)
    | Pcl_extension of extension
          (* [%id] *)

  and class_structure (*IF_CURRENT = Parsetree.class_structure *) =
      {
       pcstr_self: pattern;
       pcstr_fields: class_field list;
      }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
   *)

  and class_field (*IF_CURRENT = Parsetree.class_field *) =
      {
       pcf_desc: class_field_desc;
       pcf_loc: Location.t;
       pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_field_desc (*IF_CURRENT = Parsetree.class_field_desc *) =
    | Pcf_inherit of override_flag * class_expr * string option
          (* inherit CE
             inherit CE as x
             inherit! CE
             inherit! CE as x
           *)
    | Pcf_val of (string loc * mutable_flag * class_field_kind)
          (* val x = E
             val virtual x: T
           *)
    | Pcf_method of (string loc * private_flag * class_field_kind)
          (* method x = E            (E can be a Pexp_poly)
             method virtual x: T     (T can be a Ptyp_poly)
           *)
    | Pcf_constraint of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pcf_initializer of expression
          (* initializer E *)
    | Pcf_attribute of attribute
          (* [@@@id] *)
    | Pcf_extension of extension
          (* [%%id] *)

  and class_field_kind (*IF_CURRENT = Parsetree.class_field_kind *) =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {2 Module language} *)

  (* Type expressions for the module language *)

  and module_type (*IF_CURRENT = Parsetree.module_type *) =
      {
       pmty_desc: module_type_desc;
       pmty_loc: Location.t;
       pmty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_type_desc (*IF_CURRENT = Parsetree.module_type_desc *) =
    | Pmty_ident of Longident.t loc
          (* S *)
    | Pmty_signature of signature
          (* sig ... end *)
    | Pmty_functor of string loc * module_type option * module_type
          (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
          (* MT with ... *)
    | Pmty_typeof of module_expr
          (* module type of ME *)
    | Pmty_extension of extension
          (* [%id] *)
    | Pmty_alias of Longident.t loc
          (* (module M) *)

  and signature = signature_item list

  and signature_item (*IF_CURRENT = Parsetree.signature_item *) =
      {
       psig_desc: signature_item_desc;
       psig_loc: Location.t;
      }

  and signature_item_desc (*IF_CURRENT = Parsetree.signature_item_desc *) =
    | Psig_value of value_description
          (*
            val x: T
            external x: T = "s1" ... "sn"
           *)
    | Psig_type of type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Psig_typext of type_extension
          (* type t1 += ... *)
    | Psig_exception of extension_constructor
          (* exception C of T *)
    | Psig_module of module_declaration
          (* module X : MT *)
    | Psig_recmodule of module_declaration list
          (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
          (* module type S = MT
             module type S *)
    | Psig_open of open_description
          (* open X *)
    | Psig_include of include_description
          (* include MT *)
    | Psig_class of class_description list
          (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
          (* [@@@id] *)
    | Psig_extension of extension * attributes
          (* [%%id] *)

  and module_declaration (*IF_CURRENT = Parsetree.module_declaration *) =
      {
       pmd_name: string loc;
       pmd_type: module_type;
       pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmd_loc: Location.t;
      }
  (* S : MT *)

  and module_type_declaration (*IF_CURRENT = Parsetree.module_type_declaration *) =
      {
       pmtd_name: string loc;
       pmtd_type: module_type option;
       pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmtd_loc: Location.t;
      }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and open_description (*IF_CURRENT = Parsetree.open_description *) =
      {
       popen_lid: Longident.t loc;
       popen_override: override_flag;
       popen_loc: Location.t;
       popen_attributes: attributes;
      }
  (* open! X - popen_override = Override (silences the 'used identifier
                                shadowing' warning)
     open  X - popen_override = Fresh
   *)

  and 'a include_infos (*IF_CURRENT = 'a Parsetree.include_infos *) =
      {
       pincl_mod: 'a;
       pincl_loc: Location.t;
       pincl_attributes: attributes;
      }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint (*IF_CURRENT = Parsetree.with_constraint *) =
    | Pwith_type of Longident.t loc * type_declaration
          (* with type X.t = ...

             Note: the last component of the longident must match
             the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
          (* with module X.Y = Z *)
    | Pwith_typesubst of type_declaration
          (* with type t := ... *)
    | Pwith_modsubst of string loc * Longident.t loc
          (* with module X := Z *)

  (* Value expressions for the module language *)

  and module_expr (*IF_CURRENT = Parsetree.module_expr *) =
      {
       pmod_desc: module_expr_desc;
       pmod_loc: Location.t;
       pmod_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_expr_desc (*IF_CURRENT = Parsetree.module_expr_desc *) =
    | Pmod_ident of Longident.t loc
          (* X *)
    | Pmod_structure of structure
          (* struct ... end *)
    | Pmod_functor of string loc * module_type option * module_expr
          (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
          (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
          (* (ME : MT) *)
    | Pmod_unpack of expression
          (* (val E) *)
    | Pmod_extension of extension
          (* [%id] *)

  and structure = structure_item list

  and structure_item (*IF_CURRENT = Parsetree.structure_item *) =
      {
       pstr_desc: structure_item_desc;
       pstr_loc: Location.t;
      }

  and structure_item_desc (*IF_CURRENT = Parsetree.structure_item_desc *) =
    | Pstr_eval of expression * attributes
          (* E *)
    | Pstr_value of rec_flag * value_binding list
          (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
           *)
    | Pstr_primitive of value_description
          (* external x: T = "s1" ... "sn" *)
    | Pstr_type of type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
          (* type t1 += ... *)
    | Pstr_exception of extension_constructor
          (* exception C of T
             exception C = M.X *)
    | Pstr_module of module_binding
          (* module X = ME *)
    | Pstr_recmodule of module_binding list
          (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
          (* module type S = MT *)
    | Pstr_open of open_description
          (* open X *)
    | Pstr_class of class_declaration list
          (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
          (* include ME *)
    | Pstr_attribute of attribute
          (* [@@@id] *)
    | Pstr_extension of extension * attributes
          (* [%%id] *)

  and value_binding (*IF_CURRENT = Parsetree.value_binding *) =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding (*IF_CURRENT = Parsetree.module_binding *) =
      {
       pmb_name: string loc;
       pmb_expr: module_expr;
       pmb_attributes: attributes;
       pmb_loc: Location.t;
      }
  (* X = ME *)

  (** {2 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase (*IF_CURRENT = Parsetree.toplevel_phrase *) =
    | Ptop_def of structure
    | Ptop_dir of string * directive_argument
       (* #use, #load ... *)

  and directive_argument (*IF_CURRENT = Parsetree.directive_argument *) =
    | Pdir_none
    | Pdir_string of string
    | Pdir_int of int
    | Pdir_ident of Longident.t
    | Pdir_bool of bool
end

module Docstrings : sig
  (** {3 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {3 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

end = struct
  open Location

  (* Docstrings *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t; }

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc; }
    in
    ds

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Asttypes in
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Const_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (doc_loc, PStr [item])

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Asttypes in
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Const_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (text_loc, PStr [item])

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""; _} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

end

module Ast_helper : sig
  (** Helpers to produce Parsetree fragments *)

  open Parsetree
  open Asttypes
  open Docstrings

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  (** {2 Default locations} *)

  val default_loc: loc ref
      (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
      (** Set the [default_loc] within the scope of the execution
          of the provided function. *)

  (** {2 Core language} *)

  (** Type expressions *)
  module Typ :
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
      val attr: core_type -> attribute -> core_type

      val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
      val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
      val arrow: ?loc:loc -> ?attrs:attrs -> label -> core_type -> core_type
                 -> core_type
      val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val object_: ?loc:loc -> ?attrs:attrs ->
                    (string * attributes * core_type) list -> closed_flag ->
                    core_type
      val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
      val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
                   -> label list option -> core_type
      val poly: ?loc:loc -> ?attrs:attrs -> string list -> core_type -> core_type
      val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
                   -> core_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

      val force_poly: core_type -> core_type
    end

  (** Patterns *)
  module Pat:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
      val attr:pattern -> attribute -> pattern

      val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
      val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
      val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
      val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
      val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
      val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
                  -> pattern
      val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
      val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
      val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
      val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
    end

  (** Expressions *)
  module Exp:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
      val attr: expression -> attribute -> expression

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
                -> expression -> expression
      val fun_: ?loc:loc -> ?attrs:attrs -> label -> expression option -> pattern
                -> expression -> expression
      val function_: ?loc:loc -> ?attrs:attrs -> case list -> expression
      val apply: ?loc:loc -> ?attrs:attrs -> expression
                 -> (label * expression) list -> expression
      val match_: ?loc:loc -> ?attrs:attrs -> expression -> case list
                  -> expression
      val try_: ?loc:loc -> ?attrs:attrs -> expression -> case list -> expression
      val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
                     -> expression
      val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
                   -> expression
      val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
                  -> expression option -> expression
      val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
                    -> expression
      val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
                      -> expression option -> expression
      val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
                    -> expression
      val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
                  -> expression
      val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
                -> direction_flag -> expression -> expression
      val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                  -> core_type -> expression
      val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
                       -> expression
      val send: ?loc:loc -> ?attrs:attrs -> expression -> string -> expression
      val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
                    -> expression
      val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
                     -> expression
      val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option -> expression
      val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
      val newtype: ?loc:loc -> ?attrs:attrs -> string -> expression -> expression
      val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> expression -> expression
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression

      val case: pattern -> ?guard:expression -> expression -> case
    end

  (** Value declarations *)
  module Val:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        ?prim:string list -> str -> core_type -> value_description
    end

  (** Type declarations *)
  module Type:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?params:(core_type * variance) list -> ?cstrs:(core_type * core_type * loc) list ->
        ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
        type_declaration

      val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?args:core_type list -> ?res:core_type -> str -> constructor_declaration
      val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?mut:mutable_flag -> str -> core_type -> label_declaration
    end

  (** Type extensions *)
  module Te:
    sig
      val mk: ?attrs:attrs -> ?docs:docs ->
        ?params:(core_type * variance) list -> ?priv:private_flag ->
        lid -> extension_constructor list -> type_extension

      val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> extension_constructor_kind -> extension_constructor

      val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        ?args:core_type list -> ?res:core_type -> str -> extension_constructor
      val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> lid -> extension_constructor
    end

  (** {2 Module language} *)

  (** Module type expressions *)
  module Mty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
      val attr: module_type -> attribute -> module_type

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_type -> module_type
      val with_: ?loc:loc -> ?attrs:attrs -> module_type -> with_constraint list -> module_type
      val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
    end

  (** Module expressions *)
  module Mod:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
      val attr: module_expr -> attribute -> module_expr

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
      val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_expr -> module_expr
      val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr -> module_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type -> module_expr
      val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
    end

  (** Signature items *)
  module Sig:
    sig
      val mk: ?loc:loc -> signature_item_desc -> signature_item

      val value: ?loc:loc -> value_description -> signature_item
      val type_: ?loc:loc -> type_declaration list -> signature_item
      val type_extension: ?loc:loc -> type_extension -> signature_item
      val exception_: ?loc:loc -> extension_constructor -> signature_item
      val module_: ?loc:loc -> module_declaration -> signature_item
      val rec_module: ?loc:loc -> module_declaration list -> signature_item
      val modtype: ?loc:loc -> module_type_declaration -> signature_item
      val open_: ?loc:loc -> open_description -> signature_item
      val include_: ?loc:loc -> include_description -> signature_item
      val class_: ?loc:loc -> class_description list -> signature_item
      val class_type: ?loc:loc -> class_type_declaration list -> signature_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
      val attribute: ?loc:loc -> attribute -> signature_item
      val text: text -> signature_item list
    end

  (** Structure items *)
  module Str:
    sig
      val mk: ?loc:loc -> structure_item_desc -> structure_item

      val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
      val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
      val primitive: ?loc:loc -> value_description -> structure_item
      val type_: ?loc:loc -> type_declaration list -> structure_item
      val type_extension: ?loc:loc -> type_extension -> structure_item
      val exception_: ?loc:loc -> extension_constructor -> structure_item
      val module_: ?loc:loc -> module_binding -> structure_item
      val rec_module: ?loc:loc -> module_binding list -> structure_item
      val modtype: ?loc:loc -> module_type_declaration -> structure_item
      val open_: ?loc:loc -> open_description -> structure_item
      val class_: ?loc:loc -> class_declaration list -> structure_item
      val class_type: ?loc:loc -> class_type_declaration list -> structure_item
      val include_: ?loc:loc -> include_declaration -> structure_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
      val attribute: ?loc:loc -> attribute -> structure_item
      val text: text -> structure_item list
    end

  (** Module declarations *)
  module Md:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_type -> module_declaration
    end

  (** Module type declarations *)
  module Mtd:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?typ:module_type -> str -> module_type_declaration
    end

  (** Module bindings *)
  module Mb:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_expr -> module_binding
    end

  (* Opens *)
  module Opn:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
        ?override:override_flag -> lid -> open_description
    end

  (* Includes *)
  module Incl:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
    end

  (** Value bindings *)

  module Vb:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        pattern -> expression -> value_binding
    end


  (** {2 Class language} *)

  (** Class type expressions *)
  module Cty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
      val attr: class_type -> attribute -> class_type

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
      val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
      val arrow: ?loc:loc -> ?attrs:attrs -> label -> core_type -> class_type -> class_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
    end

  (** Class type fields *)
  module Ctf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        class_type_field_desc -> class_type_field
      val attr: class_type_field -> attribute -> class_type_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
      val val_: ?loc:loc -> ?attrs:attrs -> string -> mutable_flag -> virtual_flag -> core_type -> class_type_field
      val method_: ?loc:loc -> ?attrs:attrs -> string -> private_flag -> virtual_flag -> core_type -> class_type_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type -> class_type_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
      val attribute: ?loc:loc -> attribute -> class_type_field
      val text: text -> class_type_field list
    end

  (** Class expressions *)
  module Cl:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
      val attr: class_expr -> attribute -> class_expr

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
      val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
      val fun_: ?loc:loc -> ?attrs:attrs -> label -> expression option -> pattern -> class_expr -> class_expr
      val apply: ?loc:loc -> ?attrs:attrs -> class_expr -> (label * expression) list -> class_expr
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list -> class_expr -> class_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type -> class_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
    end

  (** Class fields *)
  module Cf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc -> class_field
      val attr: class_field -> attribute -> class_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr -> string option -> class_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag -> class_field_kind -> class_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag -> class_field_kind -> class_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type -> class_field
      val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
      val attribute: ?loc:loc -> attribute -> class_field
      val text: text -> class_field list

      val virtual_: core_type -> class_field_kind
      val concrete: override_flag -> expression -> class_field_kind

    end

  (** Classes *)
  module Ci:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?virt:virtual_flag -> ?params:(core_type * variance) list ->
        str -> 'a -> 'a class_infos
    end

  (** Class signatures *)
  module Csig:
    sig
      val mk: core_type -> class_type_field list -> class_signature
    end

  (** Class structures *)
  module Cstr:
    sig
      val mk: pattern -> class_field list -> class_structure
    end

end = struct
  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Parsetree
  open Docstrings

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    let old = !default_loc in
    default_loc := l;
    try let r = f () in default_loc := old; r
    with exn -> default_loc := old; raise exn

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs}
    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)
  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d; ppat_loc = loc; ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d; pexp_loc = loc; pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_open (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)

    let case lhs ?guard rhs =
      {
       pc_lhs = lhs;
       pc_guard = guard;
       pc_rhs = rhs;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg arg_ty body =
      mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc a = mk ?loc (Psig_type a)
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc a = mk ?loc (Pstr_type a)
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcl_desc = d;
       pcl_loc = loc;
       pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcty_desc = d;
       pcty_loc = loc;
       pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
             ?(docs = empty_docs) d =
      {
       pctf_desc = d;
       pctf_loc = loc;
       pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
       pcf_desc = d;
       pcf_loc = loc;
       pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(prim = []) name typ =
      {
       pval_name = name;
       pval_type = typ;
       pval_attributes = add_docs_attrs docs attrs;
       pval_loc = loc;
       pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name typ =
      {
       pmd_name = name;
       pmd_type = typ;
       pmd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmd_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) ?typ name =
      {
       pmtd_name = name;
       pmtd_type = typ;
       pmtd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name expr =
      {
       pmb_name = name;
       pmb_expr = expr;
       pmb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(override = Fresh) lid =
      {
       popen_lid = lid;
       popen_override = override;
       popen_loc = loc;
       popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
       pincl_mod = mexpr;
       pincl_loc = loc;
       pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(text = []) pat expr =
      {
       pvb_pat = pat;
       pvb_expr = expr;
       pvb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(virt = Concrete) ?(params = []) name expr =
      {
       pci_virt = virt;
       pci_params = params;
       pci_name = name;
       pci_expr = expr;
       pci_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
        ?(params = [])
        ?(cstrs = [])
        ?(kind = Ptype_abstract)
        ?(priv = Public)
        ?manifest
        name =
      {
       ptype_name = name;
       ptype_params = params;
       ptype_cstrs = cstrs;
       ptype_kind = kind;
       ptype_private = priv;
       ptype_manifest = manifest;
       ptype_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(args = []) ?res name =
      {
       pcd_name = name;
       pcd_args = args;
       pcd_res = res;
       pcd_loc = loc;
       pcd_attributes = add_info_attrs info attrs;
      }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(mut = Immutable) name typ =
      {
       pld_name = name;
       pld_mutable = mut;
       pld_type = typ;
       pld_loc = loc;
       pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(attrs = []) ?(docs = empty_docs)
          ?(params = []) ?(priv = Public) path constructors =
      {
       ptyext_path = path;
       ptyext_params = params;
       ptyext_constructors = constructors;
       ptyext_private = priv;
       ptyext_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
       pext_name = name;
       pext_kind = kind;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) ?(args = []) ?res name =
      {
       pext_name = name;
       pext_kind = Pext_decl(args, res);
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
       pext_name = name;
       pext_kind = Pext_rebind lid;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
       pcsig_self = self;
       pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
       pcstr_self = self;
       pcstr_fields = fields;
      }
  end

end

module Ast_mapper : sig
  (** The interface of a -ppx rewriter

    A -ppx rewriter is a program that accepts a serialized abstract syntax
    tree and outputs another, possibly modified, abstract syntax tree.
    This module encapsulates the interface between the compiler and
    the -ppx rewriters, handling such details as the serialization format,
    forwarding of command-line flags, and storing state.

    {!mapper} allows to implement AST rewriting using open recursion.
    A typical mapper would be based on {!default_mapper}, a deep
    identity mapper, and will fall back on it for handling the syntax it
    does not modify. For example:

    {[
  open Asttypes
  open Parsetree
  open Ast_mapper

  let test_mapper argv =
    { default_mapper with
      expr = fun mapper expr ->
        match expr with
        | { pexp_desc = Pexp_extension ({ txt = "test" }, PStr [])} ->
          Ast_helper.Exp.constant (Const_int 42)
        | other -> default_mapper.expr mapper other; }

  let () =
    register "ppx_test" test_mapper]}

    This -ppx rewriter, which replaces [[%test]] in expressions with
    the constant [42], can be compiled using
    [ocamlc -o ppx_test -I +compiler-libs ocamlcommon.cma ppx_test.ml].

    *)

  open Parsetree

  (** {2 A generic Parsetree mapper} *)

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {2 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

  include Locations.Helpers_intf

end = struct
  (* A generic Parsetree mapping class *)

  (*
  [@@@ocaml.warning "+9"]
    (* Ensure that record patterns don't miss any field. *)
  *)


  open Parsetree
  open Ast_helper
  open Location

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub = function
      | Rtag (l, attrs, b, tl) ->
          Rtag (l, sub.attributes sub attrs, b, List.map (sub.typ sub) tl)
      | Rinherit t -> Rinherit (sub.typ sub t)

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
          arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
          let f (s, a, t) = (s, sub.attributes sub a, sub.typ sub t) in
          object_ ~loc ~attrs (List.map f l) o
      | Ptyp_class (lid, tl) ->
          class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
          variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs sl (sub.typ sub t)
      | Ptyp_package (lid, l) ->
          package ~loc ~attrs (map_loc sub lid)
            (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
        {ptype_name; ptype_params; ptype_cstrs;
         ptype_kind;
         ptype_private;
         ptype_manifest;
         ptype_attributes;
         ptype_loc} =
      Type.mk (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)
        ~loc:(sub.location sub ptype_loc)
        ~attrs:(sub.attributes sub ptype_attributes)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
          Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_type_extension sub
        {ptyext_path; ptyext_params;
         ptyext_constructors;
         ptyext_private;
         ptyext_attributes} =
      Te.mk
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private
        ~attrs:(sub.attributes sub ptyext_attributes)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
          Pext_decl(List.map (sub.typ sub) ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
          Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
        {pext_name;
         pext_kind;
         pext_loc;
         pext_attributes} =
      Te.constructor
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)
        ~loc:(sub.location sub pext_loc)
        ~attrs:(sub.attributes sub pext_attributes)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
          arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) -> val_ ~loc ~attrs s m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) -> method_ ~loc ~attrs s p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (s, mt1, mt2) ->
          functor_ ~loc ~attrs (map_loc sub s)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) mt1)
            (sub.module_type sub mt2)
      | Pmty_with (mt, l) ->
          with_ ~loc ~attrs (sub.module_type sub mt)
            (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
          Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
          Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst d -> Pwith_typesubst (sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
          Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type l -> type_ ~loc (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_recmodule l ->
          rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (arg, arg_ty, body) ->
          functor_ ~loc ~attrs (map_loc sub arg)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) arg_ty)
            (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
          apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
          constraint_ ~loc ~attrs (sub.module_expr sub m)
                      (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
          eval ~loc ~attrs:(sub.attributes sub attrs) (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type l -> type_ ~loc (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_description sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
          fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
            (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
          apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
          match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
          construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
          variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
          record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
            (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
          field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
          setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
            (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
          ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
            (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
          sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
          while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
          for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
            (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
          coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
            (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
          constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) -> send ~loc ~attrs (sub.expr sub e) s
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
          setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
          override ~loc ~attrs
            (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
          letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
            (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
          poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) -> newtype ~loc ~attrs s (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (ovf, lid, e) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.expr sub e)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
          construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
          record ~loc ~attrs
                 (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
          constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
          structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
          fun_ ~loc ~attrs lab
            (map_opt (sub.expr sub) e)
            (sub.pat sub p)
            (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
          apply ~loc ~attrs (sub.class_expr sub ce)
            (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
          constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) -> inherit_ ~loc ~attrs o (sub.class_expr sub ce) s
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
          method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      Ci.mk
       ~virt:pci_virt
       ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
        ~loc:(sub.location sub pci_loc)
        ~attrs:(sub.attributes sub pci_attributes)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_description =
        (fun this {popen_lid; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_lid)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );


      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
          Type.constructor
            (map_loc this pcd_name)
            ~args:(List.map (this.typ this) pcd_args)
            ?res:(map_opt (this.typ this) pcd_res)
            ~loc:(this.location this pcd_loc)
            ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(function
        | x :: l -> PStr (x :: x :: l)
        | l -> PStr l)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Asttypes.Const_string (x, None))))
      error

  let attribute_of_warning loc s =
    { loc; txt = "ocaml.ppwarning" },
    PStr ([Str.eval ~loc (Exp.constant (Asttypes.Const_string (s, None)))])

  include Locations.Helpers_impl

end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
        [Toploop.print_out_value]
        [Toploop.print_out_type]
        [Toploop.print_out_sig_item]
        [Toploop.print_out_phrase] *)

  type out_ident (*IF_CURRENT = Outcometree.out_ident *) =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of string

  type out_value (*IF_CURRENT = Outcometree.out_value *) =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type (*IF_CURRENT = Outcometree.out_type *) =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of string * string list * out_type list

  and out_variant (*IF_CURRENT = Outcometree.out_variant *) =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_name of out_ident * out_type list

  type out_class_type (*IF_CURRENT = Outcometree.out_class_type *) =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item  (*IF_CURRENT = Outcometree.out_class_sig_item *) =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type (*IF_CURRENT = Outcometree.out_module_type *) =
    | Omty_abstract
    | Omty_functor of string * out_module_type option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item  (*IF_CURRENT = Outcometree.out_sig_item *) =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of string * out_type * string list
  and out_type_decl  (*IF_CURRENT = Outcometree.out_type_decl *) =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor (*IF_CURRENT = Outcometree.out_extension_constructor *) =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension (*IF_CURRENT = Outcometree.out_type_extension *) =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_rec_status (*IF_CURRENT = Outcometree.out_rec_status *) =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status (*IF_CURRENT = Outcometree.out_ext_status*) =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase (*IF_CURRENT = Outcometree.out_phrase *) =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)

end

module Config = struct
  let ast_impl_magic_number = "Caml1999M016"
  let ast_intf_magic_number = "Caml1999N015"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Ast_403
= struct
#1 "ast_403.ml"
# 1 "src/ast_403.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module Location = Location
module Longident = Longident

module Asttypes = struct
  (* Auxiliary a.s.t. types used by parsetree and typedtree. *)

  type constant (*IF_CURRENT = Asttypes.constant *) =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag (*IF_CURRENT = Asttypes.rec_flag *) = Nonrecursive | Recursive

  type direction_flag (*IF_CURRENT = Asttypes.direction_flag *) = Upto | Downto

  (* Order matters, used in polymorphic comparison *)
  type private_flag (*IF_CURRENT = Asttypes.private_flag *) = Private | Public

  type mutable_flag (*IF_CURRENT = Asttypes.mutable_flag *) = Immutable | Mutable

  type virtual_flag (*IF_CURRENT = Asttypes.virtual_flag *) = Virtual | Concrete

  type override_flag (*IF_CURRENT = Asttypes.override_flag *) = Override | Fresh

  type closed_flag (*IF_CURRENT = Asttypes.closed_flag *) = Closed | Open

  type label = string

  type arg_label (*IF_CURRENT = Asttypes.arg_label *) =
      Nolabel
    | Labelled of string (*  label:T -> ... *)
    | Optional of string (* ?label:T -> ... *)

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance (*IF_CURRENT = Asttypes.variance *) =
    | Covariant
    | Contravariant
    | Invariant
end

module Parsetree = struct
  (** Abstract syntax tree produced by parsing *)

  open Asttypes

  type constant (*IF_CURRENT = Parsetree.constant *) =
      Pconst_integer of string * char option
    (* 3 3l 3L 3n

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes except 'l', 'L' and 'n' are rejected by the typechecker
    *)
    | Pconst_char of char
    (* 'c' *)
    | Pconst_string of string * string option
    (* "constant"
       {delim|other constant|delim}
    *)
    | Pconst_float of string * char option
    (* 3.4 2e5 1.4e-4

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes are rejected by the typechecker.
    *)

  (** {2 Extension points} *)

  type attribute = string loc * payload
         (* [@id ARG]
            [@@id ARG]

            Metadata containers passed around within the AST.
            The compiler ignores unknown attributes.
         *)

  and extension = string loc * payload
        (* [%id ARG]
           [%%id ARG]

           Sub-language placeholder -- rejected by the typechecker.
        *)

  and attributes = attribute list

  and payload (*IF_CURRENT = Parsetree.payload *) =
    | PStr of structure
    | PSig of signature (* : SIG *)
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {2 Core language} *)

  (* Type expressions *)

  and core_type (*IF_CURRENT = Parsetree.core_type *) =
      {
       ptyp_desc: core_type_desc;
       ptyp_loc: Location.t;
       ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and core_type_desc (*IF_CURRENT = Parsetree.core_type_desc *) =
    | Ptyp_any
          (*  _ *)
    | Ptyp_var of string
          (* 'a *)
    | Ptyp_arrow of arg_label * core_type * core_type
          (* T1 -> T2       Simple
             ~l:T1 -> T2    Labelled
             ?l:T1 -> T2    Otional
           *)
    | Ptyp_tuple of core_type list
          (* T1 * ... * Tn

             Invariant: n >= 2
          *)
    | Ptyp_constr of Longident.t loc * core_type list
          (* tconstr
             T tconstr
             (T1, ..., Tn) tconstr
           *)
    | Ptyp_object of (string * attributes * core_type) list * closed_flag
          (* < l1:T1; ...; ln:Tn >     (flag = Closed)
             < l1:T1; ...; ln:Tn; .. > (flag = Open)
           *)
    | Ptyp_class of Longident.t loc * core_type list
          (* #tconstr
             T #tconstr
             (T1, ..., Tn) #tconstr
           *)
    | Ptyp_alias of core_type * string
          (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
          (* [ `A|`B ]         (flag = Closed; labels = None)
             [> `A|`B ]        (flag = Open;   labels = None)
             [< `A|`B ]        (flag = Closed; labels = Some [])
             [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
           *)
    | Ptyp_poly of string list * core_type
          (* 'a1 ... 'an. T

             Can only appear in the following context:

             - As the core_type of a Ppat_constraint node corresponding
               to a constraint on a let-binding: let x : 'a1 ... 'an. T
               = e ...

             - Under Cfk_virtual for methods (not values).

             - As the core_type of a Pctf_method node.

             - As the core_type of a Pexp_poly node.

             - As the pld_type field of a label_declaration.

             - As a core_type of a Ptyp_object node.
           *)

    | Ptyp_package of package_type
          (* (module S) *)
    | Ptyp_extension of extension
          (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
        (*
          (module S)
          (module S with type t1 = T1 and ... and tn = Tn)
         *)

  and row_field (*IF_CURRENT = Parsetree.row_field *) =
    | Rtag of label * attributes * bool * core_type list
          (* [`A]                   ( true,  [] )
             [`A of T]              ( false, [T] )
             [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
             [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

            - The 2nd field is true if the tag contains a
              constant (empty) constructor.
            - '&' occurs when several types are used for the same constructor
              (see 4.2 in the manual)

            - TODO: switch to a record representation, and keep location
          *)
    | Rinherit of core_type
          (* [ T ] *)

  (* Patterns *)

  and pattern (*IF_CURRENT = Parsetree.pattern *) =
      {
       ppat_desc: pattern_desc;
       ppat_loc: Location.t;
       ppat_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and pattern_desc (*IF_CURRENT = Parsetree.pattern_desc *) =
    | Ppat_any
          (* _ *)
    | Ppat_var of string loc
          (* x *)
    | Ppat_alias of pattern * string loc
          (* P as 'a *)
    | Ppat_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
          (* 'a'..'z'

             Other forms of interval are recognized by the parser
             but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
          (* (P1, ..., Pn)

             Invariant: n >= 2
          *)
    | Ppat_construct of Longident.t loc * pattern option
          (* C                None
             C P              Some P
             C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
           *)
    | Ppat_variant of label * pattern option
          (* `A             (None)
             `A P           (Some P)
           *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
          (* { l1=P1; ...; ln=Pn }     (flag = Closed)
             { l1=P1; ...; ln=Pn; _}   (flag = Open)

             Invariant: n > 0
           *)
    | Ppat_array of pattern list
          (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
          (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
          (* (P : T) *)
    | Ppat_type of Longident.t loc
          (* #tconst *)
    | Ppat_lazy of pattern
          (* lazy P *)
    | Ppat_unpack of string loc
          (* (module P)
             Note: (module P : S) is represented as
             Ppat_constraint(Ppat_unpack, Ptyp_package)
           *)
    | Ppat_exception of pattern
          (* exception P *)
    | Ppat_extension of extension
          (* [%id] *)

  (* Value expressions *)

  and expression (*IF_CURRENT = Parsetree.expression *) =
      {
       pexp_desc: expression_desc;
       pexp_loc: Location.t;
       pexp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and expression_desc (*IF_CURRENT = Parsetree.expression_desc *) =
    | Pexp_ident of Longident.t loc
          (* x
             M.x
           *)
    | Pexp_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
          (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
           *)
    | Pexp_function of case list
          (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of arg_label * expression option * pattern * expression
          (* fun P -> E1                          (Simple, None)
             fun ~l:P -> E1                       (Labelled l, None)
             fun ?l:P -> E1                       (Optional l, None)
             fun ?l:(P = E0) -> E1                (Optional l, Some E0)

             Notes:
             - If E0 is provided, only Optional is allowed.
             - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
             - "let f P = E" is represented using Pexp_fun.
           *)
    | Pexp_apply of expression * (arg_label * expression) list
          (* E0 ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pexp_match of expression * case list
          (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * case list
          (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
          (* (E1, ..., En)

             Invariant: n >= 2
          *)
    | Pexp_construct of Longident.t loc * expression option
          (* C                None
             C E              Some E
             C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
          *)
    | Pexp_variant of label * expression option
          (* `A             (None)
             `A E           (Some E)
           *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
          (* { l1=P1; ...; ln=Pn }     (None)
             { E0 with l1=P1; ...; ln=Pn }   (Some E0)

             Invariant: n > 0
           *)
    | Pexp_field of expression * Longident.t loc
          (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
          (* E1.l <- E2 *)
    | Pexp_array of expression list
          (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
          (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
          (* E1; E2 *)
    | Pexp_while of expression * expression
          (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
          (* for i = E1 to E2 do E3 done      (flag = Upto)
             for i = E1 downto E2 do E3 done  (flag = Downto)
           *)
    | Pexp_constraint of expression * core_type
          (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
          (* (E :> T)        (None, T)
             (E : T0 :> T)   (Some T0, T)
           *)
    | Pexp_send of expression * string
          (*  E # m *)
    | Pexp_new of Longident.t loc
          (* new M.c *)
    | Pexp_setinstvar of string loc * expression
          (* x <- 2 *)
    | Pexp_override of (string loc * expression) list
          (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string loc * module_expr * expression
          (* let module M = ME in E *)
    | Pexp_assert of expression
          (* assert E
             Note: "assert false" is treated in a special way by the
             type-checker. *)
    | Pexp_lazy of expression
          (* lazy E *)
    | Pexp_poly of expression * core_type option
          (* Used for method bodies.

             Can only be used as the expression under Cfk_concrete
             for methods (not values). *)
    | Pexp_object of class_structure
          (* object ... end *)
    | Pexp_newtype of string * expression
          (* fun (type t) -> E *)
    | Pexp_pack of module_expr
          (* (module ME)

             (module ME : S) is represented as
             Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of override_flag * Longident.t loc * expression
          (* let open M in E
             let! open M in E
          *)
    | Pexp_extension of extension
          (* [%id] *)
    | Pexp_unreachable
          (* . *)

  and case (*IF_CURRENT = Parsetree.case *) =   (* (P -> E) or (P when E0 -> E) *)
      {
       pc_lhs: pattern;
       pc_guard: expression option;
       pc_rhs: expression;
      }

  (* Value descriptions *)

  and value_description (*IF_CURRENT = Parsetree.value_description *) =
      {
       pval_name: string loc;
       pval_type: core_type;
       pval_prim: string list;
       pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
       pval_loc: Location.t;
      }

  (*
    val x: T                            (prim = [])
    external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])
  *)

  (* Type declarations *)

  and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
      {
       ptype_name: string loc;
       ptype_params: (core_type * variance) list;
             (* ('a1,...'an) t; None represents  _*)
       ptype_cstrs: (core_type * core_type * Location.t) list;
             (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
       ptype_kind: type_kind;
       ptype_private: private_flag;   (* = private ... *)
       ptype_manifest: core_type option;  (* = T *)
       ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
       ptype_loc: Location.t;
      }

  (*
    type t                     (abstract, no manifest)
    type t = T0                (abstract, manifest=T0)
    type t = C of T | ...      (variant,  no manifest)
    type t = T0 = C of T | ... (variant,  manifest=T0)
    type t = {l: T; ...}       (record,   no manifest)
    type t = T0 = {l : T; ...} (record,   manifest=T0)
    type t = ..                (open,     no manifest)
  *)

  and type_kind (*IF_CURRENT = Parsetree.type_kind *) =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
          (* Invariant: non-empty list *)
    | Ptype_record of label_declaration list
          (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration (*IF_CURRENT = Parsetree.label_declaration *) =
      {
       pld_name: string loc;
       pld_mutable: mutable_flag;
       pld_type: core_type;
       pld_loc: Location.t;
       pld_attributes: attributes; (* l [@id1] [@id2] : T *)
      }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration (*IF_CURRENT = Parsetree.constructor_declaration *) =
      {
       pcd_name: string loc;
       pcd_args: constructor_arguments;
       pcd_res: core_type option;
       pcd_loc: Location.t;
       pcd_attributes: attributes; (* C [@id1] [@id2] of ... *)
      }

  and constructor_arguments (*IF_CURRENT = Parsetree.constructor_arguments *) =
    | Pcstr_tuple of core_type list
    | Pcstr_record of label_declaration list

  (*
    | C of T1 * ... * Tn     (res = None,    args = Pcstr_tuple [])
    | C: T0                  (res = Some T0, args = [])
    | C: T1 * ... * Tn -> T0 (res = Some T0, args = Pcstr_tuple)
    | C of {...}             (res = None,    args = Pcstr_record)
    | C: {...} -> T0         (res = Some T0, args = Pcstr_record)
    | C of {...} as t        (res = None,    args = Pcstr_record)
  *)

  and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
      {
       ptyext_path: Longident.t loc;
       ptyext_params: (core_type * variance) list;
       ptyext_constructors: extension_constructor list;
       ptyext_private: private_flag;
       ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      }
  (*
    type t += ...
  *)

  and extension_constructor (*IF_CURRENT = Parsetree.extension_constructor *) =
      {
       pext_name: string loc;
       pext_kind : extension_constructor_kind;
       pext_loc : Location.t;
       pext_attributes: attributes; (* C [@id1] [@id2] of ... *)
      }

  and extension_constructor_kind (*IF_CURRENT = Parsetree.extension_constructor_kind *) =
      Pext_decl of constructor_arguments * core_type option
        (*
           | C of T1 * ... * Tn     ([T1; ...; Tn], None)
           | C: T0                  ([], Some T0)
           | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
         *)
    | Pext_rebind of Longident.t loc
        (*
           | C = D
         *)

  (** {2 Class language} *)

  (* Type expressions for the class language *)

  and class_type (*IF_CURRENT = Parsetree.class_type *) =
      {
       pcty_desc: class_type_desc;
       pcty_loc: Location.t;
       pcty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_type_desc (*IF_CURRENT = Parsetree.class_type_desc *) =
    | Pcty_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
          (* object ... end *)
    | Pcty_arrow of arg_label * core_type * class_type
          (* T -> CT       Simple
             ~l:T -> CT    Labelled l
             ?l:T -> CT    Optional l
           *)
    | Pcty_extension of extension
          (* [%id] *)

  and class_signature (*IF_CURRENT = Parsetree.class_signature *) =
      {
       pcsig_self: core_type;
       pcsig_fields: class_type_field list;
      }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
   *)

  and class_type_field (*IF_CURRENT = Parsetree.class_type_field *) =
      {
       pctf_desc: class_type_field_desc;
       pctf_loc: Location.t;
       pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_type_field_desc (*IF_CURRENT = Parsetree.class_type_field_desc *) =
    | Pctf_inherit of class_type
          (* inherit CT *)
    | Pctf_val of (string * mutable_flag * virtual_flag * core_type)
          (* val x: T *)
    | Pctf_method  of (string * private_flag * virtual_flag * core_type)
          (* method x: T

             Note: T can be a Ptyp_poly.
           *)
    | Pctf_constraint  of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
          (* [@@@id] *)
    | Pctf_extension of extension
          (* [%%id] *)

  and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
      {
       pci_virt: virtual_flag;
       pci_params: (core_type * variance) list;
       pci_name: string loc;
       pci_expr: 'a;
       pci_loc: Location.t;
       pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr (*IF_CURRENT = Parsetree.class_expr *) =
      {
       pcl_desc: class_expr_desc;
       pcl_loc: Location.t;
       pcl_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_expr_desc (*IF_CURRENT = Parsetree.class_expr_desc *) =
    | Pcl_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
          (* object ... end *)
    | Pcl_fun of arg_label * expression option * pattern * class_expr
          (* fun P -> CE                          (Simple, None)
             fun ~l:P -> CE                       (Labelled l, None)
             fun ?l:P -> CE                       (Optional l, None)
             fun ?l:(P = E0) -> CE                (Optional l, Some E0)
           *)
    | Pcl_apply of class_expr * (arg_label * expression) list
          (* CE ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pcl_let of rec_flag * value_binding list * class_expr
          (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
           *)
    | Pcl_constraint of class_expr * class_type
          (* (CE : CT) *)
    | Pcl_extension of extension
          (* [%id] *)

  and class_structure (*IF_CURRENT = Parsetree.class_structure *) =
      {
       pcstr_self: pattern;
       pcstr_fields: class_field list;
      }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
   *)

  and class_field (*IF_CURRENT = Parsetree.class_field *) =
      {
       pcf_desc: class_field_desc;
       pcf_loc: Location.t;
       pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_field_desc (*IF_CURRENT = Parsetree.class_field_desc *) =
    | Pcf_inherit of override_flag * class_expr * string option
          (* inherit CE
             inherit CE as x
             inherit! CE
             inherit! CE as x
           *)
    | Pcf_val of (string loc * mutable_flag * class_field_kind)
          (* val x = E
             val virtual x: T
           *)
    | Pcf_method of (string loc * private_flag * class_field_kind)
          (* method x = E            (E can be a Pexp_poly)
             method virtual x: T     (T can be a Ptyp_poly)
           *)
    | Pcf_constraint of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pcf_initializer of expression
          (* initializer E *)
    | Pcf_attribute of attribute
          (* [@@@id] *)
    | Pcf_extension of extension
          (* [%%id] *)

  and class_field_kind (*IF_CURRENT = Parsetree.class_field_kind *) =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {2 Module language} *)

  (* Type expressions for the module language *)

  and module_type (*IF_CURRENT = Parsetree.module_type *) =
      {
       pmty_desc: module_type_desc;
       pmty_loc: Location.t;
       pmty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_type_desc (*IF_CURRENT = Parsetree.module_type_desc *) =
    | Pmty_ident of Longident.t loc
          (* S *)
    | Pmty_signature of signature
          (* sig ... end *)
    | Pmty_functor of string loc * module_type option * module_type
          (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
          (* MT with ... *)
    | Pmty_typeof of module_expr
          (* module type of ME *)
    | Pmty_extension of extension
          (* [%id] *)
    | Pmty_alias of Longident.t loc
          (* (module M) *)

  and signature = signature_item list

  and signature_item (*IF_CURRENT = Parsetree.signature_item *) =
      {
       psig_desc: signature_item_desc;
       psig_loc: Location.t;
      }

  and signature_item_desc (*IF_CURRENT = Parsetree.signature_item_desc *) =
    | Psig_value of value_description
          (*
            val x: T
            external x: T = "s1" ... "sn"
           *)
    | Psig_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Psig_typext of type_extension
          (* type t1 += ... *)
    | Psig_exception of extension_constructor
          (* exception C of T *)
    | Psig_module of module_declaration
          (* module X : MT *)
    | Psig_recmodule of module_declaration list
          (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
          (* module type S = MT
             module type S *)
    | Psig_open of open_description
          (* open X *)
    | Psig_include of include_description
          (* include MT *)
    | Psig_class of class_description list
          (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
          (* [@@@id] *)
    | Psig_extension of extension * attributes
          (* [%%id] *)

  and module_declaration (*IF_CURRENT = Parsetree.module_declaration *) =
      {
       pmd_name: string loc;
       pmd_type: module_type;
       pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmd_loc: Location.t;
      }
  (* S : MT *)

  and module_type_declaration (*IF_CURRENT = Parsetree.module_type_declaration *) =
      {
       pmtd_name: string loc;
       pmtd_type: module_type option;
       pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmtd_loc: Location.t;
      }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and open_description (*IF_CURRENT = Parsetree.open_description *) =
      {
       popen_lid: Longident.t loc;
       popen_override: override_flag;
       popen_loc: Location.t;
       popen_attributes: attributes;
      }
  (* open! X - popen_override = Override (silences the 'used identifier
                                shadowing' warning)
     open  X - popen_override = Fresh
   *)

  and 'a include_infos (*IF_CURRENT = 'a Parsetree.include_infos *) =
      {
       pincl_mod: 'a;
       pincl_loc: Location.t;
       pincl_attributes: attributes;
      }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint (*IF_CURRENT = Parsetree.with_constraint *) =
    | Pwith_type of Longident.t loc * type_declaration
          (* with type X.t = ...

             Note: the last component of the longident must match
             the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
          (* with module X.Y = Z *)
    | Pwith_typesubst of type_declaration
          (* with type t := ... *)
    | Pwith_modsubst of string loc * Longident.t loc
          (* with module X := Z *)

  (* Value expressions for the module language *)

  and module_expr (*IF_CURRENT = Parsetree.module_expr *) =
      {
       pmod_desc: module_expr_desc;
       pmod_loc: Location.t;
       pmod_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_expr_desc (*IF_CURRENT = Parsetree.module_expr_desc *) =
    | Pmod_ident of Longident.t loc
          (* X *)
    | Pmod_structure of structure
          (* struct ... end *)
    | Pmod_functor of string loc * module_type option * module_expr
          (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
          (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
          (* (ME : MT) *)
    | Pmod_unpack of expression
          (* (val E) *)
    | Pmod_extension of extension
          (* [%id] *)

  and structure = structure_item list

  and structure_item (*IF_CURRENT = Parsetree.structure_item *) =
      {
       pstr_desc: structure_item_desc;
       pstr_loc: Location.t;
      }

  and structure_item_desc (*IF_CURRENT = Parsetree.structure_item_desc *) =
    | Pstr_eval of expression * attributes
          (* E *)
    | Pstr_value of rec_flag * value_binding list
          (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
           *)
    | Pstr_primitive of value_description
          (*  val x: T
              external x: T = "s1" ... "sn" *)
    | Pstr_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
          (* type t1 += ... *)
    | Pstr_exception of extension_constructor
          (* exception C of T
             exception C = M.X *)
    | Pstr_module of module_binding
          (* module X = ME *)
    | Pstr_recmodule of module_binding list
          (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
          (* module type S = MT *)
    | Pstr_open of open_description
          (* open X *)
    | Pstr_class of class_declaration list
          (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
          (* include ME *)
    | Pstr_attribute of attribute
          (* [@@@id] *)
    | Pstr_extension of extension * attributes
          (* [%%id] *)

  and value_binding (*IF_CURRENT = Parsetree.value_binding *) =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding (*IF_CURRENT = Parsetree.module_binding *) =
      {
       pmb_name: string loc;
       pmb_expr: module_expr;
       pmb_attributes: attributes;
       pmb_loc: Location.t;
      }
  (* X = ME *)

  (** {2 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase (*IF_CURRENT = Parsetree.toplevel_phrase *) =
    | Ptop_def of structure
    | Ptop_dir of string * directive_argument
       (* #use, #load ... *)

  and directive_argument (*IF_CURRENT = Parsetree.directive_argument *) =
    | Pdir_none
    | Pdir_string of string
    | Pdir_int of string * char option
    | Pdir_ident of Longident.t
    | Pdir_bool of bool
end

module Docstrings : sig
  (** {3 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {3 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

end = struct
  open Location

  (* Docstrings *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t; }

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc; }
    in
    ds

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (doc_loc, PStr [item])

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (text_loc, PStr [item])

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""; _} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

end

module Ast_helper : sig
  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Docstrings
  open Parsetree

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  (** {2 Default locations} *)

  val default_loc: loc ref
      (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
      (** Set the [default_loc] within the scope of the execution
          of the provided function. *)

  (** {2 Constants} *)

  module Const : sig
    val char : char -> constant
    val string : ?quotation_delimiter:string -> string -> constant
    val integer : ?suffix:char -> string -> constant
    val int : ?suffix:char -> int -> constant
    val int32 : ?suffix:char -> int32 -> constant
    val int64 : ?suffix:char -> int64 -> constant
    val nativeint : ?suffix:char -> nativeint -> constant
    val float : ?suffix:char -> string -> constant
  end

  (** {2 Core language} *)

  (** Type expressions *)
  module Typ :
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
      val attr: core_type -> attribute -> core_type

      val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
      val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type -> core_type
                 -> core_type
      val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val object_: ?loc:loc -> ?attrs:attrs ->
                    (string * attributes * core_type) list -> closed_flag ->
                    core_type
      val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
      val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
                   -> label list option -> core_type
      val poly: ?loc:loc -> ?attrs:attrs -> string list -> core_type -> core_type
      val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
                   -> core_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

      val force_poly: core_type -> core_type
    end

  (** Patterns *)
  module Pat:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
      val attr:pattern -> attribute -> pattern

      val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
      val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
      val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
      val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
      val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
      val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
                  -> pattern
      val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
      val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
      val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
      val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
    end

  (** Expressions *)
  module Exp:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
      val attr: expression -> attribute -> expression

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
                -> expression -> expression
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option
                -> pattern -> expression -> expression
      val function_: ?loc:loc -> ?attrs:attrs -> case list -> expression
      val apply: ?loc:loc -> ?attrs:attrs -> expression
                 -> (arg_label * expression) list -> expression
      val match_: ?loc:loc -> ?attrs:attrs -> expression -> case list
                  -> expression
      val try_: ?loc:loc -> ?attrs:attrs -> expression -> case list -> expression
      val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
                     -> expression
      val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
                   -> expression
      val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
                  -> expression option -> expression
      val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
                    -> expression
      val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
                      -> expression option -> expression
      val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
                    -> expression
      val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
                  -> expression
      val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
                -> direction_flag -> expression -> expression
      val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                  -> core_type -> expression
      val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
                       -> expression
      val send: ?loc:loc -> ?attrs:attrs -> expression -> string -> expression
      val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
                    -> expression
      val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
                     -> expression
      val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                -> expression
      val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
      val newtype: ?loc:loc -> ?attrs:attrs -> string -> expression -> expression
      val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> expression
                 -> expression
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression
      val unreachable: ?loc:loc -> ?attrs:attrs -> unit -> expression

      val case: pattern -> ?guard:expression -> expression -> case
    end

  (** Value declarations *)
  module Val:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        ?prim:string list -> str -> core_type -> value_description
    end

  (** Type declarations *)
  module Type:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?params:(core_type * variance) list ->
        ?cstrs:(core_type * core_type * loc) list ->
        ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
        type_declaration

      val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        constructor_declaration
      val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?mut:mutable_flag -> str -> core_type -> label_declaration
    end

  (** Type extensions *)
  module Te:
    sig
      val mk: ?attrs:attrs -> ?docs:docs ->
        ?params:(core_type * variance) list -> ?priv:private_flag ->
        lid -> extension_constructor list -> type_extension

      val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> extension_constructor_kind -> extension_constructor

      val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        extension_constructor
      val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> lid -> extension_constructor
    end

  (** {2 Module language} *)

  (** Module type expressions *)
  module Mty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
      val attr: module_type -> attribute -> module_type

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_type -> module_type
      val with_: ?loc:loc -> ?attrs:attrs -> module_type ->
        with_constraint list -> module_type
      val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
    end

  (** Module expressions *)
  module Mod:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
      val attr: module_expr -> attribute -> module_expr

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
      val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_expr -> module_expr
      val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr ->
        module_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type ->
        module_expr
      val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
    end

  (** Signature items *)
  module Sig:
    sig
      val mk: ?loc:loc -> signature_item_desc -> signature_item

      val value: ?loc:loc -> value_description -> signature_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item
      val type_extension: ?loc:loc -> type_extension -> signature_item
      val exception_: ?loc:loc -> extension_constructor -> signature_item
      val module_: ?loc:loc -> module_declaration -> signature_item
      val rec_module: ?loc:loc -> module_declaration list -> signature_item
      val modtype: ?loc:loc -> module_type_declaration -> signature_item
      val open_: ?loc:loc -> open_description -> signature_item
      val include_: ?loc:loc -> include_description -> signature_item
      val class_: ?loc:loc -> class_description list -> signature_item
      val class_type: ?loc:loc -> class_type_declaration list -> signature_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
      val attribute: ?loc:loc -> attribute -> signature_item
      val text: text -> signature_item list
    end

  (** Structure items *)
  module Str:
    sig
      val mk: ?loc:loc -> structure_item_desc -> structure_item

      val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
      val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
      val primitive: ?loc:loc -> value_description -> structure_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item
      val type_extension: ?loc:loc -> type_extension -> structure_item
      val exception_: ?loc:loc -> extension_constructor -> structure_item
      val module_: ?loc:loc -> module_binding -> structure_item
      val rec_module: ?loc:loc -> module_binding list -> structure_item
      val modtype: ?loc:loc -> module_type_declaration -> structure_item
      val open_: ?loc:loc -> open_description -> structure_item
      val class_: ?loc:loc -> class_declaration list -> structure_item
      val class_type: ?loc:loc -> class_type_declaration list -> structure_item
      val include_: ?loc:loc -> include_declaration -> structure_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
      val attribute: ?loc:loc -> attribute -> structure_item
      val text: text -> structure_item list
    end

  (** Module declarations *)
  module Md:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_type -> module_declaration
    end

  (** Module type declarations *)
  module Mtd:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?typ:module_type -> str -> module_type_declaration
    end

  (** Module bindings *)
  module Mb:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_expr -> module_binding
    end

  (* Opens *)
  module Opn:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
        ?override:override_flag -> lid -> open_description
    end

  (* Includes *)
  module Incl:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
    end

  (** Value bindings *)

  module Vb:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        pattern -> expression -> value_binding
    end


  (** {2 Class language} *)

  (** Class type expressions *)
  module Cty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
      val attr: class_type -> attribute -> class_type

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
      val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type ->
        class_type -> class_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
    end

  (** Class type fields *)
  module Ctf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        class_type_field_desc -> class_type_field
      val attr: class_type_field -> attribute -> class_type_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
      val val_: ?loc:loc -> ?attrs:attrs -> string -> mutable_flag ->
        virtual_flag -> core_type -> class_type_field
      val method_: ?loc:loc -> ?attrs:attrs -> string -> private_flag ->
        virtual_flag -> core_type -> class_type_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_type_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
      val attribute: ?loc:loc -> attribute -> class_type_field
      val text: text -> class_type_field list
    end

  (** Class expressions *)
  module Cl:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
      val attr: class_expr -> attribute -> class_expr

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
      val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option ->
        pattern -> class_expr -> class_expr
      val apply: ?loc:loc -> ?attrs:attrs -> class_expr ->
        (arg_label * expression) list -> class_expr
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list ->
        class_expr -> class_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type ->
        class_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
    end

  (** Class fields *)
  module Cf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
        class_field
      val attr: class_field -> attribute -> class_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr ->
        string option -> class_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
        class_field_kind -> class_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
        class_field_kind -> class_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_field
      val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
      val attribute: ?loc:loc -> attribute -> class_field
      val text: text -> class_field list

      val virtual_: core_type -> class_field_kind
      val concrete: override_flag -> expression -> class_field_kind

    end

  (** Classes *)
  module Ci:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?virt:virtual_flag -> ?params:(core_type * variance) list ->
        str -> 'a -> 'a class_infos
    end

  (** Class signatures *)
  module Csig:
    sig
      val mk: core_type -> class_type_field list -> class_signature
    end

  (** Class structures *)
  module Cstr:
    sig
      val mk: pattern -> class_field list -> class_structure
    end

end = struct
  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Parsetree
  open Docstrings

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    let old = !default_loc in
    default_loc := l;
    try let r = f () in default_loc := old; r
    with exn -> default_loc := old; raise exn

  module Const = struct
    let integer ?suffix i = Pconst_integer (i, suffix)
    let int ?suffix i = integer ?suffix (string_of_int i)
    let int32 ?(suffix='l') i = integer ~suffix (Int32.to_string i)
    let int64 ?(suffix='L') i = integer ~suffix (Int64.to_string i)
    let nativeint ?(suffix='n') i = integer ~suffix (Nativeint.to_string i)
    let float ?suffix f = Pconst_float (f, suffix)
    let char c = Pconst_char c
    let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter)
  end

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs}
    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)
  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d; ppat_loc = loc; ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d; pexp_loc = loc; pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_open (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)
    let unreachable ?loc ?attrs () = mk ?loc ?attrs Pexp_unreachable

    let case lhs ?guard rhs =
      {
       pc_lhs = lhs;
       pc_guard = guard;
       pc_rhs = rhs;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg arg_ty body =
      mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc rec_flag a = mk ?loc (Psig_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcl_desc = d;
       pcl_loc = loc;
       pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcty_desc = d;
       pcty_loc = loc;
       pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
             ?(docs = empty_docs) d =
      {
       pctf_desc = d;
       pctf_loc = loc;
       pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
       pcf_desc = d;
       pcf_loc = loc;
       pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(prim = []) name typ =
      {
       pval_name = name;
       pval_type = typ;
       pval_attributes = add_docs_attrs docs attrs;
       pval_loc = loc;
       pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name typ =
      {
       pmd_name = name;
       pmd_type = typ;
       pmd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmd_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) ?typ name =
      {
       pmtd_name = name;
       pmtd_type = typ;
       pmtd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name expr =
      {
       pmb_name = name;
       pmb_expr = expr;
       pmb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(override = Fresh) lid =
      {
       popen_lid = lid;
       popen_override = override;
       popen_loc = loc;
       popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
       pincl_mod = mexpr;
       pincl_loc = loc;
       pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(text = []) pat expr =
      {
       pvb_pat = pat;
       pvb_expr = expr;
       pvb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(virt = Concrete) ?(params = []) name expr =
      {
       pci_virt = virt;
       pci_params = params;
       pci_name = name;
       pci_expr = expr;
       pci_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
        ?(params = [])
        ?(cstrs = [])
        ?(kind = Ptype_abstract)
        ?(priv = Public)
        ?manifest
        name =
      {
       ptype_name = name;
       ptype_params = params;
       ptype_cstrs = cstrs;
       ptype_kind = kind;
       ptype_private = priv;
       ptype_manifest = manifest;
       ptype_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(args = Pcstr_tuple []) ?res name =
      {
       pcd_name = name;
       pcd_args = args;
       pcd_res = res;
       pcd_loc = loc;
       pcd_attributes = add_info_attrs info attrs;
      }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(mut = Immutable) name typ =
      {
       pld_name = name;
       pld_mutable = mut;
       pld_type = typ;
       pld_loc = loc;
       pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(attrs = []) ?(docs = empty_docs)
          ?(params = []) ?(priv = Public) path constructors =
      {
       ptyext_path = path;
       ptyext_params = params;
       ptyext_constructors = constructors;
       ptyext_private = priv;
       ptyext_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
       pext_name = name;
       pext_kind = kind;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
               ?(info = empty_info) ?(args = Pcstr_tuple []) ?res name =
      {
       pext_name = name;
       pext_kind = Pext_decl(args, res);
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
       pext_name = name;
       pext_kind = Pext_rebind lid;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
       pcsig_self = self;
       pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
       pcstr_self = self;
       pcstr_fields = fields;
      }
  end

end

module Ast_mapper : sig
  (** The interface of a -ppx rewriter

    A -ppx rewriter is a program that accepts a serialized abstract syntax
    tree and outputs another, possibly modified, abstract syntax tree.
    This module encapsulates the interface between the compiler and
    the -ppx rewriters, handling such details as the serialization format,
    forwarding of command-line flags, and storing state.

    {!mapper} allows to implement AST rewriting using open recursion.
    A typical mapper would be based on {!default_mapper}, a deep
    identity mapper, and will fall back on it for handling the syntax it
    does not modify. For example:

    {[
  open Asttypes
  open Parsetree
  open Ast_mapper

  let test_mapper argv =
    { default_mapper with
      expr = fun mapper expr ->
        match expr with
        | { pexp_desc = Pexp_extension ({ txt = "test" }, PStr [])} ->
          Ast_helper.Exp.constant (Const_int 42)
        | other -> default_mapper.expr mapper other; }

  let () =
    register "ppx_test" test_mapper]}

    This -ppx rewriter, which replaces [[%test]] in expressions with
    the constant [42], can be compiled using
    [ocamlc -o ppx_test -I +compiler-libs ocamlcommon.cma ppx_test.ml].

    *)

  open Parsetree

  (** {2 A generic Parsetree mapper} *)

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {2 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

 include Locations.Helpers_intf

end = struct
  (* A generic Parsetree mapping class *)

  (*
  [@@@ocaml.warning "+9"]
    (* Ensure that record patterns don't miss any field. *)
  *)


  open Parsetree
  open Ast_helper
  open Location

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub = function
      | Rtag (l, attrs, b, tl) ->
          Rtag (l, sub.attributes sub attrs, b, List.map (sub.typ sub) tl)
      | Rinherit t -> Rinherit (sub.typ sub t)

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
          arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
          let f (s, a, t) = (s, sub.attributes sub a, sub.typ sub t) in
          object_ ~loc ~attrs (List.map f l) o
      | Ptyp_class (lid, tl) ->
          class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
          variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs sl (sub.typ sub t)
      | Ptyp_package (lid, l) ->
          package ~loc ~attrs (map_loc sub lid)
            (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
        {ptype_name; ptype_params; ptype_cstrs;
         ptype_kind;
         ptype_private;
         ptype_manifest;
         ptype_attributes;
         ptype_loc} =
      Type.mk (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)
        ~loc:(sub.location sub ptype_loc)
        ~attrs:(sub.attributes sub ptype_attributes)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
          Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_constructor_arguments sub = function
      | Pcstr_tuple l -> Pcstr_tuple (List.map (sub.typ sub) l)
      | Pcstr_record l ->
          Pcstr_record (List.map (sub.label_declaration sub) l)

    let map_type_extension sub
        {ptyext_path; ptyext_params;
         ptyext_constructors;
         ptyext_private;
         ptyext_attributes} =
      Te.mk
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private
        ~attrs:(sub.attributes sub ptyext_attributes)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
          Pext_decl(map_constructor_arguments sub ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
          Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
        {pext_name;
         pext_kind;
         pext_loc;
         pext_attributes} =
      Te.constructor
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)
        ~loc:(sub.location sub pext_loc)
        ~attrs:(sub.attributes sub pext_attributes)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
          arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) -> val_ ~loc ~attrs s m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) -> method_ ~loc ~attrs s p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (s, mt1, mt2) ->
          functor_ ~loc ~attrs (map_loc sub s)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) mt1)
            (sub.module_type sub mt2)
      | Pmty_with (mt, l) ->
          with_ ~loc ~attrs (sub.module_type sub mt)
            (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
          Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
          Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst d -> Pwith_typesubst (sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
          Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_recmodule l ->
          rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (arg, arg_ty, body) ->
          functor_ ~loc ~attrs (map_loc sub arg)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) arg_ty)
            (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
          apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
          constraint_ ~loc ~attrs (sub.module_expr sub m)
                      (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
          eval ~loc ~attrs:(sub.attributes sub attrs) (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_description sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
          fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
            (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
          apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
          match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
          construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
          variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
          record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
            (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
          field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
          setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
            (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
          ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
            (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
          sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
          while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
          for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
            (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
          coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
            (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
          constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) -> send ~loc ~attrs (sub.expr sub e) s
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
          setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
          override ~loc ~attrs
            (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
          letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
            (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
          poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) -> newtype ~loc ~attrs s (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (ovf, lid, e) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.expr sub e)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pexp_unreachable -> unreachable ~loc ~attrs ()
  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
          construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
          record ~loc ~attrs
                 (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
          constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
          structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
          fun_ ~loc ~attrs lab
            (map_opt (sub.expr sub) e)
            (sub.pat sub p)
            (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
          apply ~loc ~attrs (sub.class_expr sub ce)
            (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
          constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) -> inherit_ ~loc ~attrs o (sub.class_expr sub ce) s
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
          method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      Ci.mk
       ~virt:pci_virt
       ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
        ~loc:(sub.location sub pci_loc)
        ~attrs:(sub.attributes sub pci_attributes)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_description =
        (fun this {popen_lid; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_lid)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );


      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
          Type.constructor
            (map_loc this pcd_name)
            ~args:(T.map_constructor_arguments this pcd_args)
            ?res:(map_opt (this.typ this) pcd_res)
            ~loc:(this.location this pcd_loc)
            ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PSig x -> PSig (this.signature this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(function
        | x :: l -> PStr (x :: x :: l)
        | l -> PStr l)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Pconst_string (x, None))))
      error

  let attribute_of_warning loc s =
    { loc; txt = "ocaml.ppwarning" },
    PStr ([Str.eval ~loc (Exp.constant (Pconst_string (s, None)))])

  include Locations.Helpers_impl

end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
        [Toploop.print_out_value]
        [Toploop.print_out_type]
        [Toploop.print_out_sig_item]
        [Toploop.print_out_phrase] *)

  type out_ident (*IF_CURRENT = Outcometree.out_ident *) =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of string

  type out_attribute (*IF_CURRENT = Outcometree.out_attribute *) =
    { oattr_name: string }

  type out_value (*IF_CURRENT = Outcometree.out_value *) =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type (*IF_CURRENT = Outcometree.out_type *) =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of string * string list * out_type list
    | Otyp_attribute of out_type * out_attribute

  and out_variant (*IF_CURRENT = Outcometree.out_variant *) =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_name of out_ident * out_type list

  type out_class_type (*IF_CURRENT = Outcometree.out_class_type *) =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item (*IF_CURRENT = Outcometree.out_class_sig_item *) =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type (*IF_CURRENT = Outcometree.out_module_type *) =
    | Omty_abstract
    | Omty_functor of string * out_module_type option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item (*IF_CURRENT = Outcometree.out_sig_item *) =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of out_val_decl
    | Osig_ellipsis
  and out_type_decl (*IF_CURRENT = Outcometree.out_type_decl *) =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_immediate: bool;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor (*IF_CURRENT = Outcometree.out_extension_constructor *) =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension (*IF_CURRENT = Outcometree.out_type_extension *) =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_val_decl (*IF_CURRENT = Outcometree.out_val_decl *) =
    { oval_name: string;
      oval_type: out_type;
      oval_prims: string list;
      oval_attributes: out_attribute list }
  and out_rec_status (*IF_CURRENT = Outcometree.out_rec_status *) =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status (*IF_CURRENT = Outcometree.out_ext_status *) =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase (*IF_CURRENT = Outcometree.out_phrase *) =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)

end

module Config = struct
  let ast_impl_magic_number = "Caml1999M019"
  let ast_intf_magic_number = "Caml1999N018"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Ast_404
= struct
#1 "ast_404.ml"
# 1 "src/ast_404.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module Location = Location
module Longident = Longident

module Asttypes = struct
  (** Auxiliary AST types used by parsetree and typedtree. *)

  type constant (*IF_CURRENT = Asttypes.constant *) =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag (*IF_CURRENT = Asttypes.rec_flag *) = Nonrecursive | Recursive

  type direction_flag (*IF_CURRENT = Asttypes.direction_flag *) = Upto | Downto

  (* Order matters, used in polymorphic comparison *)
  type private_flag (*IF_CURRENT = Asttypes.private_flag *) = Private | Public

  type mutable_flag (*IF_CURRENT = Asttypes.mutable_flag *) = Immutable | Mutable

  type virtual_flag (*IF_CURRENT = Asttypes.virtual_flag *) = Virtual | Concrete

  type override_flag (*IF_CURRENT = Asttypes.override_flag *) = Override | Fresh

  type closed_flag (*IF_CURRENT = Asttypes.closed_flag *) = Closed | Open

  type label = string

  type arg_label (*IF_CURRENT = Asttypes.arg_label *) =
      Nolabel
    | Labelled of string (*  label:T -> ... *)
    | Optional of string (* ?label:T -> ... *)

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance (*IF_CURRENT = Asttypes.variance *) =
    | Covariant
    | Contravariant
    | Invariant
end

module Parsetree = struct
  (** Abstract syntax tree produced by parsing *)

  open Asttypes

  type constant (*IF_CURRENT = Parsetree.constant *) =
      Pconst_integer of string * char option
    (* 3 3l 3L 3n

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes except 'l', 'L' and 'n' are rejected by the typechecker
    *)
    | Pconst_char of char
    (* 'c' *)
    | Pconst_string of string * string option
    (* "constant"
       {delim|other constant|delim}
    *)
    | Pconst_float of string * char option
    (* 3.4 2e5 1.4e-4

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes are rejected by the typechecker.
    *)

  (** {2 Extension points} *)

  type attribute = string loc * payload
         (* [@id ARG]
            [@@id ARG]

            Metadata containers passed around within the AST.
            The compiler ignores unknown attributes.
         *)

  and extension = string loc * payload
        (* [%id ARG]
           [%%id ARG]

           Sub-language placeholder -- rejected by the typechecker.
        *)

  and attributes = attribute list

  and payload (*IF_CURRENT = Parsetree.payload *) =
    | PStr of structure
    | PSig of signature (* : SIG *)
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {2 Core language} *)

  (* Type expressions *)

  and core_type (*IF_CURRENT = Parsetree.core_type *) =
      {
       ptyp_desc: core_type_desc;
       ptyp_loc: Location.t;
       ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and core_type_desc (*IF_CURRENT = Parsetree.core_type_desc *) =
    | Ptyp_any
          (*  _ *)
    | Ptyp_var of string
          (* 'a *)
    | Ptyp_arrow of arg_label * core_type * core_type
          (* T1 -> T2       Simple
             ~l:T1 -> T2    Labelled
             ?l:T1 -> T2    Otional
           *)
    | Ptyp_tuple of core_type list
          (* T1 * ... * Tn

             Invariant: n >= 2
          *)
    | Ptyp_constr of Longident.t loc * core_type list
          (* tconstr
             T tconstr
             (T1, ..., Tn) tconstr
           *)
    | Ptyp_object of (string * attributes * core_type) list * closed_flag
          (* < l1:T1; ...; ln:Tn >     (flag = Closed)
             < l1:T1; ...; ln:Tn; .. > (flag = Open)
           *)
    | Ptyp_class of Longident.t loc * core_type list
          (* #tconstr
             T #tconstr
             (T1, ..., Tn) #tconstr
           *)
    | Ptyp_alias of core_type * string
          (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
          (* [ `A|`B ]         (flag = Closed; labels = None)
             [> `A|`B ]        (flag = Open;   labels = None)
             [< `A|`B ]        (flag = Closed; labels = Some [])
             [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
           *)
    | Ptyp_poly of string list * core_type
          (* 'a1 ... 'an. T

             Can only appear in the following context:

             - As the core_type of a Ppat_constraint node corresponding
               to a constraint on a let-binding: let x : 'a1 ... 'an. T
               = e ...

             - Under Cfk_virtual for methods (not values).

             - As the core_type of a Pctf_method node.

             - As the core_type of a Pexp_poly node.

             - As the pld_type field of a label_declaration.

             - As a core_type of a Ptyp_object node.
           *)

    | Ptyp_package of package_type
          (* (module S) *)
    | Ptyp_extension of extension
          (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
        (*
          (module S)
          (module S with type t1 = T1 and ... and tn = Tn)
         *)

  and row_field (*IF_CURRENT = Parsetree.row_field *) =
    | Rtag of label * attributes * bool * core_type list
          (* [`A]                   ( true,  [] )
             [`A of T]              ( false, [T] )
             [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
             [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

            - The 2nd field is true if the tag contains a
              constant (empty) constructor.
            - '&' occurs when several types are used for the same constructor
              (see 4.2 in the manual)

            - TODO: switch to a record representation, and keep location
          *)
    | Rinherit of core_type
          (* [ T ] *)

  (* Patterns *)

  and pattern (*IF_CURRENT = Parsetree.pattern *) =
      {
       ppat_desc: pattern_desc;
       ppat_loc: Location.t;
       ppat_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and pattern_desc (*IF_CURRENT = Parsetree.pattern_desc *) =
    | Ppat_any
          (* _ *)
    | Ppat_var of string loc
          (* x *)
    | Ppat_alias of pattern * string loc
          (* P as 'a *)
    | Ppat_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
          (* 'a'..'z'

             Other forms of interval are recognized by the parser
             but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
          (* (P1, ..., Pn)

             Invariant: n >= 2
          *)
    | Ppat_construct of Longident.t loc * pattern option
          (* C                None
             C P              Some P
             C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
           *)
    | Ppat_variant of label * pattern option
          (* `A             (None)
             `A P           (Some P)
           *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
          (* { l1=P1; ...; ln=Pn }     (flag = Closed)
             { l1=P1; ...; ln=Pn; _}   (flag = Open)

             Invariant: n > 0
           *)
    | Ppat_array of pattern list
          (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
          (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
          (* (P : T) *)
    | Ppat_type of Longident.t loc
          (* #tconst *)
    | Ppat_lazy of pattern
          (* lazy P *)
    | Ppat_unpack of string loc
          (* (module P)
             Note: (module P : S) is represented as
             Ppat_constraint(Ppat_unpack, Ptyp_package)
           *)
    | Ppat_exception of pattern
          (* exception P *)
    | Ppat_extension of extension
          (* [%id] *)
    | Ppat_open of Longident.t loc * pattern

  (* Value expressions *)

  and expression (*IF_CURRENT = Parsetree.expression *) =
      {
       pexp_desc: expression_desc;
       pexp_loc: Location.t;
       pexp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and expression_desc (*IF_CURRENT = Parsetree.expression_desc *) =
    | Pexp_ident of Longident.t loc
          (* x
             M.x
           *)
    | Pexp_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
          (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
           *)
    | Pexp_function of case list
          (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of arg_label * expression option * pattern * expression
          (* fun P -> E1                          (Simple, None)
             fun ~l:P -> E1                       (Labelled l, None)
             fun ?l:P -> E1                       (Optional l, None)
             fun ?l:(P = E0) -> E1                (Optional l, Some E0)

             Notes:
             - If E0 is provided, only Optional is allowed.
             - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
             - "let f P = E" is represented using Pexp_fun.
           *)
    | Pexp_apply of expression * (arg_label * expression) list
          (* E0 ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pexp_match of expression * case list
          (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * case list
          (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
          (* (E1, ..., En)

             Invariant: n >= 2
          *)
    | Pexp_construct of Longident.t loc * expression option
          (* C                None
             C E              Some E
             C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
          *)
    | Pexp_variant of label * expression option
          (* `A             (None)
             `A E           (Some E)
           *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
          (* { l1=P1; ...; ln=Pn }     (None)
             { E0 with l1=P1; ...; ln=Pn }   (Some E0)

             Invariant: n > 0
           *)
    | Pexp_field of expression * Longident.t loc
          (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
          (* E1.l <- E2 *)
    | Pexp_array of expression list
          (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
          (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
          (* E1; E2 *)
    | Pexp_while of expression * expression
          (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
          (* for i = E1 to E2 do E3 done      (flag = Upto)
             for i = E1 downto E2 do E3 done  (flag = Downto)
           *)
    | Pexp_constraint of expression * core_type
          (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
          (* (E :> T)        (None, T)
             (E : T0 :> T)   (Some T0, T)
           *)
    | Pexp_send of expression * string
          (*  E # m *)
    | Pexp_new of Longident.t loc
          (* new M.c *)
    | Pexp_setinstvar of string loc * expression
          (* x <- 2 *)
    | Pexp_override of (string loc * expression) list
          (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string loc * module_expr * expression
          (* let module M = ME in E *)
    | Pexp_letexception of extension_constructor * expression
          (* let exception C in E *)
    | Pexp_assert of expression
          (* assert E
             Note: "assert false" is treated in a special way by the
             type-checker. *)
    | Pexp_lazy of expression
          (* lazy E *)
    | Pexp_poly of expression * core_type option
          (* Used for method bodies.

             Can only be used as the expression under Cfk_concrete
             for methods (not values). *)
    | Pexp_object of class_structure
          (* object ... end *)
    | Pexp_newtype of string * expression
          (* fun (type t) -> E *)
    | Pexp_pack of module_expr
          (* (module ME)

             (module ME : S) is represented as
             Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of override_flag * Longident.t loc * expression
          (* let open M in E
             let! open M in E
          *)
    | Pexp_extension of extension
          (* [%id] *)
    | Pexp_unreachable
          (* . *)

  and case (*IF_CURRENT = Parsetree.case *) =   (* (P -> E) or (P when E0 -> E) *)
      {
       pc_lhs: pattern;
       pc_guard: expression option;
       pc_rhs: expression;
      }

  (* Value descriptions *)

  and value_description (*IF_CURRENT = Parsetree.value_description *) =
      {
       pval_name: string loc;
       pval_type: core_type;
       pval_prim: string list;
       pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
       pval_loc: Location.t;
      }

  (*
    val x: T                            (prim = [])
    external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])
  *)

  (* Type declarations *)

  and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
      {
       ptype_name: string loc;
       ptype_params: (core_type * variance) list;
             (* ('a1,...'an) t; None represents  _*)
       ptype_cstrs: (core_type * core_type * Location.t) list;
             (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
       ptype_kind: type_kind;
       ptype_private: private_flag;   (* = private ... *)
       ptype_manifest: core_type option;  (* = T *)
       ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
       ptype_loc: Location.t;
      }

  (*
    type t                     (abstract, no manifest)
    type t = T0                (abstract, manifest=T0)
    type t = C of T | ...      (variant,  no manifest)
    type t = T0 = C of T | ... (variant,  manifest=T0)
    type t = {l: T; ...}       (record,   no manifest)
    type t = T0 = {l : T; ...} (record,   manifest=T0)
    type t = ..                (open,     no manifest)
  *)

  and type_kind (*IF_CURRENT = Parsetree.type_kind *) =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
          (* Invariant: non-empty list *)
    | Ptype_record of label_declaration list
          (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration (*IF_CURRENT = Parsetree.label_declaration *) =
      {
       pld_name: string loc;
       pld_mutable: mutable_flag;
       pld_type: core_type;
       pld_loc: Location.t;
       pld_attributes: attributes; (* l [@id1] [@id2] : T *)
      }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration (*IF_CURRENT = Parsetree.constructor_declaration *) =
      {
       pcd_name: string loc;
       pcd_args: constructor_arguments;
       pcd_res: core_type option;
       pcd_loc: Location.t;
       pcd_attributes: attributes; (* C [@id1] [@id2] of ... *)
      }

  and constructor_arguments (*IF_CURRENT = Parsetree.constructor_arguments *) =
    | Pcstr_tuple of core_type list
    | Pcstr_record of label_declaration list

  (*
    | C of T1 * ... * Tn     (res = None,    args = Pcstr_tuple [])
    | C: T0                  (res = Some T0, args = [])
    | C: T1 * ... * Tn -> T0 (res = Some T0, args = Pcstr_tuple)
    | C of {...}             (res = None,    args = Pcstr_record)
    | C: {...} -> T0         (res = Some T0, args = Pcstr_record)
    | C of {...} as t        (res = None,    args = Pcstr_record)
  *)

  and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
      {
       ptyext_path: Longident.t loc;
       ptyext_params: (core_type * variance) list;
       ptyext_constructors: extension_constructor list;
       ptyext_private: private_flag;
       ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      }
  (*
    type t += ...
  *)

  and extension_constructor (*IF_CURRENT = Parsetree.extension_constructor *) =
      {
       pext_name: string loc;
       pext_kind : extension_constructor_kind;
       pext_loc : Location.t;
       pext_attributes: attributes; (* C [@id1] [@id2] of ... *)
      }

  and extension_constructor_kind (*IF_CURRENT = Parsetree.extension_constructor_kind *) =
      Pext_decl of constructor_arguments * core_type option
        (*
           | C of T1 * ... * Tn     ([T1; ...; Tn], None)
           | C: T0                  ([], Some T0)
           | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
         *)
    | Pext_rebind of Longident.t loc
        (*
           | C = D
         *)

  (** {2 Class language} *)

  (* Type expressions for the class language *)

  and class_type (*IF_CURRENT = Parsetree.class_type *) =
      {
       pcty_desc: class_type_desc;
       pcty_loc: Location.t;
       pcty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_type_desc (*IF_CURRENT = Parsetree.class_type_desc *) =
    | Pcty_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
          (* object ... end *)
    | Pcty_arrow of arg_label * core_type * class_type
          (* T -> CT       Simple
             ~l:T -> CT    Labelled l
             ?l:T -> CT    Optional l
           *)
    | Pcty_extension of extension
          (* [%id] *)

  and class_signature (*IF_CURRENT = Parsetree.class_signature *) =
      {
       pcsig_self: core_type;
       pcsig_fields: class_type_field list;
      }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
   *)

  and class_type_field (*IF_CURRENT = Parsetree.class_type_field *) =
      {
       pctf_desc: class_type_field_desc;
       pctf_loc: Location.t;
       pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_type_field_desc (*IF_CURRENT = Parsetree.class_type_field_desc *) =
    | Pctf_inherit of class_type
          (* inherit CT *)
    | Pctf_val of (string * mutable_flag * virtual_flag * core_type)
          (* val x: T *)
    | Pctf_method  of (string * private_flag * virtual_flag * core_type)
          (* method x: T

             Note: T can be a Ptyp_poly.
           *)
    | Pctf_constraint  of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
          (* [@@@id] *)
    | Pctf_extension of extension
          (* [%%id] *)

  and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
      {
       pci_virt: virtual_flag;
       pci_params: (core_type * variance) list;
       pci_name: string loc;
       pci_expr: 'a;
       pci_loc: Location.t;
       pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr (*IF_CURRENT = Parsetree.class_expr *) =
      {
       pcl_desc: class_expr_desc;
       pcl_loc: Location.t;
       pcl_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_expr_desc (*IF_CURRENT = Parsetree.class_expr_desc *) =
    | Pcl_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
          (* object ... end *)
    | Pcl_fun of arg_label * expression option * pattern * class_expr
          (* fun P -> CE                          (Simple, None)
             fun ~l:P -> CE                       (Labelled l, None)
             fun ?l:P -> CE                       (Optional l, None)
             fun ?l:(P = E0) -> CE                (Optional l, Some E0)
           *)
    | Pcl_apply of class_expr * (arg_label * expression) list
          (* CE ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pcl_let of rec_flag * value_binding list * class_expr
          (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
           *)
    | Pcl_constraint of class_expr * class_type
          (* (CE : CT) *)
    | Pcl_extension of extension
          (* [%id] *)

  and class_structure (*IF_CURRENT = Parsetree.class_structure *) =
      {
       pcstr_self: pattern;
       pcstr_fields: class_field list;
      }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
   *)

  and class_field (*IF_CURRENT = Parsetree.class_field *) =
      {
       pcf_desc: class_field_desc;
       pcf_loc: Location.t;
       pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_field_desc (*IF_CURRENT = Parsetree.class_field_desc *) =
    | Pcf_inherit of override_flag * class_expr * string option
          (* inherit CE
             inherit CE as x
             inherit! CE
             inherit! CE as x
           *)
    | Pcf_val of (string loc * mutable_flag * class_field_kind)
          (* val x = E
             val virtual x: T
           *)
    | Pcf_method of (string loc * private_flag * class_field_kind)
          (* method x = E            (E can be a Pexp_poly)
             method virtual x: T     (T can be a Ptyp_poly)
           *)
    | Pcf_constraint of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pcf_initializer of expression
          (* initializer E *)
    | Pcf_attribute of attribute
          (* [@@@id] *)
    | Pcf_extension of extension
          (* [%%id] *)

  and class_field_kind (*IF_CURRENT = Parsetree.class_field_kind *) =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {2 Module language} *)

  (* Type expressions for the module language *)

  and module_type (*IF_CURRENT = Parsetree.module_type *) =
      {
       pmty_desc: module_type_desc;
       pmty_loc: Location.t;
       pmty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_type_desc (*IF_CURRENT = Parsetree.module_type_desc *) =
    | Pmty_ident of Longident.t loc
          (* S *)
    | Pmty_signature of signature
          (* sig ... end *)
    | Pmty_functor of string loc * module_type option * module_type
          (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
          (* MT with ... *)
    | Pmty_typeof of module_expr
          (* module type of ME *)
    | Pmty_extension of extension
          (* [%id] *)
    | Pmty_alias of Longident.t loc
          (* (module M) *)

  and signature = signature_item list

  and signature_item (*IF_CURRENT = Parsetree.signature_item *) =
      {
       psig_desc: signature_item_desc;
       psig_loc: Location.t;
      }

  and signature_item_desc (*IF_CURRENT = Parsetree.signature_item_desc *) =
    | Psig_value of value_description
          (*
            val x: T
            external x: T = "s1" ... "sn"
           *)
    | Psig_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Psig_typext of type_extension
          (* type t1 += ... *)
    | Psig_exception of extension_constructor
          (* exception C of T *)
    | Psig_module of module_declaration
          (* module X : MT *)
    | Psig_recmodule of module_declaration list
          (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
          (* module type S = MT
             module type S *)
    | Psig_open of open_description
          (* open X *)
    | Psig_include of include_description
          (* include MT *)
    | Psig_class of class_description list
          (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
          (* [@@@id] *)
    | Psig_extension of extension * attributes
          (* [%%id] *)

  and module_declaration (*IF_CURRENT = Parsetree.module_declaration *) =
      {
       pmd_name: string loc;
       pmd_type: module_type;
       pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmd_loc: Location.t;
      }
  (* S : MT *)

  and module_type_declaration (*IF_CURRENT = Parsetree.module_type_declaration *) =
      {
       pmtd_name: string loc;
       pmtd_type: module_type option;
       pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmtd_loc: Location.t;
      }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and open_description (*IF_CURRENT = Parsetree.open_description *) =
      {
       popen_lid: Longident.t loc;
       popen_override: override_flag;
       popen_loc: Location.t;
       popen_attributes: attributes;
      }
  (* open! X - popen_override = Override (silences the 'used identifier
                                shadowing' warning)
     open  X - popen_override = Fresh
   *)

  and 'a include_infos (*IF_CURRENT = 'a Parsetree.include_infos *) =
      {
       pincl_mod: 'a;
       pincl_loc: Location.t;
       pincl_attributes: attributes;
      }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint (*IF_CURRENT = Parsetree.with_constraint *) =
    | Pwith_type of Longident.t loc * type_declaration
          (* with type X.t = ...

             Note: the last component of the longident must match
             the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
          (* with module X.Y = Z *)
    | Pwith_typesubst of type_declaration
          (* with type t := ... *)
    | Pwith_modsubst of string loc * Longident.t loc
          (* with module X := Z *)

  (* Value expressions for the module language *)

  and module_expr (*IF_CURRENT = Parsetree.module_expr *) =
      {
       pmod_desc: module_expr_desc;
       pmod_loc: Location.t;
       pmod_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_expr_desc (*IF_CURRENT = Parsetree.module_expr_desc *) =
    | Pmod_ident of Longident.t loc
          (* X *)
    | Pmod_structure of structure
          (* struct ... end *)
    | Pmod_functor of string loc * module_type option * module_expr
          (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
          (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
          (* (ME : MT) *)
    | Pmod_unpack of expression
          (* (val E) *)
    | Pmod_extension of extension
          (* [%id] *)

  and structure = structure_item list

  and structure_item (*IF_CURRENT = Parsetree.structure_item *) =
      {
       pstr_desc: structure_item_desc;
       pstr_loc: Location.t;
      }

  and structure_item_desc (*IF_CURRENT = Parsetree.structure_item_desc *) =
    | Pstr_eval of expression * attributes
          (* E *)
    | Pstr_value of rec_flag * value_binding list
          (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
           *)
    | Pstr_primitive of value_description
          (*  val x: T
              external x: T = "s1" ... "sn" *)
    | Pstr_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
          (* type t1 += ... *)
    | Pstr_exception of extension_constructor
          (* exception C of T
             exception C = M.X *)
    | Pstr_module of module_binding
          (* module X = ME *)
    | Pstr_recmodule of module_binding list
          (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
          (* module type S = MT *)
    | Pstr_open of open_description
          (* open X *)
    | Pstr_class of class_declaration list
          (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
          (* include ME *)
    | Pstr_attribute of attribute
          (* [@@@id] *)
    | Pstr_extension of extension * attributes
          (* [%%id] *)

  and value_binding (*IF_CURRENT = Parsetree.value_binding *) =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding (*IF_CURRENT = Parsetree.module_binding *) =
      {
       pmb_name: string loc;
       pmb_expr: module_expr;
       pmb_attributes: attributes;
       pmb_loc: Location.t;
      }
  (* X = ME *)

  (** {2 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase (*IF_CURRENT = Parsetree.toplevel_phrase *) =
    | Ptop_def of structure
    | Ptop_dir of string * directive_argument
       (* #use, #load ... *)

  and directive_argument (*IF_CURRENT = Parsetree.directive_argument *) =
    | Pdir_none
    | Pdir_string of string
    | Pdir_int of string * char option
    | Pdir_ident of Longident.t
    | Pdir_bool of bool
end

module Docstrings : sig
  (** {3 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {3 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

end = struct
  open Location

  (* Docstrings *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t; }

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc; }
    in
    ds

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (doc_loc, PStr [item])

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (text_loc, PStr [item])

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""; _} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

end

module Ast_helper : sig
  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Docstrings
  open Parsetree

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  (** {2 Default locations} *)

  val default_loc: loc ref
      (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
      (** Set the [default_loc] within the scope of the execution
          of the provided function. *)

  (** {2 Constants} *)

  module Const : sig
    val char : char -> constant
    val string : ?quotation_delimiter:string -> string -> constant
    val integer : ?suffix:char -> string -> constant
    val int : ?suffix:char -> int -> constant
    val int32 : ?suffix:char -> int32 -> constant
    val int64 : ?suffix:char -> int64 -> constant
    val nativeint : ?suffix:char -> nativeint -> constant
    val float : ?suffix:char -> string -> constant
  end

  (** {2 Core language} *)

  (** Type expressions *)
  module Typ :
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
      val attr: core_type -> attribute -> core_type

      val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
      val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type -> core_type
                 -> core_type
      val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val object_: ?loc:loc -> ?attrs:attrs ->
                    (string * attributes * core_type) list -> closed_flag ->
                    core_type
      val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
      val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
                   -> label list option -> core_type
      val poly: ?loc:loc -> ?attrs:attrs -> string list -> core_type -> core_type
      val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
                   -> core_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

      val force_poly: core_type -> core_type
    end

  (** Patterns *)
  module Pat:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
      val attr:pattern -> attribute -> pattern

      val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
      val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
      val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
      val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
      val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
      val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
                  -> pattern
      val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
      val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
      val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
      val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val open_: ?loc:loc -> ?attrs:attrs  -> lid -> pattern -> pattern
      val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
    end

  (** Expressions *)
  module Exp:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
      val attr: expression -> attribute -> expression

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
                -> expression -> expression
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option
                -> pattern -> expression -> expression
      val function_: ?loc:loc -> ?attrs:attrs -> case list -> expression
      val apply: ?loc:loc -> ?attrs:attrs -> expression
                 -> (arg_label * expression) list -> expression
      val match_: ?loc:loc -> ?attrs:attrs -> expression -> case list
                  -> expression
      val try_: ?loc:loc -> ?attrs:attrs -> expression -> case list -> expression
      val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
                     -> expression
      val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
                   -> expression
      val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
                  -> expression option -> expression
      val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
                    -> expression
      val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
                      -> expression option -> expression
      val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
                    -> expression
      val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
                  -> expression
      val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
                -> direction_flag -> expression -> expression
      val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                  -> core_type -> expression
      val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
                       -> expression
      val send: ?loc:loc -> ?attrs:attrs -> expression -> string -> expression
      val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
                    -> expression
      val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
                     -> expression
      val letexception:
        ?loc:loc -> ?attrs:attrs -> extension_constructor -> expression
        -> expression
      val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                -> expression
      val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
      val newtype: ?loc:loc -> ?attrs:attrs -> string -> expression -> expression
      val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> expression
                 -> expression
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression
      val unreachable: ?loc:loc -> ?attrs:attrs -> unit -> expression

      val case: pattern -> ?guard:expression -> expression -> case
    end

  (** Value declarations *)
  module Val:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        ?prim:string list -> str -> core_type -> value_description
    end

  (** Type declarations *)
  module Type:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?params:(core_type * variance) list ->
        ?cstrs:(core_type * core_type * loc) list ->
        ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
        type_declaration

      val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        constructor_declaration
      val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?mut:mutable_flag -> str -> core_type -> label_declaration
    end

  (** Type extensions *)
  module Te:
    sig
      val mk: ?attrs:attrs -> ?docs:docs ->
        ?params:(core_type * variance) list -> ?priv:private_flag ->
        lid -> extension_constructor list -> type_extension

      val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> extension_constructor_kind -> extension_constructor

      val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        extension_constructor
      val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> lid -> extension_constructor
    end

  (** {2 Module language} *)

  (** Module type expressions *)
  module Mty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
      val attr: module_type -> attribute -> module_type

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_type -> module_type
      val with_: ?loc:loc -> ?attrs:attrs -> module_type ->
        with_constraint list -> module_type
      val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
    end

  (** Module expressions *)
  module Mod:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
      val attr: module_expr -> attribute -> module_expr

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
      val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_expr -> module_expr
      val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr ->
        module_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type ->
        module_expr
      val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
    end

  (** Signature items *)
  module Sig:
    sig
      val mk: ?loc:loc -> signature_item_desc -> signature_item

      val value: ?loc:loc -> value_description -> signature_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item
      val type_extension: ?loc:loc -> type_extension -> signature_item
      val exception_: ?loc:loc -> extension_constructor -> signature_item
      val module_: ?loc:loc -> module_declaration -> signature_item
      val rec_module: ?loc:loc -> module_declaration list -> signature_item
      val modtype: ?loc:loc -> module_type_declaration -> signature_item
      val open_: ?loc:loc -> open_description -> signature_item
      val include_: ?loc:loc -> include_description -> signature_item
      val class_: ?loc:loc -> class_description list -> signature_item
      val class_type: ?loc:loc -> class_type_declaration list -> signature_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
      val attribute: ?loc:loc -> attribute -> signature_item
      val text: text -> signature_item list
    end

  (** Structure items *)
  module Str:
    sig
      val mk: ?loc:loc -> structure_item_desc -> structure_item

      val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
      val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
      val primitive: ?loc:loc -> value_description -> structure_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item
      val type_extension: ?loc:loc -> type_extension -> structure_item
      val exception_: ?loc:loc -> extension_constructor -> structure_item
      val module_: ?loc:loc -> module_binding -> structure_item
      val rec_module: ?loc:loc -> module_binding list -> structure_item
      val modtype: ?loc:loc -> module_type_declaration -> structure_item
      val open_: ?loc:loc -> open_description -> structure_item
      val class_: ?loc:loc -> class_declaration list -> structure_item
      val class_type: ?loc:loc -> class_type_declaration list -> structure_item
      val include_: ?loc:loc -> include_declaration -> structure_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
      val attribute: ?loc:loc -> attribute -> structure_item
      val text: text -> structure_item list
    end

  (** Module declarations *)
  module Md:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_type -> module_declaration
    end

  (** Module type declarations *)
  module Mtd:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?typ:module_type -> str -> module_type_declaration
    end

  (** Module bindings *)
  module Mb:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_expr -> module_binding
    end

  (** Opens *)
  module Opn:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
        ?override:override_flag -> lid -> open_description
    end

  (** Includes *)
  module Incl:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
    end

  (** Value bindings *)
  module Vb:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        pattern -> expression -> value_binding
    end


  (** {2 Class language} *)

  (** Class type expressions *)
  module Cty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
      val attr: class_type -> attribute -> class_type

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
      val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type ->
        class_type -> class_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
    end

  (** Class type fields *)
  module Ctf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        class_type_field_desc -> class_type_field
      val attr: class_type_field -> attribute -> class_type_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
      val val_: ?loc:loc -> ?attrs:attrs -> string -> mutable_flag ->
        virtual_flag -> core_type -> class_type_field
      val method_: ?loc:loc -> ?attrs:attrs -> string -> private_flag ->
        virtual_flag -> core_type -> class_type_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_type_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
      val attribute: ?loc:loc -> attribute -> class_type_field
      val text: text -> class_type_field list
    end

  (** Class expressions *)
  module Cl:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
      val attr: class_expr -> attribute -> class_expr

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
      val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option ->
        pattern -> class_expr -> class_expr
      val apply: ?loc:loc -> ?attrs:attrs -> class_expr ->
        (arg_label * expression) list -> class_expr
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list ->
        class_expr -> class_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type ->
        class_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
    end

  (** Class fields *)
  module Cf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
        class_field
      val attr: class_field -> attribute -> class_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr ->
        string option -> class_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
        class_field_kind -> class_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
        class_field_kind -> class_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_field
      val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
      val attribute: ?loc:loc -> attribute -> class_field
      val text: text -> class_field list

      val virtual_: core_type -> class_field_kind
      val concrete: override_flag -> expression -> class_field_kind

    end

  (** Classes *)
  module Ci:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?virt:virtual_flag -> ?params:(core_type * variance) list ->
        str -> 'a -> 'a class_infos
    end

  (** Class signatures *)
  module Csig:
    sig
      val mk: core_type -> class_type_field list -> class_signature
    end

  (** Class structures *)
  module Cstr:
    sig
      val mk: pattern -> class_field list -> class_structure
    end

end = struct
  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Parsetree
  open Docstrings

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    let old = !default_loc in
    default_loc := l;
    try let r = f () in default_loc := old; r
    with exn -> default_loc := old; raise exn

  module Const = struct
    let integer ?suffix i = Pconst_integer (i, suffix)
    let int ?suffix i = integer ?suffix (string_of_int i)
    let int32 ?(suffix='l') i = integer ~suffix (Int32.to_string i)
    let int64 ?(suffix='L') i = integer ~suffix (Int64.to_string i)
    let nativeint ?(suffix='n') i = integer ~suffix (Nativeint.to_string i)
    let float ?suffix f = Pconst_float (f, suffix)
    let char c = Pconst_char c
    let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter)
  end

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs}
    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)
  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d; ppat_loc = loc; ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b))
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d; pexp_loc = loc; pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let letexception ?loc ?attrs a b = mk ?loc ?attrs (Pexp_letexception (a, b))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_open (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)
    let unreachable ?loc ?attrs () = mk ?loc ?attrs Pexp_unreachable

    let case lhs ?guard rhs =
      {
       pc_lhs = lhs;
       pc_guard = guard;
       pc_rhs = rhs;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg arg_ty body =
      mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc rec_flag a = mk ?loc (Psig_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcl_desc = d;
       pcl_loc = loc;
       pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcty_desc = d;
       pcty_loc = loc;
       pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
             ?(docs = empty_docs) d =
      {
       pctf_desc = d;
       pctf_loc = loc;
       pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
     let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
       List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
       pcf_desc = d;
       pcf_loc = loc;
       pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(prim = []) name typ =
      {
       pval_name = name;
       pval_type = typ;
       pval_attributes = add_docs_attrs docs attrs;
       pval_loc = loc;
       pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name typ =
      {
       pmd_name = name;
       pmd_type = typ;
       pmd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmd_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) ?typ name =
      {
       pmtd_name = name;
       pmtd_type = typ;
       pmtd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name expr =
      {
       pmb_name = name;
       pmb_expr = expr;
       pmb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(override = Fresh) lid =
      {
       popen_lid = lid;
       popen_override = override;
       popen_loc = loc;
       popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
       pincl_mod = mexpr;
       pincl_loc = loc;
       pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(text = []) pat expr =
      {
       pvb_pat = pat;
       pvb_expr = expr;
       pvb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(virt = Concrete) ?(params = []) name expr =
      {
       pci_virt = virt;
       pci_params = params;
       pci_name = name;
       pci_expr = expr;
       pci_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
        ?(params = [])
        ?(cstrs = [])
        ?(kind = Ptype_abstract)
        ?(priv = Public)
        ?manifest
        name =
      {
       ptype_name = name;
       ptype_params = params;
       ptype_cstrs = cstrs;
       ptype_kind = kind;
       ptype_private = priv;
       ptype_manifest = manifest;
       ptype_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(args = Pcstr_tuple []) ?res name =
      {
       pcd_name = name;
       pcd_args = args;
       pcd_res = res;
       pcd_loc = loc;
       pcd_attributes = add_info_attrs info attrs;
      }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(mut = Immutable) name typ =
      {
       pld_name = name;
       pld_mutable = mut;
       pld_type = typ;
       pld_loc = loc;
       pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(attrs = []) ?(docs = empty_docs)
          ?(params = []) ?(priv = Public) path constructors =
      {
       ptyext_path = path;
       ptyext_params = params;
       ptyext_constructors = constructors;
       ptyext_private = priv;
       ptyext_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
       pext_name = name;
       pext_kind = kind;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
               ?(info = empty_info) ?(args = Pcstr_tuple []) ?res name =
      {
       pext_name = name;
       pext_kind = Pext_decl(args, res);
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
       pext_name = name;
       pext_kind = Pext_rebind lid;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
       pcsig_self = self;
       pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
       pcstr_self = self;
       pcstr_fields = fields;
      }
  end

end

module Ast_mapper : sig
  (** The interface of a -ppx rewriter

    A -ppx rewriter is a program that accepts a serialized abstract syntax
    tree and outputs another, possibly modified, abstract syntax tree.
    This module encapsulates the interface between the compiler and
    the -ppx rewriters, handling such details as the serialization format,
    forwarding of command-line flags, and storing state.

    {!mapper} allows to implement AST rewriting using open recursion.
    A typical mapper would be based on {!default_mapper}, a deep
    identity mapper, and will fall back on it for handling the syntax it
    does not modify. For example:

    {[
  open Asttypes
  open Parsetree
  open Ast_mapper

  let test_mapper argv =
    { default_mapper with
      expr = fun mapper expr ->
        match expr with
        | { pexp_desc = Pexp_extension ({ txt = "test" }, PStr [])} ->
          Ast_helper.Exp.constant (Const_int 42)
        | other -> default_mapper.expr mapper other; }

  let () =
    register "ppx_test" test_mapper]}

    This -ppx rewriter, which replaces [[%test]] in expressions with
    the constant [42], can be compiled using
    [ocamlc -o ppx_test -I +compiler-libs ocamlcommon.cma ppx_test.ml].

    *)

  open Parsetree

  (** {2 A generic Parsetree mapper} *)

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {2 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

  include Locations.Helpers_intf

end = struct
  (* A generic Parsetree mapping class *)

  (*
  [@@@ocaml.warning "+9"]
    (* Ensure that record patterns don't miss any field. *)
  *)


  open Parsetree
  open Ast_helper
  open Location

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub = function
      | Rtag (l, attrs, b, tl) ->
          Rtag (l, sub.attributes sub attrs, b, List.map (sub.typ sub) tl)
      | Rinherit t -> Rinherit (sub.typ sub t)

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
          arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
          let f (s, a, t) = (s, sub.attributes sub a, sub.typ sub t) in
          object_ ~loc ~attrs (List.map f l) o
      | Ptyp_class (lid, tl) ->
          class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
          variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs sl (sub.typ sub t)
      | Ptyp_package (lid, l) ->
          package ~loc ~attrs (map_loc sub lid)
            (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
        {ptype_name; ptype_params; ptype_cstrs;
         ptype_kind;
         ptype_private;
         ptype_manifest;
         ptype_attributes;
         ptype_loc} =
      Type.mk (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)
        ~loc:(sub.location sub ptype_loc)
        ~attrs:(sub.attributes sub ptype_attributes)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
          Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_constructor_arguments sub = function
      | Pcstr_tuple l -> Pcstr_tuple (List.map (sub.typ sub) l)
      | Pcstr_record l ->
          Pcstr_record (List.map (sub.label_declaration sub) l)

    let map_type_extension sub
        {ptyext_path; ptyext_params;
         ptyext_constructors;
         ptyext_private;
         ptyext_attributes} =
      Te.mk
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private
        ~attrs:(sub.attributes sub ptyext_attributes)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
          Pext_decl(map_constructor_arguments sub ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
          Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
        {pext_name;
         pext_kind;
         pext_loc;
         pext_attributes} =
      Te.constructor
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)
        ~loc:(sub.location sub pext_loc)
        ~attrs:(sub.attributes sub pext_attributes)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
          arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) -> val_ ~loc ~attrs s m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) -> method_ ~loc ~attrs s p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (s, mt1, mt2) ->
          functor_ ~loc ~attrs (map_loc sub s)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) mt1)
            (sub.module_type sub mt2)
      | Pmty_with (mt, l) ->
          with_ ~loc ~attrs (sub.module_type sub mt)
            (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
          Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
          Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst d -> Pwith_typesubst (sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
          Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_recmodule l ->
          rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (arg, arg_ty, body) ->
          functor_ ~loc ~attrs (map_loc sub arg)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) arg_ty)
            (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
          apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
          constraint_ ~loc ~attrs (sub.module_expr sub m)
                      (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
          eval ~loc ~attrs:(sub.attributes sub attrs) (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_description sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
          fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
            (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
          apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
          match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
          construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
          variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
          record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
            (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
          field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
          setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
            (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
          ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
            (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
          sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
          while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
          for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
            (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
          coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
            (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
          constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) -> send ~loc ~attrs (sub.expr sub e) s
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
          setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
          override ~loc ~attrs
            (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
          letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
            (sub.expr sub e)
      | Pexp_letexception (cd, e) ->
          letexception ~loc ~attrs
            (sub.extension_constructor sub cd)
            (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
          poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) -> newtype ~loc ~attrs s (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (ovf, lid, e) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.expr sub e)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pexp_unreachable -> unreachable ~loc ~attrs ()
  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
          construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
          record ~loc ~attrs
                 (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
          constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
          structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
          fun_ ~loc ~attrs lab
            (map_opt (sub.expr sub) e)
            (sub.pat sub p)
            (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
          apply ~loc ~attrs (sub.class_expr sub ce)
            (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
          constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) -> inherit_ ~loc ~attrs o (sub.class_expr sub ce) s
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
          method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      Ci.mk
       ~virt:pci_virt
       ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
        ~loc:(sub.location sub pci_loc)
        ~attrs:(sub.attributes sub pci_attributes)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_description =
        (fun this {popen_lid; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_lid)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );


      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
          Type.constructor
            (map_loc this pcd_name)
            ~args:(T.map_constructor_arguments this pcd_args)
            ?res:(map_opt (this.typ this) pcd_res)
            ~loc:(this.location this pcd_loc)
            ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PSig x -> PSig (this.signature this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(function
        | x :: l -> PStr (x :: x :: l)
        | l -> PStr l)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Pconst_string (x, None))))
      error

  let attribute_of_warning loc s =
    { loc; txt = "ocaml.ppwarning" },
    PStr ([Str.eval ~loc (Exp.constant (Pconst_string (s, None)))])

  include Locations.Helpers_impl

end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
        [Toploop.print_out_value]
        [Toploop.print_out_type]
        [Toploop.print_out_sig_item]
        [Toploop.print_out_phrase] *)

  type out_ident (*IF_CURRENT = Outcometree.out_ident *) =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of string

  type out_attribute (*IF_CURRENT = Outcometree.out_attribute *) =
    { oattr_name: string }

  type out_value (*IF_CURRENT = Outcometree.out_value *) =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type (*IF_CURRENT = Outcometree.out_type *) =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of string * string list * out_type list
    | Otyp_attribute of out_type * out_attribute

  and out_variant (*IF_CURRENT = Outcometree.out_variant *) =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_name of out_ident * out_type list

  type out_class_type (*IF_CURRENT = Outcometree.out_class_type *) =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item (*IF_CURRENT = Outcometree.out_class_sig_item *) =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type (*IF_CURRENT = Outcometree.out_module_type *) =
    | Omty_abstract
    | Omty_functor of string * out_module_type option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item (*IF_CURRENT = Outcometree.out_sig_item *) =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of out_val_decl
    | Osig_ellipsis
  and out_type_decl (*IF_CURRENT = Outcometree.out_type_decl *) =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_immediate: bool;
      otype_unboxed: bool;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor (*IF_CURRENT = Outcometree.out_extension_constructor *) =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension (*IF_CURRENT = Outcometree.out_type_extension *) =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_val_decl (*IF_CURRENT = Outcometree.out_val_decl *) =
    { oval_name: string;
      oval_type: out_type;
      oval_prims: string list;
      oval_attributes: out_attribute list }
  and out_rec_status (*IF_CURRENT = Outcometree.out_rec_status *) =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status (*IF_CURRENT = Outcometree.out_ext_status *) =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase (*IF_CURRENT = Outcometree.out_phrase *) =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)

end

module Config = struct
  let ast_impl_magic_number = "Caml1999M020"
  let ast_intf_magic_number = "Caml1999N018"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Ast_405
= struct
#1 "ast_405.ml"
# 1 "src/ast_405.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module Location = Location
module Longident = Longident

module Asttypes = struct
  (** Auxiliary AST types used by parsetree and typedtree. *)

  type constant (*IF_CURRENT = Asttypes.constant *) =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag (*IF_CURRENT = Asttypes.rec_flag *) = Nonrecursive | Recursive

  type direction_flag (*IF_CURRENT = Asttypes.direction_flag *) = Upto | Downto

  (* Order matters, used in polymorphic comparison *)
  type private_flag (*IF_CURRENT = Asttypes.private_flag *) = Private | Public

  type mutable_flag (*IF_CURRENT = Asttypes.mutable_flag *) = Immutable | Mutable

  type virtual_flag (*IF_CURRENT = Asttypes.virtual_flag *) = Virtual | Concrete

  type override_flag (*IF_CURRENT = Asttypes.override_flag *) = Override | Fresh

  type closed_flag (*IF_CURRENT = Asttypes.closed_flag *) = Closed | Open

  type label = string

  type arg_label (*IF_CURRENT = Asttypes.arg_label *) =
      Nolabel
    | Labelled of string (*  label:T -> ... *)
    | Optional of string (* ?label:T -> ... *)

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance (*IF_CURRENT = Asttypes.variance *) =
    | Covariant
    | Contravariant
    | Invariant
end

module Parsetree = struct
  (** Abstract syntax tree produced by parsing *)

  open Asttypes

  type constant (*IF_CURRENT = Parsetree.constant *) =
      Pconst_integer of string * char option
    (* 3 3l 3L 3n

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes except 'l', 'L' and 'n' are rejected by the typechecker
    *)
    | Pconst_char of char
    (* 'c' *)
    | Pconst_string of string * string option
    (* "constant"
       {delim|other constant|delim}
    *)
    | Pconst_float of string * char option
    (* 3.4 2e5 1.4e-4

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes are rejected by the typechecker.
    *)

  (** {2 Extension points} *)

  type attribute = string loc * payload
         (* [@id ARG]
            [@@id ARG]

            Metadata containers passed around within the AST.
            The compiler ignores unknown attributes.
         *)

  and extension = string loc * payload
        (* [%id ARG]
           [%%id ARG]

           Sub-language placeholder -- rejected by the typechecker.
        *)

  and attributes = attribute list

  and payload (*IF_CURRENT = Parsetree.payload *) =
    | PStr of structure
    | PSig of signature (* : SIG *)
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {2 Core language} *)

  (* Type expressions *)

  and core_type (*IF_CURRENT = Parsetree.core_type *) =
      {
       ptyp_desc: core_type_desc;
       ptyp_loc: Location.t;
       ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and core_type_desc (*IF_CURRENT = Parsetree.core_type_desc *) =
    | Ptyp_any
          (*  _ *)
    | Ptyp_var of string
          (* 'a *)
    | Ptyp_arrow of arg_label * core_type * core_type
          (* T1 -> T2       Simple
             ~l:T1 -> T2    Labelled
             ?l:T1 -> T2    Otional
           *)
    | Ptyp_tuple of core_type list
          (* T1 * ... * Tn

             Invariant: n >= 2
          *)
    | Ptyp_constr of Longident.t loc * core_type list
          (* tconstr
             T tconstr
             (T1, ..., Tn) tconstr
           *)
    | Ptyp_object of (string loc * attributes * core_type) list * closed_flag
          (* < l1:T1; ...; ln:Tn >     (flag = Closed)
             < l1:T1; ...; ln:Tn; .. > (flag = Open)
           *)
    | Ptyp_class of Longident.t loc * core_type list
          (* #tconstr
             T #tconstr
             (T1, ..., Tn) #tconstr
           *)
    | Ptyp_alias of core_type * string
          (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
          (* [ `A|`B ]         (flag = Closed; labels = None)
             [> `A|`B ]        (flag = Open;   labels = None)
             [< `A|`B ]        (flag = Closed; labels = Some [])
             [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
           *)
    | Ptyp_poly of string loc list * core_type
          (* 'a1 ... 'an. T

             Can only appear in the following context:

             - As the core_type of a Ppat_constraint node corresponding
               to a constraint on a let-binding: let x : 'a1 ... 'an. T
               = e ...

             - Under Cfk_virtual for methods (not values).

             - As the core_type of a Pctf_method node.

             - As the core_type of a Pexp_poly node.

             - As the pld_type field of a label_declaration.

             - As a core_type of a Ptyp_object node.
           *)

    | Ptyp_package of package_type
          (* (module S) *)
    | Ptyp_extension of extension
          (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
        (*
          (module S)
          (module S with type t1 = T1 and ... and tn = Tn)
         *)

  and row_field (*IF_CURRENT = Parsetree.row_field *) =
    | Rtag of label * attributes * bool * core_type list
          (* [`A]                   ( true,  [] )
             [`A of T]              ( false, [T] )
             [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
             [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

            - The 2nd field is true if the tag contains a
              constant (empty) constructor.
            - '&' occurs when several types are used for the same constructor
              (see 4.2 in the manual)

            - TODO: switch to a record representation, and keep location
          *)
    | Rinherit of core_type
          (* [ T ] *)

  (* Patterns *)

  and pattern (*IF_CURRENT = Parsetree.pattern *) =
      {
       ppat_desc: pattern_desc;
       ppat_loc: Location.t;
       ppat_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and pattern_desc (*IF_CURRENT = Parsetree.pattern_desc *) =
    | Ppat_any
          (* _ *)
    | Ppat_var of string loc
          (* x *)
    | Ppat_alias of pattern * string loc
          (* P as 'a *)
    | Ppat_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
          (* 'a'..'z'

             Other forms of interval are recognized by the parser
             but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
          (* (P1, ..., Pn)

             Invariant: n >= 2
          *)
    | Ppat_construct of Longident.t loc * pattern option
          (* C                None
             C P              Some P
             C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
           *)
    | Ppat_variant of label * pattern option
          (* `A             (None)
             `A P           (Some P)
           *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
          (* { l1=P1; ...; ln=Pn }     (flag = Closed)
             { l1=P1; ...; ln=Pn; _}   (flag = Open)

             Invariant: n > 0
           *)
    | Ppat_array of pattern list
          (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
          (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
          (* (P : T) *)
    | Ppat_type of Longident.t loc
          (* #tconst *)
    | Ppat_lazy of pattern
          (* lazy P *)
    | Ppat_unpack of string loc
          (* (module P)
             Note: (module P : S) is represented as
             Ppat_constraint(Ppat_unpack, Ptyp_package)
           *)
    | Ppat_exception of pattern
          (* exception P *)
    | Ppat_extension of extension
          (* [%id] *)
    | Ppat_open of Longident.t loc * pattern
          (* M.(P) *)

  (* Value expressions *)

  and expression (*IF_CURRENT = Parsetree.expression *) =
      {
       pexp_desc: expression_desc;
       pexp_loc: Location.t;
       pexp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and expression_desc (*IF_CURRENT = Parsetree.expression_desc *) =
    | Pexp_ident of Longident.t loc
          (* x
             M.x
           *)
    | Pexp_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
          (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
           *)
    | Pexp_function of case list
          (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of arg_label * expression option * pattern * expression
          (* fun P -> E1                          (Simple, None)
             fun ~l:P -> E1                       (Labelled l, None)
             fun ?l:P -> E1                       (Optional l, None)
             fun ?l:(P = E0) -> E1                (Optional l, Some E0)

             Notes:
             - If E0 is provided, only Optional is allowed.
             - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
             - "let f P = E" is represented using Pexp_fun.
           *)
    | Pexp_apply of expression * (arg_label * expression) list
          (* E0 ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pexp_match of expression * case list
          (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * case list
          (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
          (* (E1, ..., En)

             Invariant: n >= 2
          *)
    | Pexp_construct of Longident.t loc * expression option
          (* C                None
             C E              Some E
             C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
          *)
    | Pexp_variant of label * expression option
          (* `A             (None)
             `A E           (Some E)
           *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
          (* { l1=P1; ...; ln=Pn }     (None)
             { E0 with l1=P1; ...; ln=Pn }   (Some E0)

             Invariant: n > 0
           *)
    | Pexp_field of expression * Longident.t loc
          (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
          (* E1.l <- E2 *)
    | Pexp_array of expression list
          (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
          (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
          (* E1; E2 *)
    | Pexp_while of expression * expression
          (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
          (* for i = E1 to E2 do E3 done      (flag = Upto)
             for i = E1 downto E2 do E3 done  (flag = Downto)
           *)
    | Pexp_constraint of expression * core_type
          (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
          (* (E :> T)        (None, T)
             (E : T0 :> T)   (Some T0, T)
           *)
    | Pexp_send of expression * string loc
          (*  E # m *)
    | Pexp_new of Longident.t loc
          (* new M.c *)
    | Pexp_setinstvar of string loc * expression
          (* x <- 2 *)
    | Pexp_override of (string loc * expression) list
          (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string loc * module_expr * expression
          (* let module M = ME in E *)
    | Pexp_letexception of extension_constructor * expression
          (* let exception C in E *)
    | Pexp_assert of expression
          (* assert E
             Note: "assert false" is treated in a special way by the
             type-checker. *)
    | Pexp_lazy of expression
          (* lazy E *)
    | Pexp_poly of expression * core_type option
          (* Used for method bodies.

             Can only be used as the expression under Cfk_concrete
             for methods (not values). *)
    | Pexp_object of class_structure
          (* object ... end *)
    | Pexp_newtype of string loc * expression
          (* fun (type t) -> E *)
    | Pexp_pack of module_expr
          (* (module ME)

             (module ME : S) is represented as
             Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of override_flag * Longident.t loc * expression
          (* M.(E)
             let open M in E
             let! open M in E *)
    | Pexp_extension of extension
          (* [%id] *)
    | Pexp_unreachable
          (* . *)

  and case (*IF_CURRENT = Parsetree.case *) =   (* (P -> E) or (P when E0 -> E) *)
      {
       pc_lhs: pattern;
       pc_guard: expression option;
       pc_rhs: expression;
      }

  (* Value descriptions *)

  and value_description (*IF_CURRENT = Parsetree.value_description *) =
      {
       pval_name: string loc;
       pval_type: core_type;
       pval_prim: string list;
       pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
       pval_loc: Location.t;
      }

  (*
    val x: T                            (prim = [])
    external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])
  *)

  (* Type declarations *)

  and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
      {
       ptype_name: string loc;
       ptype_params: (core_type * variance) list;
             (* ('a1,...'an) t; None represents  _*)
       ptype_cstrs: (core_type * core_type * Location.t) list;
             (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
       ptype_kind: type_kind;
       ptype_private: private_flag;   (* = private ... *)
       ptype_manifest: core_type option;  (* = T *)
       ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
       ptype_loc: Location.t;
      }

  (*
    type t                     (abstract, no manifest)
    type t = T0                (abstract, manifest=T0)
    type t = C of T | ...      (variant,  no manifest)
    type t = T0 = C of T | ... (variant,  manifest=T0)
    type t = {l: T; ...}       (record,   no manifest)
    type t = T0 = {l : T; ...} (record,   manifest=T0)
    type t = ..                (open,     no manifest)
  *)

  and type_kind (*IF_CURRENT = Parsetree.type_kind *) =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
          (* Invariant: non-empty list *)
    | Ptype_record of label_declaration list
          (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration (*IF_CURRENT = Parsetree.label_declaration *) =
      {
       pld_name: string loc;
       pld_mutable: mutable_flag;
       pld_type: core_type;
       pld_loc: Location.t;
       pld_attributes: attributes; (* l [@id1] [@id2] : T *)
      }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration (*IF_CURRENT = Parsetree.constructor_declaration *) =
      {
       pcd_name: string loc;
       pcd_args: constructor_arguments;
       pcd_res: core_type option;
       pcd_loc: Location.t;
       pcd_attributes: attributes; (* C [@id1] [@id2] of ... *)
      }

  and constructor_arguments (*IF_CURRENT = Parsetree.constructor_arguments *) =
    | Pcstr_tuple of core_type list
    | Pcstr_record of label_declaration list

  (*
    | C of T1 * ... * Tn     (res = None,    args = Pcstr_tuple [])
    | C: T0                  (res = Some T0, args = [])
    | C: T1 * ... * Tn -> T0 (res = Some T0, args = Pcstr_tuple)
    | C of {...}             (res = None,    args = Pcstr_record)
    | C: {...} -> T0         (res = Some T0, args = Pcstr_record)
    | C of {...} as t        (res = None,    args = Pcstr_record)
  *)

  and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
      {
       ptyext_path: Longident.t loc;
       ptyext_params: (core_type * variance) list;
       ptyext_constructors: extension_constructor list;
       ptyext_private: private_flag;
       ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      }
  (*
    type t += ...
  *)

  and extension_constructor (*IF_CURRENT = Parsetree.extension_constructor *) =
      {
       pext_name: string loc;
       pext_kind : extension_constructor_kind;
       pext_loc : Location.t;
       pext_attributes: attributes; (* C [@id1] [@id2] of ... *)
      }

  and extension_constructor_kind (*IF_CURRENT = Parsetree.extension_constructor_kind *) =
      Pext_decl of constructor_arguments * core_type option
        (*
           | C of T1 * ... * Tn     ([T1; ...; Tn], None)
           | C: T0                  ([], Some T0)
           | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
         *)
    | Pext_rebind of Longident.t loc
        (*
           | C = D
         *)

  (** {2 Class language} *)

  (* Type expressions for the class language *)

  and class_type (*IF_CURRENT = Parsetree.class_type *) =
      {
       pcty_desc: class_type_desc;
       pcty_loc: Location.t;
       pcty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_type_desc (*IF_CURRENT = Parsetree.class_type_desc *) =
    | Pcty_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
          (* object ... end *)
    | Pcty_arrow of arg_label * core_type * class_type
          (* T -> CT       Simple
             ~l:T -> CT    Labelled l
             ?l:T -> CT    Optional l
           *)
    | Pcty_extension of extension
          (* [%id] *)

  and class_signature (*IF_CURRENT = Parsetree.class_signature *) =
      {
       pcsig_self: core_type;
       pcsig_fields: class_type_field list;
      }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
   *)

  and class_type_field (*IF_CURRENT = Parsetree.class_type_field *) =
      {
       pctf_desc: class_type_field_desc;
       pctf_loc: Location.t;
       pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_type_field_desc (*IF_CURRENT = Parsetree.class_type_field_desc *) =
    | Pctf_inherit of class_type
          (* inherit CT *)
    | Pctf_val of (string loc * mutable_flag * virtual_flag * core_type)
          (* val x: T *)
    | Pctf_method  of (string loc * private_flag * virtual_flag * core_type)
          (* method x: T

             Note: T can be a Ptyp_poly.
           *)
    | Pctf_constraint  of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
          (* [@@@id] *)
    | Pctf_extension of extension
          (* [%%id] *)

  and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
      {
       pci_virt: virtual_flag;
       pci_params: (core_type * variance) list;
       pci_name: string loc;
       pci_expr: 'a;
       pci_loc: Location.t;
       pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr (*IF_CURRENT = Parsetree.class_expr *) =
      {
       pcl_desc: class_expr_desc;
       pcl_loc: Location.t;
       pcl_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_expr_desc (*IF_CURRENT = Parsetree.class_expr_desc *) =
    | Pcl_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
          (* object ... end *)
    | Pcl_fun of arg_label * expression option * pattern * class_expr
          (* fun P -> CE                          (Simple, None)
             fun ~l:P -> CE                       (Labelled l, None)
             fun ?l:P -> CE                       (Optional l, None)
             fun ?l:(P = E0) -> CE                (Optional l, Some E0)
           *)
    | Pcl_apply of class_expr * (arg_label * expression) list
          (* CE ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pcl_let of rec_flag * value_binding list * class_expr
          (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
           *)
    | Pcl_constraint of class_expr * class_type
          (* (CE : CT) *)
    | Pcl_extension of extension
          (* [%id] *)

  and class_structure (*IF_CURRENT = Parsetree.class_structure *) =
      {
       pcstr_self: pattern;
       pcstr_fields: class_field list;
      }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
   *)

  and class_field (*IF_CURRENT = Parsetree.class_field *) =
      {
       pcf_desc: class_field_desc;
       pcf_loc: Location.t;
       pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_field_desc (*IF_CURRENT = Parsetree.class_field_desc *) =
    | Pcf_inherit of override_flag * class_expr * string loc option
          (* inherit CE
             inherit CE as x
             inherit! CE
             inherit! CE as x
           *)
    | Pcf_val of (string loc * mutable_flag * class_field_kind)
          (* val x = E
             val virtual x: T
           *)
    | Pcf_method of (string loc * private_flag * class_field_kind)
          (* method x = E            (E can be a Pexp_poly)
             method virtual x: T     (T can be a Ptyp_poly)
           *)
    | Pcf_constraint of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pcf_initializer of expression
          (* initializer E *)
    | Pcf_attribute of attribute
          (* [@@@id] *)
    | Pcf_extension of extension
          (* [%%id] *)

  and class_field_kind (*IF_CURRENT = Parsetree.class_field_kind *) =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {2 Module language} *)

  (* Type expressions for the module language *)

  and module_type (*IF_CURRENT = Parsetree.module_type *) =
      {
       pmty_desc: module_type_desc;
       pmty_loc: Location.t;
       pmty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_type_desc (*IF_CURRENT = Parsetree.module_type_desc *) =
    | Pmty_ident of Longident.t loc
          (* S *)
    | Pmty_signature of signature
          (* sig ... end *)
    | Pmty_functor of string loc * module_type option * module_type
          (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
          (* MT with ... *)
    | Pmty_typeof of module_expr
          (* module type of ME *)
    | Pmty_extension of extension
          (* [%id] *)
    | Pmty_alias of Longident.t loc
          (* (module M) *)

  and signature = signature_item list

  and signature_item (*IF_CURRENT = Parsetree.signature_item *) =
      {
       psig_desc: signature_item_desc;
       psig_loc: Location.t;
      }

  and signature_item_desc (*IF_CURRENT = Parsetree.signature_item_desc *) =
    | Psig_value of value_description
          (*
            val x: T
            external x: T = "s1" ... "sn"
           *)
    | Psig_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Psig_typext of type_extension
          (* type t1 += ... *)
    | Psig_exception of extension_constructor
          (* exception C of T *)
    | Psig_module of module_declaration
          (* module X : MT *)
    | Psig_recmodule of module_declaration list
          (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
          (* module type S = MT
             module type S *)
    | Psig_open of open_description
          (* open X *)
    | Psig_include of include_description
          (* include MT *)
    | Psig_class of class_description list
          (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
          (* [@@@id] *)
    | Psig_extension of extension * attributes
          (* [%%id] *)

  and module_declaration (*IF_CURRENT = Parsetree.module_declaration *) =
      {
       pmd_name: string loc;
       pmd_type: module_type;
       pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmd_loc: Location.t;
      }
  (* S : MT *)

  and module_type_declaration (*IF_CURRENT = Parsetree.module_type_declaration *) =
      {
       pmtd_name: string loc;
       pmtd_type: module_type option;
       pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmtd_loc: Location.t;
      }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and open_description (*IF_CURRENT = Parsetree.open_description *) =
      {
       popen_lid: Longident.t loc;
       popen_override: override_flag;
       popen_loc: Location.t;
       popen_attributes: attributes;
      }
  (* open! X - popen_override = Override (silences the 'used identifier
                                shadowing' warning)
     open  X - popen_override = Fresh
   *)

  and 'a include_infos (*IF_CURRENT = 'a Parsetree.include_infos *) =
      {
       pincl_mod: 'a;
       pincl_loc: Location.t;
       pincl_attributes: attributes;
      }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint (*IF_CURRENT = Parsetree.with_constraint *) =
    | Pwith_type of Longident.t loc * type_declaration
          (* with type X.t = ...

             Note: the last component of the longident must match
             the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
          (* with module X.Y = Z *)
    | Pwith_typesubst of type_declaration
          (* with type t := ... *)
    | Pwith_modsubst of string loc * Longident.t loc
          (* with module X := Z *)

  (* Value expressions for the module language *)

  and module_expr (*IF_CURRENT = Parsetree.module_expr *) =
      {
       pmod_desc: module_expr_desc;
       pmod_loc: Location.t;
       pmod_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_expr_desc (*IF_CURRENT = Parsetree.module_expr_desc *) =
    | Pmod_ident of Longident.t loc
          (* X *)
    | Pmod_structure of structure
          (* struct ... end *)
    | Pmod_functor of string loc * module_type option * module_expr
          (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
          (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
          (* (ME : MT) *)
    | Pmod_unpack of expression
          (* (val E) *)
    | Pmod_extension of extension
          (* [%id] *)

  and structure = structure_item list

  and structure_item (*IF_CURRENT = Parsetree.structure_item *) =
      {
       pstr_desc: structure_item_desc;
       pstr_loc: Location.t;
      }

  and structure_item_desc (*IF_CURRENT = Parsetree.structure_item_desc *) =
    | Pstr_eval of expression * attributes
          (* E *)
    | Pstr_value of rec_flag * value_binding list
          (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
           *)
    | Pstr_primitive of value_description
          (*  val x: T
              external x: T = "s1" ... "sn" *)
    | Pstr_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
          (* type t1 += ... *)
    | Pstr_exception of extension_constructor
          (* exception C of T
             exception C = M.X *)
    | Pstr_module of module_binding
          (* module X = ME *)
    | Pstr_recmodule of module_binding list
          (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
          (* module type S = MT *)
    | Pstr_open of open_description
          (* open X *)
    | Pstr_class of class_declaration list
          (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
          (* include ME *)
    | Pstr_attribute of attribute
          (* [@@@id] *)
    | Pstr_extension of extension * attributes
          (* [%%id] *)

  and value_binding (*IF_CURRENT = Parsetree.value_binding *) =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding (*IF_CURRENT = Parsetree.module_binding *) =
      {
       pmb_name: string loc;
       pmb_expr: module_expr;
       pmb_attributes: attributes;
       pmb_loc: Location.t;
      }
  (* X = ME *)

  (** {2 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase (*IF_CURRENT = Parsetree.toplevel_phrase *) =
    | Ptop_def of structure
    | Ptop_dir of string * directive_argument
       (* #use, #load ... *)

  and directive_argument (*IF_CURRENT = Parsetree.directive_argument *) =
    | Pdir_none
    | Pdir_string of string
    | Pdir_int of string * char option
    | Pdir_ident of Longident.t
    | Pdir_bool of bool

end

module Docstrings : sig
  (** {3 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {3 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

end = struct
  open Location

  (* Docstrings *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t;
    }

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc;
      }
    in
    ds

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (doc_loc, PStr [item])

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (text_loc, PStr [item])

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""; _} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

end

module Ast_helper : sig

  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Docstrings
  open Parsetree

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  (** {2 Default locations} *)

  val default_loc: loc ref
      (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
      (** Set the [default_loc] within the scope of the execution
          of the provided function. *)

  (** {2 Constants} *)

  module Const : sig
    val char : char -> constant
    val string : ?quotation_delimiter:string -> string -> constant
    val integer : ?suffix:char -> string -> constant
    val int : ?suffix:char -> int -> constant
    val int32 : ?suffix:char -> int32 -> constant
    val int64 : ?suffix:char -> int64 -> constant
    val nativeint : ?suffix:char -> nativeint -> constant
    val float : ?suffix:char -> string -> constant
  end

  (** {2 Core language} *)

  (** Type expressions *)
  module Typ :
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
      val attr: core_type -> attribute -> core_type

      val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
      val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type -> core_type
                 -> core_type
      val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val object_: ?loc:loc -> ?attrs:attrs ->
                    (str * attributes * core_type) list -> closed_flag ->
                    core_type
      val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
      val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
                   -> label list option -> core_type
      val poly: ?loc:loc -> ?attrs:attrs -> str list -> core_type -> core_type
      val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
                   -> core_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

      val force_poly: core_type -> core_type

      val varify_constructors: str list -> core_type -> core_type
      (** [varify_constructors newtypes te] is type expression [te], of which
          any of nullary type constructor [tc] is replaced by type variable of
          the same name, if [tc]'s name appears in [newtypes].
          Raise [Syntaxerr.Variable_in_scope] if any type variable inside [te]
          appears in [newtypes].
          @since 4.05
       *)
    end

  (** Patterns *)
  module Pat:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
      val attr:pattern -> attribute -> pattern

      val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
      val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
      val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
      val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
      val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
      val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
                  -> pattern
      val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
      val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
      val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
      val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val open_: ?loc:loc -> ?attrs:attrs  -> lid -> pattern -> pattern
      val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
    end

  (** Expressions *)
  module Exp:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
      val attr: expression -> attribute -> expression

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
                -> expression -> expression
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option
                -> pattern -> expression -> expression
      val function_: ?loc:loc -> ?attrs:attrs -> case list -> expression
      val apply: ?loc:loc -> ?attrs:attrs -> expression
                 -> (arg_label * expression) list -> expression
      val match_: ?loc:loc -> ?attrs:attrs -> expression -> case list
                  -> expression
      val try_: ?loc:loc -> ?attrs:attrs -> expression -> case list -> expression
      val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
                     -> expression
      val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
                   -> expression
      val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
                  -> expression option -> expression
      val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
                    -> expression
      val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
                      -> expression option -> expression
      val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
                    -> expression
      val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
                  -> expression
      val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
                -> direction_flag -> expression -> expression
      val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                  -> core_type -> expression
      val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
                       -> expression
      val send: ?loc:loc -> ?attrs:attrs -> expression -> str -> expression
      val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
                    -> expression
      val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
                     -> expression
      val letexception:
        ?loc:loc -> ?attrs:attrs -> extension_constructor -> expression
        -> expression
      val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                -> expression
      val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
      val newtype: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> expression
                 -> expression
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression
      val unreachable: ?loc:loc -> ?attrs:attrs -> unit -> expression

      val case: pattern -> ?guard:expression -> expression -> case
    end

  (** Value declarations *)
  module Val:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        ?prim:string list -> str -> core_type -> value_description
    end

  (** Type declarations *)
  module Type:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?params:(core_type * variance) list ->
        ?cstrs:(core_type * core_type * loc) list ->
        ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
        type_declaration

      val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        constructor_declaration
      val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?mut:mutable_flag -> str -> core_type -> label_declaration
    end

  (** Type extensions *)
  module Te:
    sig
      val mk: ?attrs:attrs -> ?docs:docs ->
        ?params:(core_type * variance) list -> ?priv:private_flag ->
        lid -> extension_constructor list -> type_extension

      val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> extension_constructor_kind -> extension_constructor

      val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        extension_constructor
      val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> lid -> extension_constructor
    end

  (** {2 Module language} *)

  (** Module type expressions *)
  module Mty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
      val attr: module_type -> attribute -> module_type

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_type -> module_type
      val with_: ?loc:loc -> ?attrs:attrs -> module_type ->
        with_constraint list -> module_type
      val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
    end

  (** Module expressions *)
  module Mod:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
      val attr: module_expr -> attribute -> module_expr

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
      val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_expr -> module_expr
      val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr ->
        module_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type ->
        module_expr
      val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
    end

  (** Signature items *)
  module Sig:
    sig
      val mk: ?loc:loc -> signature_item_desc -> signature_item

      val value: ?loc:loc -> value_description -> signature_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item
      val type_extension: ?loc:loc -> type_extension -> signature_item
      val exception_: ?loc:loc -> extension_constructor -> signature_item
      val module_: ?loc:loc -> module_declaration -> signature_item
      val rec_module: ?loc:loc -> module_declaration list -> signature_item
      val modtype: ?loc:loc -> module_type_declaration -> signature_item
      val open_: ?loc:loc -> open_description -> signature_item
      val include_: ?loc:loc -> include_description -> signature_item
      val class_: ?loc:loc -> class_description list -> signature_item
      val class_type: ?loc:loc -> class_type_declaration list -> signature_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
      val attribute: ?loc:loc -> attribute -> signature_item
      val text: text -> signature_item list
    end

  (** Structure items *)
  module Str:
    sig
      val mk: ?loc:loc -> structure_item_desc -> structure_item

      val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
      val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
      val primitive: ?loc:loc -> value_description -> structure_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item
      val type_extension: ?loc:loc -> type_extension -> structure_item
      val exception_: ?loc:loc -> extension_constructor -> structure_item
      val module_: ?loc:loc -> module_binding -> structure_item
      val rec_module: ?loc:loc -> module_binding list -> structure_item
      val modtype: ?loc:loc -> module_type_declaration -> structure_item
      val open_: ?loc:loc -> open_description -> structure_item
      val class_: ?loc:loc -> class_declaration list -> structure_item
      val class_type: ?loc:loc -> class_type_declaration list -> structure_item
      val include_: ?loc:loc -> include_declaration -> structure_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
      val attribute: ?loc:loc -> attribute -> structure_item
      val text: text -> structure_item list
    end

  (** Module declarations *)
  module Md:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_type -> module_declaration
    end

  (** Module type declarations *)
  module Mtd:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?typ:module_type -> str -> module_type_declaration
    end

  (** Module bindings *)
  module Mb:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_expr -> module_binding
    end

  (** Opens *)
  module Opn:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
        ?override:override_flag -> lid -> open_description
    end

  (** Includes *)
  module Incl:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
    end

  (** Value bindings *)
  module Vb:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        pattern -> expression -> value_binding
    end


  (** {2 Class language} *)

  (** Class type expressions *)
  module Cty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
      val attr: class_type -> attribute -> class_type

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
      val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type ->
        class_type -> class_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
    end

  (** Class type fields *)
  module Ctf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        class_type_field_desc -> class_type_field
      val attr: class_type_field -> attribute -> class_type_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
        virtual_flag -> core_type -> class_type_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
        virtual_flag -> core_type -> class_type_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_type_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
      val attribute: ?loc:loc -> attribute -> class_type_field
      val text: text -> class_type_field list
    end

  (** Class expressions *)
  module Cl:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
      val attr: class_expr -> attribute -> class_expr

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
      val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option ->
        pattern -> class_expr -> class_expr
      val apply: ?loc:loc -> ?attrs:attrs -> class_expr ->
        (arg_label * expression) list -> class_expr
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list ->
        class_expr -> class_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type ->
        class_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
    end

  (** Class fields *)
  module Cf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
        class_field
      val attr: class_field -> attribute -> class_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr ->
        str option -> class_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
        class_field_kind -> class_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
        class_field_kind -> class_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_field
      val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
      val attribute: ?loc:loc -> attribute -> class_field
      val text: text -> class_field list

      val virtual_: core_type -> class_field_kind
      val concrete: override_flag -> expression -> class_field_kind

    end

  (** Classes *)
  module Ci:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?virt:virtual_flag -> ?params:(core_type * variance) list ->
        str -> 'a -> 'a class_infos
    end

  (** Class signatures *)
  module Csig:
    sig
      val mk: core_type -> class_type_field list -> class_signature
    end

  (** Class structures *)
  module Cstr:
    sig
      val mk: pattern -> class_field list -> class_structure
    end

end = struct
  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Parsetree
  open Docstrings

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    let old = !default_loc in
    default_loc := l;
    try let r = f () in default_loc := old; r
    with exn -> default_loc := old; raise exn

  module Const = struct
    let integer ?suffix i = Pconst_integer (i, suffix)
    let int ?suffix i = integer ?suffix (string_of_int i)
    let int32 ?(suffix='l') i = integer ~suffix (Int32.to_string i)
    let int64 ?(suffix='L') i = integer ~suffix (Int64.to_string i)
    let nativeint ?(suffix='n') i = integer ~suffix (Nativeint.to_string i)
    let float ?suffix f = Pconst_float (f, suffix)
    let char c = Pconst_char c
    let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter)
  end

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs}
    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)

    let varify_constructors var_names t =
      let check_variable vl loc v =
        if List.mem v vl then
          raise Syntaxerr.(Error(Variable_in_scope(loc,v))) in
      let var_names = List.map (fun v -> v.txt) var_names in
      let rec loop t =
        let desc =
          match t.ptyp_desc with
          | Ptyp_any -> Ptyp_any
          | Ptyp_var x ->
              check_variable var_names t.ptyp_loc x;
              Ptyp_var x
          | Ptyp_arrow (label,core_type,core_type') ->
              Ptyp_arrow(label, loop core_type, loop core_type')
          | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
          | Ptyp_constr( { txt = Longident.Lident s; _ }, [])
            when List.mem s var_names ->
              Ptyp_var s
          | Ptyp_constr(longident, lst) ->
              Ptyp_constr(longident, List.map loop lst)
          | Ptyp_object (lst, o) ->
              Ptyp_object
                (List.map (fun (s, attrs, t) -> (s, attrs, loop t)) lst, o)
          | Ptyp_class (longident, lst) ->
              Ptyp_class (longident, List.map loop lst)
          | Ptyp_alias(core_type, string) ->
              check_variable var_names t.ptyp_loc string;
              Ptyp_alias(loop core_type, string)
          | Ptyp_variant(row_field_list, flag, lbl_lst_option) ->
              Ptyp_variant(List.map loop_row_field row_field_list,
                           flag, lbl_lst_option)
          | Ptyp_poly(string_lst, core_type) ->
            List.iter (fun v ->
              check_variable var_names t.ptyp_loc v.txt) string_lst;
              Ptyp_poly(string_lst, loop core_type)
          | Ptyp_package(longident,lst) ->
              Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
          | Ptyp_extension (s, arg) ->
              Ptyp_extension (s, arg)
        in
        {t with ptyp_desc = desc}
      and loop_row_field  =
        function
          | Rtag(label,attrs,flag,lst) ->
              Rtag(label,attrs,flag,List.map loop lst)
          | Rinherit t ->
              Rinherit (loop t)
      in
      loop t

  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d; ppat_loc = loc; ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b))
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d; pexp_loc = loc; pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let letexception ?loc ?attrs a b = mk ?loc ?attrs (Pexp_letexception (a, b))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_open (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)
    let unreachable ?loc ?attrs () = mk ?loc ?attrs Pexp_unreachable

    let case lhs ?guard rhs =
      {
       pc_lhs = lhs;
       pc_guard = guard;
       pc_rhs = rhs;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg arg_ty body =
      mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc rec_flag a = mk ?loc (Psig_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcl_desc = d;
       pcl_loc = loc;
       pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcty_desc = d;
       pcty_loc = loc;
       pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
             ?(docs = empty_docs) d =
      {
       pctf_desc = d;
       pctf_loc = loc;
       pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
     let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
       List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
       pcf_desc = d;
       pcf_loc = loc;
       pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(prim = []) name typ =
      {
       pval_name = name;
       pval_type = typ;
       pval_attributes = add_docs_attrs docs attrs;
       pval_loc = loc;
       pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name typ =
      {
       pmd_name = name;
       pmd_type = typ;
       pmd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmd_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) ?typ name =
      {
       pmtd_name = name;
       pmtd_type = typ;
       pmtd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name expr =
      {
       pmb_name = name;
       pmb_expr = expr;
       pmb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(override = Fresh) lid =
      {
       popen_lid = lid;
       popen_override = override;
       popen_loc = loc;
       popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
       pincl_mod = mexpr;
       pincl_loc = loc;
       pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(text = []) pat expr =
      {
       pvb_pat = pat;
       pvb_expr = expr;
       pvb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(virt = Concrete) ?(params = []) name expr =
      {
       pci_virt = virt;
       pci_params = params;
       pci_name = name;
       pci_expr = expr;
       pci_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
        ?(params = [])
        ?(cstrs = [])
        ?(kind = Ptype_abstract)
        ?(priv = Public)
        ?manifest
        name =
      {
       ptype_name = name;
       ptype_params = params;
       ptype_cstrs = cstrs;
       ptype_kind = kind;
       ptype_private = priv;
       ptype_manifest = manifest;
       ptype_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(args = Pcstr_tuple []) ?res name =
      {
       pcd_name = name;
       pcd_args = args;
       pcd_res = res;
       pcd_loc = loc;
       pcd_attributes = add_info_attrs info attrs;
       }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(mut = Immutable) name typ =
      {
       pld_name = name;
       pld_mutable = mut;
       pld_type = typ;
       pld_loc = loc;
       pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(attrs = []) ?(docs = empty_docs)
          ?(params = []) ?(priv = Public) path constructors =
      {
       ptyext_path = path;
       ptyext_params = params;
       ptyext_constructors = constructors;
       ptyext_private = priv;
       ptyext_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
       pext_name = name;
       pext_kind = kind;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
               ?(info = empty_info) ?(args = Pcstr_tuple []) ?res name =
      {
       pext_name = name;
       pext_kind = Pext_decl(args, res);
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
       pext_name = name;
       pext_kind = Pext_rebind lid;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
       pcsig_self = self;
       pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
       pcstr_self = self;
       pcstr_fields = fields;
      }
  end

end

module Ast_mapper : sig
  (** The interface of a -ppx rewriter

    A -ppx rewriter is a program that accepts a serialized abstract syntax
    tree and outputs another, possibly modified, abstract syntax tree.
    This module encapsulates the interface between the compiler and
    the -ppx rewriters, handling such details as the serialization format,
    forwarding of command-line flags, and storing state.

    {!mapper} allows to implement AST rewriting using open recursion.
    A typical mapper would be based on {!default_mapper}, a deep
    identity mapper, and will fall back on it for handling the syntax it
    does not modify. For example:

    {[
  open Asttypes
  open Parsetree
  open Ast_mapper

  let test_mapper argv =
    { default_mapper with
      expr = fun mapper expr ->
        match expr with
        | { pexp_desc = Pexp_extension ({ txt = "test" }, PStr [])} ->
          Ast_helper.Exp.constant (Const_int 42)
        | other -> default_mapper.expr mapper other; }

  let () =
    register "ppx_test" test_mapper]}

    This -ppx rewriter, which replaces [[%test]] in expressions with
    the constant [42], can be compiled using
    [ocamlc -o ppx_test -I +compiler-libs ocamlcommon.cma ppx_test.ml].

    *)

  open Parsetree

  (** {2 A generic Parsetree mapper} *)

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {2 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

  include Locations.Helpers_intf

end = struct
  (* A generic Parsetree mapping class *)

  (*
  [@@@ocaml.warning "+9"]
    (* Ensure that record patterns don't miss any field. *)
  *)


  open Parsetree
  open Ast_helper
  open Location

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub = function
      | Rtag (l, attrs, b, tl) ->
          Rtag (l, sub.attributes sub attrs, b, List.map (sub.typ sub) tl)
      | Rinherit t -> Rinherit (sub.typ sub t)

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
          arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
          let f (s, a, t) =
            (map_loc sub s, sub.attributes sub a, sub.typ sub t) in
          object_ ~loc ~attrs (List.map f l) o
      | Ptyp_class (lid, tl) ->
          class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
          variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs
                               (List.map (map_loc sub) sl) (sub.typ sub t)
      | Ptyp_package (lid, l) ->
          package ~loc ~attrs (map_loc sub lid)
            (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
        {ptype_name; ptype_params; ptype_cstrs;
         ptype_kind;
         ptype_private;
         ptype_manifest;
         ptype_attributes;
         ptype_loc} =
      Type.mk (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)
        ~loc:(sub.location sub ptype_loc)
        ~attrs:(sub.attributes sub ptype_attributes)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
          Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_constructor_arguments sub = function
      | Pcstr_tuple l -> Pcstr_tuple (List.map (sub.typ sub) l)
      | Pcstr_record l ->
          Pcstr_record (List.map (sub.label_declaration sub) l)

    let map_type_extension sub
        {ptyext_path; ptyext_params;
         ptyext_constructors;
         ptyext_private;
         ptyext_attributes} =
      Te.mk
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private
        ~attrs:(sub.attributes sub ptyext_attributes)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
          Pext_decl(map_constructor_arguments sub ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
          Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
        {pext_name;
         pext_kind;
         pext_loc;
         pext_attributes} =
      Te.constructor
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)
        ~loc:(sub.location sub pext_loc)
        ~attrs:(sub.attributes sub pext_attributes)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
          arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) ->
          val_ ~loc ~attrs (map_loc sub s) m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) ->
          method_ ~loc ~attrs (map_loc sub s) p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (s, mt1, mt2) ->
          functor_ ~loc ~attrs (map_loc sub s)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) mt1)
            (sub.module_type sub mt2)
      | Pmty_with (mt, l) ->
          with_ ~loc ~attrs (sub.module_type sub mt)
            (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
          Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
          Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst d -> Pwith_typesubst (sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
          Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_recmodule l ->
          rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (arg, arg_ty, body) ->
          functor_ ~loc ~attrs (map_loc sub arg)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) arg_ty)
            (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
          apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
          constraint_ ~loc ~attrs (sub.module_expr sub m)
                      (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
          eval ~loc ~attrs:(sub.attributes sub attrs) (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_description sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
          fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
            (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
          apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
          match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
          construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
          variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
          record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
            (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
          field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
          setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
            (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
          ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
            (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
          sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
          while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
          for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
            (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
          coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
            (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
          constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) ->
          send ~loc ~attrs (sub.expr sub e) (map_loc sub s)
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
          setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
          override ~loc ~attrs
            (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
          letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
            (sub.expr sub e)
      | Pexp_letexception (cd, e) ->
          letexception ~loc ~attrs
            (sub.extension_constructor sub cd)
            (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
          poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) ->
          newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (ovf, lid, e) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.expr sub e)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pexp_unreachable -> unreachable ~loc ~attrs ()
  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
          construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
          record ~loc ~attrs
                 (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
          constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
          structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
          fun_ ~loc ~attrs lab
            (map_opt (sub.expr sub) e)
            (sub.pat sub p)
            (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
          apply ~loc ~attrs (sub.class_expr sub ce)
            (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
          constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) ->
          inherit_ ~loc ~attrs o (sub.class_expr sub ce)
            (map_opt (map_loc sub) s)
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
          method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      Ci.mk
       ~virt:pci_virt
       ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
        ~loc:(sub.location sub pci_loc)
        ~attrs:(sub.attributes sub pci_attributes)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_description =
        (fun this {popen_lid; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_lid)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );


      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
          Type.constructor
            (map_loc this pcd_name)
            ~args:(T.map_constructor_arguments this pcd_args)
            ?res:(map_opt (this.typ this) pcd_res)
            ~loc:(this.location this pcd_loc)
            ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PSig x -> PSig (this.signature this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(function
        | x :: l -> PStr (x :: x :: l)
        | l -> PStr l)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Pconst_string (x, None))))
      error

  let attribute_of_warning loc s =
    { loc; txt = "ocaml.ppwarning" },
    PStr ([Str.eval ~loc (Exp.constant (Pconst_string (s, None)))])

  include Locations.Helpers_impl

end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
        [Toploop.print_out_value]
        [Toploop.print_out_type]
        [Toploop.print_out_sig_item]
        [Toploop.print_out_phrase] *)

  type out_ident (*IF_CURRENT = Outcometree.out_ident *) =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of string

  type out_attribute (*IF_CURRENT = Outcometree.out_attribute *) =
    { oattr_name: string }

  type out_value (*IF_CURRENT = Outcometree.out_value *) =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type (*IF_CURRENT = Outcometree.out_type *) =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of string * string list * out_type list
    | Otyp_attribute of out_type * out_attribute

  and out_variant (*IF_CURRENT = Outcometree.out_variant *) =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_typ of out_type

  type out_class_type (*IF_CURRENT = Outcometree.out_class_type *) =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item (*IF_CURRENT = Outcometree.out_class_sig_item *) =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type (*IF_CURRENT = Outcometree.out_module_type *) =
    | Omty_abstract
    | Omty_functor of string * out_module_type option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item (*IF_CURRENT = Outcometree.out_sig_item *) =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of out_val_decl
    | Osig_ellipsis
  and out_type_decl (*IF_CURRENT = Outcometree.out_type_decl *) =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_immediate: bool;
      otype_unboxed: bool;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor (*IF_CURRENT = Outcometree.out_extension_constructor *) =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension (*IF_CURRENT = Outcometree.out_type_extension *) =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_val_decl (*IF_CURRENT = Outcometree.out_val_decl *) =
    { oval_name: string;
      oval_type: out_type;
      oval_prims: string list;
      oval_attributes: out_attribute list }
  and out_rec_status (*IF_CURRENT = Outcometree.out_rec_status *) =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status (*IF_CURRENT = Outcometree.out_ext_status *) =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase (*IF_CURRENT = Outcometree.out_phrase *) =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)

end

module Config = struct
  let ast_impl_magic_number = "Caml1999M020"
  let ast_intf_magic_number = "Caml1999N018"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Ast_406
= struct
#1 "ast_406.ml"
# 1 "src/ast_406.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(* Ast ported on Mon Oct  2 11:25:57 CEST 2017
   OCaml trunk was:
     commit 65940a2c6be43c42f75c6c6b255974f7e6de03ca (HEAD -> 4.06, origin/4.06)
     Author: Christophe Raffalli <christophe@raffalli.eu>
     Date:   Sun Oct 1 18:27:07 2017 +0200

         fixed position of last optional last semicolumn in sequence (#1387)
*)

module Location = Location
module Longident = Longident

module Asttypes = struct
  (** Auxiliary AST types used by parsetree and typedtree. *)

  type constant              = Asttypes.constant    =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag              = Asttypes.rec_flag    = Nonrecursive | Recursive

  type direction_flag              = Asttypes.direction_flag    = Upto | Downto

  (* Order matters, used in polymorphic comparison *)
  type private_flag              = Asttypes.private_flag    = Private | Public

  type mutable_flag              = Asttypes.mutable_flag    = Immutable | Mutable

  type virtual_flag              = Asttypes.virtual_flag    = Virtual | Concrete

  type override_flag              = Asttypes.override_flag    = Override | Fresh

  type closed_flag              = Asttypes.closed_flag    = Closed | Open

  type label = string

  type arg_label              = Asttypes.arg_label    =
      Nolabel
    | Labelled of string (*  label:T -> ... *)
    | Optional of string (* ?label:T -> ... *)

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance              = Asttypes.variance    =
    | Covariant
    | Contravariant
    | Invariant
end

module Parsetree = struct
  (** Abstract syntax tree produced by parsing *)

  open Asttypes

  type constant              = Parsetree.constant    =
      Pconst_integer of string * char option
    (* 3 3l 3L 3n

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes except 'l', 'L' and 'n' are rejected by the typechecker
    *)
    | Pconst_char of char
    (* 'c' *)
    | Pconst_string of string * string option
    (* "constant"
       {delim|other constant|delim}
    *)
    | Pconst_float of string * char option
    (* 3.4 2e5 1.4e-4

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes are rejected by the typechecker.
    *)

  (** {2 Extension points} *)

  type attribute = string loc * payload
         (* [@id ARG]
            [@@id ARG]

            Metadata containers passed around within the AST.
            The compiler ignores unknown attributes.
         *)

  and extension = string loc * payload
        (* [%id ARG]
           [%%id ARG]

           Sub-language placeholder -- rejected by the typechecker.
        *)

  and attributes = attribute list

  and payload              = Parsetree.payload    =
    | PStr of structure
    | PSig of signature (* : SIG *)
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {2 Core language} *)

  (* Type expressions *)

  and core_type              = Parsetree.core_type    =
      {
       ptyp_desc: core_type_desc;
       ptyp_loc: Location.t;
       ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and core_type_desc              = Parsetree.core_type_desc    =
    | Ptyp_any
          (*  _ *)
    | Ptyp_var of string
          (* 'a *)
    | Ptyp_arrow of arg_label * core_type * core_type
          (* T1 -> T2       Simple
             ~l:T1 -> T2    Labelled
             ?l:T1 -> T2    Optional
           *)
    | Ptyp_tuple of core_type list
          (* T1 * ... * Tn

             Invariant: n >= 2
          *)
    | Ptyp_constr of Longident.t loc * core_type list
          (* tconstr
             T tconstr
             (T1, ..., Tn) tconstr
           *)
    | Ptyp_object of object_field list * closed_flag
          (* < l1:T1; ...; ln:Tn >     (flag = Closed)
             < l1:T1; ...; ln:Tn; .. > (flag = Open)
           *)
    | Ptyp_class of Longident.t loc * core_type list
          (* #tconstr
             T #tconstr
             (T1, ..., Tn) #tconstr
           *)
    | Ptyp_alias of core_type * string
          (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
          (* [ `A|`B ]         (flag = Closed; labels = None)
             [> `A|`B ]        (flag = Open;   labels = None)
             [< `A|`B ]        (flag = Closed; labels = Some [])
             [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
           *)
    | Ptyp_poly of string loc list * core_type
          (* 'a1 ... 'an. T

             Can only appear in the following context:

             - As the core_type of a Ppat_constraint node corresponding
               to a constraint on a let-binding: let x : 'a1 ... 'an. T
               = e ...

             - Under Cfk_virtual for methods (not values).

             - As the core_type of a Pctf_method node.

             - As the core_type of a Pexp_poly node.

             - As the pld_type field of a label_declaration.

             - As a core_type of a Ptyp_object node.
           *)

    | Ptyp_package of package_type
          (* (module S) *)
    | Ptyp_extension of extension
          (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
        (*
          (module S)
          (module S with type t1 = T1 and ... and tn = Tn)
         *)

  and row_field              = Parsetree.row_field    =
    | Rtag of label loc * attributes * bool * core_type list
          (* [`A]                   ( true,  [] )
             [`A of T]              ( false, [T] )
             [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
             [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

            - The 2nd field is true if the tag contains a
              constant (empty) constructor.
            - '&' occurs when several types are used for the same constructor
              (see 4.2 in the manual)

            - TODO: switch to a record representation, and keep location
          *)
    | Rinherit of core_type
          (* [ T ] *)

  and object_field              = Parsetree.object_field    =
    | Otag of label loc * attributes * core_type
    | Oinherit of core_type

  (* Patterns *)

  and pattern              = Parsetree.pattern    =
      {
       ppat_desc: pattern_desc;
       ppat_loc: Location.t;
       ppat_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and pattern_desc              = Parsetree.pattern_desc    =
    | Ppat_any
          (* _ *)
    | Ppat_var of string loc
          (* x *)
    | Ppat_alias of pattern * string loc
          (* P as 'a *)
    | Ppat_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
          (* 'a'..'z'

             Other forms of interval are recognized by the parser
             but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
          (* (P1, ..., Pn)

             Invariant: n >= 2
          *)
    | Ppat_construct of Longident.t loc * pattern option
          (* C                None
             C P              Some P
             C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
           *)
    | Ppat_variant of label * pattern option
          (* `A             (None)
             `A P           (Some P)
           *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
          (* { l1=P1; ...; ln=Pn }     (flag = Closed)
             { l1=P1; ...; ln=Pn; _}   (flag = Open)

             Invariant: n > 0
           *)
    | Ppat_array of pattern list
          (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
          (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
          (* (P : T) *)
    | Ppat_type of Longident.t loc
          (* #tconst *)
    | Ppat_lazy of pattern
          (* lazy P *)
    | Ppat_unpack of string loc
          (* (module P)
             Note: (module P : S) is represented as
             Ppat_constraint(Ppat_unpack, Ptyp_package)
           *)
    | Ppat_exception of pattern
          (* exception P *)
    | Ppat_extension of extension
          (* [%id] *)
    | Ppat_open of Longident.t loc * pattern
          (* M.(P) *)

  (* Value expressions *)

  and expression              = Parsetree.expression    =
      {
       pexp_desc: expression_desc;
       pexp_loc: Location.t;
       pexp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and expression_desc              = Parsetree.expression_desc    =
    | Pexp_ident of Longident.t loc
          (* x
             M.x
           *)
    | Pexp_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
          (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
           *)
    | Pexp_function of case list
          (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of arg_label * expression option * pattern * expression
          (* fun P -> E1                          (Simple, None)
             fun ~l:P -> E1                       (Labelled l, None)
             fun ?l:P -> E1                       (Optional l, None)
             fun ?l:(P = E0) -> E1                (Optional l, Some E0)

             Notes:
             - If E0 is provided, only Optional is allowed.
             - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
             - "let f P = E" is represented using Pexp_fun.
           *)
    | Pexp_apply of expression * (arg_label * expression) list
          (* E0 ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pexp_match of expression * case list
          (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * case list
          (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
          (* (E1, ..., En)

             Invariant: n >= 2
          *)
    | Pexp_construct of Longident.t loc * expression option
          (* C                None
             C E              Some E
             C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
          *)
    | Pexp_variant of label * expression option
          (* `A             (None)
             `A E           (Some E)
           *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
          (* { l1=P1; ...; ln=Pn }     (None)
             { E0 with l1=P1; ...; ln=Pn }   (Some E0)

             Invariant: n > 0
           *)
    | Pexp_field of expression * Longident.t loc
          (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
          (* E1.l <- E2 *)
    | Pexp_array of expression list
          (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
          (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
          (* E1; E2 *)
    | Pexp_while of expression * expression
          (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
          (* for i = E1 to E2 do E3 done      (flag = Upto)
             for i = E1 downto E2 do E3 done  (flag = Downto)
           *)
    | Pexp_constraint of expression * core_type
          (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
          (* (E :> T)        (None, T)
             (E : T0 :> T)   (Some T0, T)
           *)
    | Pexp_send of expression * label loc
          (*  E # m *)
    | Pexp_new of Longident.t loc
          (* new M.c *)
    | Pexp_setinstvar of label loc * expression
          (* x <- 2 *)
    | Pexp_override of (label loc * expression) list
          (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string loc * module_expr * expression
          (* let module M = ME in E *)
    | Pexp_letexception of extension_constructor * expression
          (* let exception C in E *)
    | Pexp_assert of expression
          (* assert E
             Note: "assert false" is treated in a special way by the
             type-checker. *)
    | Pexp_lazy of expression
          (* lazy E *)
    | Pexp_poly of expression * core_type option
          (* Used for method bodies.

             Can only be used as the expression under Cfk_concrete
             for methods (not values). *)
    | Pexp_object of class_structure
          (* object ... end *)
    | Pexp_newtype of string loc * expression
          (* fun (type t) -> E *)
    | Pexp_pack of module_expr
          (* (module ME)

             (module ME : S) is represented as
             Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of override_flag * Longident.t loc * expression
          (* M.(E)
             let open M in E
             let! open M in E *)
    | Pexp_extension of extension
          (* [%id] *)
    | Pexp_unreachable
          (* . *)

  and case              = Parsetree.case    =   (* (P -> E) or (P when E0 -> E) *)
      {
       pc_lhs: pattern;
       pc_guard: expression option;
       pc_rhs: expression;
      }

  (* Value descriptions *)

  and value_description              = Parsetree.value_description    =
      {
       pval_name: string loc;
       pval_type: core_type;
       pval_prim: string list;
       pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
       pval_loc: Location.t;
      }

  (*
    val x: T                            (prim = [])
    external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])
  *)

  (* Type declarations *)

  and type_declaration              = Parsetree.type_declaration    =
      {
       ptype_name: string loc;
       ptype_params: (core_type * variance) list;
             (* ('a1,...'an) t; None represents  _*)
       ptype_cstrs: (core_type * core_type * Location.t) list;
             (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
       ptype_kind: type_kind;
       ptype_private: private_flag;   (* = private ... *)
       ptype_manifest: core_type option;  (* = T *)
       ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
       ptype_loc: Location.t;
      }

  (*
    type t                     (abstract, no manifest)
    type t = T0                (abstract, manifest=T0)
    type t = C of T | ...      (variant,  no manifest)
    type t = T0 = C of T | ... (variant,  manifest=T0)
    type t = {l: T; ...}       (record,   no manifest)
    type t = T0 = {l : T; ...} (record,   manifest=T0)
    type t = ..                (open,     no manifest)
  *)

  and type_kind              = Parsetree.type_kind    =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
          (* Invariant: non-empty list *)
    | Ptype_record of label_declaration list
          (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration              = Parsetree.label_declaration    =
      {
       pld_name: string loc;
       pld_mutable: mutable_flag;
       pld_type: core_type;
       pld_loc: Location.t;
       pld_attributes: attributes; (* l : T [@id1] [@id2] *)
      }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration              = Parsetree.constructor_declaration    =
      {
       pcd_name: string loc;
       pcd_args: constructor_arguments;
       pcd_res: core_type option;
       pcd_loc: Location.t;
       pcd_attributes: attributes; (* C of ... [@id1] [@id2] *)
      }

  and constructor_arguments              = Parsetree.constructor_arguments    =
    | Pcstr_tuple of core_type list
    | Pcstr_record of label_declaration list

  (*
    | C of T1 * ... * Tn     (res = None,    args = Pcstr_tuple [])
    | C: T0                  (res = Some T0, args = [])
    | C: T1 * ... * Tn -> T0 (res = Some T0, args = Pcstr_tuple)
    | C of {...}             (res = None,    args = Pcstr_record)
    | C: {...} -> T0         (res = Some T0, args = Pcstr_record)
    | C of {...} as t        (res = None,    args = Pcstr_record)
  *)

  and type_extension              = Parsetree.type_extension    =
      {
       ptyext_path: Longident.t loc;
       ptyext_params: (core_type * variance) list;
       ptyext_constructors: extension_constructor list;
       ptyext_private: private_flag;
       ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      }
  (*
    type t += ...
  *)

  and extension_constructor              = Parsetree.extension_constructor    =
      {
       pext_name: string loc;
       pext_kind : extension_constructor_kind;
       pext_loc : Location.t;
       pext_attributes: attributes; (* C of ... [@id1] [@id2] *)
      }

  and extension_constructor_kind              = Parsetree.extension_constructor_kind    =
      Pext_decl of constructor_arguments * core_type option
        (*
           | C of T1 * ... * Tn     ([T1; ...; Tn], None)
           | C: T0                  ([], Some T0)
           | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
         *)
    | Pext_rebind of Longident.t loc
        (*
           | C = D
         *)

  (** {2 Class language} *)

  (* Type expressions for the class language *)

  and class_type              = Parsetree.class_type    =
      {
       pcty_desc: class_type_desc;
       pcty_loc: Location.t;
       pcty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_type_desc              = Parsetree.class_type_desc    =
    | Pcty_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
          (* object ... end *)
    | Pcty_arrow of arg_label * core_type * class_type
          (* T -> CT       Simple
             ~l:T -> CT    Labelled l
             ?l:T -> CT    Optional l
           *)
    | Pcty_extension of extension
          (* [%id] *)
    | Pcty_open of override_flag * Longident.t loc * class_type
          (* let open M in CT *)


  and class_signature              = Parsetree.class_signature    =
      {
       pcsig_self: core_type;
       pcsig_fields: class_type_field list;
      }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
   *)

  and class_type_field              = Parsetree.class_type_field    =
      {
       pctf_desc: class_type_field_desc;
       pctf_loc: Location.t;
       pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_type_field_desc              = Parsetree.class_type_field_desc    =
    | Pctf_inherit of class_type
          (* inherit CT *)
    | Pctf_val of (label loc * mutable_flag * virtual_flag * core_type)
          (* val x: T *)
    | Pctf_method  of (label loc * private_flag * virtual_flag * core_type)
          (* method x: T

             Note: T can be a Ptyp_poly.
           *)
    | Pctf_constraint  of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
          (* [@@@id] *)
    | Pctf_extension of extension
          (* [%%id] *)

  and 'a class_infos              = 'a Parsetree.class_infos    =
      {
       pci_virt: virtual_flag;
       pci_params: (core_type * variance) list;
       pci_name: string loc;
       pci_expr: 'a;
       pci_loc: Location.t;
       pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr              = Parsetree.class_expr    =
      {
       pcl_desc: class_expr_desc;
       pcl_loc: Location.t;
       pcl_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_expr_desc              = Parsetree.class_expr_desc    =
    | Pcl_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
          (* object ... end *)
    | Pcl_fun of arg_label * expression option * pattern * class_expr
          (* fun P -> CE                          (Simple, None)
             fun ~l:P -> CE                       (Labelled l, None)
             fun ?l:P -> CE                       (Optional l, None)
             fun ?l:(P = E0) -> CE                (Optional l, Some E0)
           *)
    | Pcl_apply of class_expr * (arg_label * expression) list
          (* CE ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pcl_let of rec_flag * value_binding list * class_expr
          (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
           *)
    | Pcl_constraint of class_expr * class_type
          (* (CE : CT) *)
    | Pcl_extension of extension
    (* [%id] *)
    | Pcl_open of override_flag * Longident.t loc * class_expr
    (* let open M in CE *)


  and class_structure              = Parsetree.class_structure    =
      {
       pcstr_self: pattern;
       pcstr_fields: class_field list;
      }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
   *)

  and class_field              = Parsetree.class_field    =
      {
       pcf_desc: class_field_desc;
       pcf_loc: Location.t;
       pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_field_desc              = Parsetree.class_field_desc    =
    | Pcf_inherit of override_flag * class_expr * string loc option
          (* inherit CE
             inherit CE as x
             inherit! CE
             inherit! CE as x
           *)
    | Pcf_val of (label loc * mutable_flag * class_field_kind)
          (* val x = E
             val virtual x: T
           *)
    | Pcf_method of (label loc * private_flag * class_field_kind)
          (* method x = E            (E can be a Pexp_poly)
             method virtual x: T     (T can be a Ptyp_poly)
           *)
    | Pcf_constraint of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pcf_initializer of expression
          (* initializer E *)
    | Pcf_attribute of attribute
          (* [@@@id] *)
    | Pcf_extension of extension
          (* [%%id] *)

  and class_field_kind              = Parsetree.class_field_kind    =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {2 Module language} *)

  (* Type expressions for the module language *)

  and module_type              = Parsetree.module_type    =
      {
       pmty_desc: module_type_desc;
       pmty_loc: Location.t;
       pmty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_type_desc              = Parsetree.module_type_desc    =
    | Pmty_ident of Longident.t loc
          (* S *)
    | Pmty_signature of signature
          (* sig ... end *)
    | Pmty_functor of string loc * module_type option * module_type
          (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
          (* MT with ... *)
    | Pmty_typeof of module_expr
          (* module type of ME *)
    | Pmty_extension of extension
          (* [%id] *)
    | Pmty_alias of Longident.t loc
          (* (module M) *)

  and signature = signature_item list

  and signature_item              = Parsetree.signature_item    =
      {
       psig_desc: signature_item_desc;
       psig_loc: Location.t;
      }

  and signature_item_desc              = Parsetree.signature_item_desc    =
    | Psig_value of value_description
          (*
            val x: T
            external x: T = "s1" ... "sn"
           *)
    | Psig_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Psig_typext of type_extension
          (* type t1 += ... *)
    | Psig_exception of extension_constructor
          (* exception C of T *)
    | Psig_module of module_declaration
          (* module X : MT *)
    | Psig_recmodule of module_declaration list
          (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
          (* module type S = MT
             module type S *)
    | Psig_open of open_description
          (* open X *)
    | Psig_include of include_description
          (* include MT *)
    | Psig_class of class_description list
          (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
          (* [@@@id] *)
    | Psig_extension of extension * attributes
          (* [%%id] *)

  and module_declaration              = Parsetree.module_declaration    =
      {
       pmd_name: string loc;
       pmd_type: module_type;
       pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmd_loc: Location.t;
      }
  (* S : MT *)

  and module_type_declaration              = Parsetree.module_type_declaration    =
      {
       pmtd_name: string loc;
       pmtd_type: module_type option;
       pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmtd_loc: Location.t;
      }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and open_description              = Parsetree.open_description    =
      {
       popen_lid: Longident.t loc;
       popen_override: override_flag;
       popen_loc: Location.t;
       popen_attributes: attributes;
      }
  (* open! X - popen_override = Override (silences the 'used identifier
                                shadowing' warning)
     open  X - popen_override = Fresh
   *)

  and 'a include_infos              = 'a Parsetree.include_infos    =
      {
       pincl_mod: 'a;
       pincl_loc: Location.t;
       pincl_attributes: attributes;
      }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint              = Parsetree.with_constraint    =
    | Pwith_type of Longident.t loc * type_declaration
          (* with type X.t = ...

             Note: the last component of the longident must match
             the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
          (* with module X.Y = Z *)
    | Pwith_typesubst of Longident.t loc * type_declaration
          (* with type X.t := ..., same format as [Pwith_type] *)
    | Pwith_modsubst of Longident.t loc * Longident.t loc
          (* with module X.Y := Z *)

  (* Value expressions for the module language *)

  and module_expr              = Parsetree.module_expr    =
      {
       pmod_desc: module_expr_desc;
       pmod_loc: Location.t;
       pmod_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_expr_desc              = Parsetree.module_expr_desc    =
    | Pmod_ident of Longident.t loc
          (* X *)
    | Pmod_structure of structure
          (* struct ... end *)
    | Pmod_functor of string loc * module_type option * module_expr
          (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
          (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
          (* (ME : MT) *)
    | Pmod_unpack of expression
          (* (val E) *)
    | Pmod_extension of extension
          (* [%id] *)

  and structure = structure_item list

  and structure_item              = Parsetree.structure_item    =
      {
       pstr_desc: structure_item_desc;
       pstr_loc: Location.t;
      }

  and structure_item_desc              = Parsetree.structure_item_desc    =
    | Pstr_eval of expression * attributes
          (* E *)
    | Pstr_value of rec_flag * value_binding list
          (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
           *)
    | Pstr_primitive of value_description
          (*  val x: T
              external x: T = "s1" ... "sn" *)
    | Pstr_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
          (* type t1 += ... *)
    | Pstr_exception of extension_constructor
          (* exception C of T
             exception C = M.X *)
    | Pstr_module of module_binding
          (* module X = ME *)
    | Pstr_recmodule of module_binding list
          (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
          (* module type S = MT *)
    | Pstr_open of open_description
          (* open X *)
    | Pstr_class of class_declaration list
          (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
          (* include ME *)
    | Pstr_attribute of attribute
          (* [@@@id] *)
    | Pstr_extension of extension * attributes
          (* [%%id] *)

  and value_binding              = Parsetree.value_binding    =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding              = Parsetree.module_binding    =
      {
       pmb_name: string loc;
       pmb_expr: module_expr;
       pmb_attributes: attributes;
       pmb_loc: Location.t;
      }
  (* X = ME *)

  (** {2 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase              = Parsetree.toplevel_phrase    =
    | Ptop_def of structure
    | Ptop_dir of string * directive_argument
       (* #use, #load ... *)

  and directive_argument              = Parsetree.directive_argument    =
    | Pdir_none
    | Pdir_string of string
    | Pdir_int of string * char option
    | Pdir_ident of Longident.t
    | Pdir_bool of bool

end

module Docstrings : sig
  (** {3 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {3 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** {3 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

end = struct
  open Location

  (* Docstrings *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t;
    }

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc;
      }
    in
    ds

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (doc_loc, PStr [item])

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (text_loc, PStr [item])

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""; _} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

end

module Ast_helper : sig

  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Docstrings
  open Parsetree

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  (** {2 Default locations} *)

  val default_loc: loc ref
      (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
      (** Set the [default_loc] within the scope of the execution
          of the provided function. *)

  (** {2 Constants} *)

  module Const : sig
    val char : char -> constant
    val string : ?quotation_delimiter:string -> string -> constant
    val integer : ?suffix:char -> string -> constant
    val int : ?suffix:char -> int -> constant
    val int32 : ?suffix:char -> int32 -> constant
    val int64 : ?suffix:char -> int64 -> constant
    val nativeint : ?suffix:char -> nativeint -> constant
    val float : ?suffix:char -> string -> constant
  end

  (** {2 Core language} *)

  (** Type expressions *)
  module Typ :
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
      val attr: core_type -> attribute -> core_type

      val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
      val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type -> core_type
                 -> core_type
      val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val object_: ?loc:loc -> ?attrs:attrs -> object_field list
                     -> closed_flag -> core_type
      val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
      val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
                   -> label list option -> core_type
      val poly: ?loc:loc -> ?attrs:attrs -> str list -> core_type -> core_type
      val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
                   -> core_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

      val force_poly: core_type -> core_type

      val varify_constructors: str list -> core_type -> core_type
      (** [varify_constructors newtypes te] is type expression [te], of which
          any of nullary type constructor [tc] is replaced by type variable of
          the same name, if [tc]'s name appears in [newtypes].
          Raise [Syntaxerr.Variable_in_scope] if any type variable inside [te]
          appears in [newtypes].
          @since 4.05
       *)
    end

  (** Patterns *)
  module Pat:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
      val attr:pattern -> attribute -> pattern

      val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
      val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
      val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
      val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
      val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
      val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
                  -> pattern
      val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
      val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
      val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
      val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val open_: ?loc:loc -> ?attrs:attrs  -> lid -> pattern -> pattern
      val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
    end

  (** Expressions *)
  module Exp:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
      val attr: expression -> attribute -> expression

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
                -> expression -> expression
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option
                -> pattern -> expression -> expression
      val function_: ?loc:loc -> ?attrs:attrs -> case list -> expression
      val apply: ?loc:loc -> ?attrs:attrs -> expression
                 -> (arg_label * expression) list -> expression
      val match_: ?loc:loc -> ?attrs:attrs -> expression -> case list
                  -> expression
      val try_: ?loc:loc -> ?attrs:attrs -> expression -> case list -> expression
      val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
                     -> expression
      val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
                   -> expression
      val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
                  -> expression option -> expression
      val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
                    -> expression
      val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
                      -> expression option -> expression
      val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
                    -> expression
      val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
                  -> expression
      val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
                -> direction_flag -> expression -> expression
      val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                  -> core_type -> expression
      val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
                       -> expression
      val send: ?loc:loc -> ?attrs:attrs -> expression -> str -> expression
      val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
                    -> expression
      val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
                     -> expression
      val letexception:
        ?loc:loc -> ?attrs:attrs -> extension_constructor -> expression
        -> expression
      val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                -> expression
      val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
      val newtype: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> expression
                 -> expression
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression
      val unreachable: ?loc:loc -> ?attrs:attrs -> unit -> expression

      val case: pattern -> ?guard:expression -> expression -> case
    end

  (** Value declarations *)
  module Val:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        ?prim:string list -> str -> core_type -> value_description
    end

  (** Type declarations *)
  module Type:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?params:(core_type * variance) list ->
        ?cstrs:(core_type * core_type * loc) list ->
        ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
        type_declaration

      val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        constructor_declaration
      val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?mut:mutable_flag -> str -> core_type -> label_declaration
    end

  (** Type extensions *)
  module Te:
    sig
      val mk: ?attrs:attrs -> ?docs:docs ->
        ?params:(core_type * variance) list -> ?priv:private_flag ->
        lid -> extension_constructor list -> type_extension

      val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> extension_constructor_kind -> extension_constructor

      val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        extension_constructor
      val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> lid -> extension_constructor
    end

  (** {2 Module language} *)

  (** Module type expressions *)
  module Mty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
      val attr: module_type -> attribute -> module_type

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_type -> module_type
      val with_: ?loc:loc -> ?attrs:attrs -> module_type ->
        with_constraint list -> module_type
      val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
    end

  (** Module expressions *)
  module Mod:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
      val attr: module_expr -> attribute -> module_expr

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
      val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_expr -> module_expr
      val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr ->
        module_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type ->
        module_expr
      val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
    end

  (** Signature items *)
  module Sig:
    sig
      val mk: ?loc:loc -> signature_item_desc -> signature_item

      val value: ?loc:loc -> value_description -> signature_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item
      val type_extension: ?loc:loc -> type_extension -> signature_item
      val exception_: ?loc:loc -> extension_constructor -> signature_item
      val module_: ?loc:loc -> module_declaration -> signature_item
      val rec_module: ?loc:loc -> module_declaration list -> signature_item
      val modtype: ?loc:loc -> module_type_declaration -> signature_item
      val open_: ?loc:loc -> open_description -> signature_item
      val include_: ?loc:loc -> include_description -> signature_item
      val class_: ?loc:loc -> class_description list -> signature_item
      val class_type: ?loc:loc -> class_type_declaration list -> signature_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
      val attribute: ?loc:loc -> attribute -> signature_item
      val text: text -> signature_item list
    end

  (** Structure items *)
  module Str:
    sig
      val mk: ?loc:loc -> structure_item_desc -> structure_item

      val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
      val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
      val primitive: ?loc:loc -> value_description -> structure_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item
      val type_extension: ?loc:loc -> type_extension -> structure_item
      val exception_: ?loc:loc -> extension_constructor -> structure_item
      val module_: ?loc:loc -> module_binding -> structure_item
      val rec_module: ?loc:loc -> module_binding list -> structure_item
      val modtype: ?loc:loc -> module_type_declaration -> structure_item
      val open_: ?loc:loc -> open_description -> structure_item
      val class_: ?loc:loc -> class_declaration list -> structure_item
      val class_type: ?loc:loc -> class_type_declaration list -> structure_item
      val include_: ?loc:loc -> include_declaration -> structure_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
      val attribute: ?loc:loc -> attribute -> structure_item
      val text: text -> structure_item list
    end

  (** Module declarations *)
  module Md:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_type -> module_declaration
    end

  (** Module type declarations *)
  module Mtd:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?typ:module_type -> str -> module_type_declaration
    end

  (** Module bindings *)
  module Mb:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_expr -> module_binding
    end

  (** Opens *)
  module Opn:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
        ?override:override_flag -> lid -> open_description
    end

  (** Includes *)
  module Incl:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
    end

  (** Value bindings *)
  module Vb:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        pattern -> expression -> value_binding
    end


  (** {2 Class language} *)

  (** Class type expressions *)
  module Cty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
      val attr: class_type -> attribute -> class_type

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
      val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type ->
        class_type -> class_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> class_type
                 -> class_type
    end

  (** Class type fields *)
  module Ctf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        class_type_field_desc -> class_type_field
      val attr: class_type_field -> attribute -> class_type_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
        virtual_flag -> core_type -> class_type_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
        virtual_flag -> core_type -> class_type_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_type_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
      val attribute: ?loc:loc -> attribute -> class_type_field
      val text: text -> class_type_field list
    end

  (** Class expressions *)
  module Cl:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
      val attr: class_expr -> attribute -> class_expr

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
      val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option ->
        pattern -> class_expr -> class_expr
      val apply: ?loc:loc -> ?attrs:attrs -> class_expr ->
        (arg_label * expression) list -> class_expr
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list ->
        class_expr -> class_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type ->
        class_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> class_expr
                 -> class_expr
    end

  (** Class fields *)
  module Cf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
        class_field
      val attr: class_field -> attribute -> class_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr ->
        str option -> class_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
        class_field_kind -> class_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
        class_field_kind -> class_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_field
      val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
      val attribute: ?loc:loc -> attribute -> class_field
      val text: text -> class_field list

      val virtual_: core_type -> class_field_kind
      val concrete: override_flag -> expression -> class_field_kind

    end

  (** Classes *)
  module Ci:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?virt:virtual_flag -> ?params:(core_type * variance) list ->
        str -> 'a -> 'a class_infos
    end

  (** Class signatures *)
  module Csig:
    sig
      val mk: core_type -> class_type_field list -> class_signature
    end

  (** Class structures *)
  module Cstr:
    sig
      val mk: pattern -> class_field list -> class_structure
    end

end = struct
  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Parsetree
  open Docstrings

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    let old = !default_loc in
    default_loc := l;
    try let r = f () in default_loc := old; r
    with exn -> default_loc := old; raise exn

  module Const = struct
    let integer ?suffix i = Pconst_integer (i, suffix)
    let int ?suffix i = integer ?suffix (string_of_int i)
    let int32 ?(suffix='l') i = integer ~suffix (Int32.to_string i)
    let int64 ?(suffix='L') i = integer ~suffix (Int64.to_string i)
    let nativeint ?(suffix='n') i = integer ~suffix (Nativeint.to_string i)
    let float ?suffix f = Pconst_float (f, suffix)
    let char c = Pconst_char c
    let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter)
  end

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs}
    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)

    let varify_constructors var_names t =
      let check_variable vl loc v =
        if List.mem v vl then
          raise Syntaxerr.(Error(Variable_in_scope(loc,v))) in
      let var_names = List.map (fun v -> v.txt) var_names in
      let rec loop t =
        let desc =
          match t.ptyp_desc with
          | Ptyp_any -> Ptyp_any
          | Ptyp_var x ->
              check_variable var_names t.ptyp_loc x;
              Ptyp_var x
          | Ptyp_arrow (label,core_type,core_type') ->
              Ptyp_arrow(label, loop core_type, loop core_type')
          | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
          | Ptyp_constr( { txt = Longident.Lident s; _ }, [])
            when List.mem s var_names ->
              Ptyp_var s
          | Ptyp_constr(longident, lst) ->
              Ptyp_constr(longident, List.map loop lst)
          | Ptyp_object (lst, o) ->
              Ptyp_object (List.map loop_object_field lst, o)
          | Ptyp_class (longident, lst) ->
              Ptyp_class (longident, List.map loop lst)
          | Ptyp_alias(core_type, string) ->
              check_variable var_names t.ptyp_loc string;
              Ptyp_alias(loop core_type, string)
          | Ptyp_variant(row_field_list, flag, lbl_lst_option) ->
              Ptyp_variant(List.map loop_row_field row_field_list,
                           flag, lbl_lst_option)
          | Ptyp_poly(string_lst, core_type) ->
            List.iter (fun v ->
              check_variable var_names t.ptyp_loc v.txt) string_lst;
              Ptyp_poly(string_lst, loop core_type)
          | Ptyp_package(longident,lst) ->
              Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
          | Ptyp_extension (s, arg) ->
              Ptyp_extension (s, arg)
        in
        {t with ptyp_desc = desc}
      and loop_row_field  =
        function
          | Rtag(label,attrs,flag,lst) ->
              Rtag(label,attrs,flag,List.map loop lst)
          | Rinherit t ->
              Rinherit (loop t)
      and loop_object_field =
        function
          | Otag(label, attrs, t) ->
              Otag(label, attrs, loop t)
          | Oinherit t ->
              Oinherit (loop t)
      in
      loop t

  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d; ppat_loc = loc; ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b))
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d; pexp_loc = loc; pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let letexception ?loc ?attrs a b = mk ?loc ?attrs (Pexp_letexception (a, b))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_open (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)
    let unreachable ?loc ?attrs () = mk ?loc ?attrs Pexp_unreachable

    let case lhs ?guard rhs =
      {
       pc_lhs = lhs;
       pc_guard = guard;
       pc_rhs = rhs;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg arg_ty body =
      mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc rec_flag a = mk ?loc (Psig_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcl_desc = d;
       pcl_loc = loc;
       pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_open (a, b, c))
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcty_desc = d;
       pcty_loc = loc;
       pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_open (a, b, c))
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
             ?(docs = empty_docs) d =
      {
       pctf_desc = d;
       pctf_loc = loc;
       pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
     let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
       List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
       pcf_desc = d;
       pcf_loc = loc;
       pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(prim = []) name typ =
      {
       pval_name = name;
       pval_type = typ;
       pval_attributes = add_docs_attrs docs attrs;
       pval_loc = loc;
       pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name typ =
      {
       pmd_name = name;
       pmd_type = typ;
       pmd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmd_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) ?typ name =
      {
       pmtd_name = name;
       pmtd_type = typ;
       pmtd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name expr =
      {
       pmb_name = name;
       pmb_expr = expr;
       pmb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(override = Fresh) lid =
      {
       popen_lid = lid;
       popen_override = override;
       popen_loc = loc;
       popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
       pincl_mod = mexpr;
       pincl_loc = loc;
       pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(text = []) pat expr =
      {
       pvb_pat = pat;
       pvb_expr = expr;
       pvb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(virt = Concrete) ?(params = []) name expr =
      {
       pci_virt = virt;
       pci_params = params;
       pci_name = name;
       pci_expr = expr;
       pci_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
        ?(params = [])
        ?(cstrs = [])
        ?(kind = Ptype_abstract)
        ?(priv = Public)
        ?manifest
        name =
      {
       ptype_name = name;
       ptype_params = params;
       ptype_cstrs = cstrs;
       ptype_kind = kind;
       ptype_private = priv;
       ptype_manifest = manifest;
       ptype_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(args = Pcstr_tuple []) ?res name =
      {
       pcd_name = name;
       pcd_args = args;
       pcd_res = res;
       pcd_loc = loc;
       pcd_attributes = add_info_attrs info attrs;
      }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(mut = Immutable) name typ =
      {
       pld_name = name;
       pld_mutable = mut;
       pld_type = typ;
       pld_loc = loc;
       pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(attrs = []) ?(docs = empty_docs)
          ?(params = []) ?(priv = Public) path constructors =
      {
       ptyext_path = path;
       ptyext_params = params;
       ptyext_constructors = constructors;
       ptyext_private = priv;
       ptyext_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
       pext_name = name;
       pext_kind = kind;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
               ?(info = empty_info) ?(args = Pcstr_tuple []) ?res name =
      {
       pext_name = name;
       pext_kind = Pext_decl(args, res);
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
       pext_name = name;
       pext_kind = Pext_rebind lid;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
       pcsig_self = self;
       pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
       pcstr_self = self;
       pcstr_fields = fields;
      }
  end

end

module Ast_mapper : sig
  (** The interface of a -ppx rewriter

    A -ppx rewriter is a program that accepts a serialized abstract syntax
    tree and outputs another, possibly modified, abstract syntax tree.
    This module encapsulates the interface between the compiler and
    the -ppx rewriters, handling such details as the serialization format,
    forwarding of command-line flags, and storing state.

    {!mapper} allows to implement AST rewriting using open recursion.
    A typical mapper would be based on {!default_mapper}, a deep
    identity mapper, and will fall back on it for handling the syntax it
    does not modify. For example:

    {[
  open Asttypes
  open Parsetree
  open Ast_mapper

  let test_mapper argv =
    { default_mapper with
      expr = fun mapper expr ->
        match expr with
        | { pexp_desc = Pexp_extension ({ txt = "test" }, PStr [])} ->
          Ast_helper.Exp.constant (Const_int 42)
        | other -> default_mapper.expr mapper other; }

  let () =
    register "ppx_test" test_mapper]}

    This -ppx rewriter, which replaces [[%test]] in expressions with
    the constant [42], can be compiled using
    [ocamlc -o ppx_test -I +compiler-libs ocamlcommon.cma ppx_test.ml].

    *)

  open Parsetree

  (** {2 A generic Parsetree mapper} *)

  type mapper              = Ast_mapper.mapper   = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {2 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

  include Locations.Helpers_intf

end = struct
  (* A generic Parsetree mapping class *)

  (*
  [@@@ocaml.warning "+9"]
    (* Ensure that record patterns don't miss any field. *)
  *)


  open Parsetree
  open Ast_helper
  open Location

  type mapper              = Ast_mapper.mapper   = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub = function
      | Rtag (l, attrs, b, tl) ->
          Rtag (map_loc sub l, sub.attributes sub attrs,
                b, List.map (sub.typ sub) tl)
      | Rinherit t -> Rinherit (sub.typ sub t)

    let object_field sub = function
      | Otag (l, attrs, t) ->
          Otag (map_loc sub l, sub.attributes sub attrs, sub.typ sub t)
      | Oinherit t -> Oinherit (sub.typ sub t)

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
          arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
          object_ ~loc ~attrs (List.map (object_field sub) l) o
      | Ptyp_class (lid, tl) ->
          class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
          variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs
                               (List.map (map_loc sub) sl) (sub.typ sub t)
      | Ptyp_package (lid, l) ->
          package ~loc ~attrs (map_loc sub lid)
            (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
        {ptype_name; ptype_params; ptype_cstrs;
         ptype_kind;
         ptype_private;
         ptype_manifest;
         ptype_attributes;
         ptype_loc} =
      Type.mk (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)
        ~loc:(sub.location sub ptype_loc)
        ~attrs:(sub.attributes sub ptype_attributes)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
          Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_constructor_arguments sub = function
      | Pcstr_tuple l -> Pcstr_tuple (List.map (sub.typ sub) l)
      | Pcstr_record l ->
          Pcstr_record (List.map (sub.label_declaration sub) l)

    let map_type_extension sub
        {ptyext_path; ptyext_params;
         ptyext_constructors;
         ptyext_private;
         ptyext_attributes} =
      Te.mk
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private
        ~attrs:(sub.attributes sub ptyext_attributes)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
          Pext_decl(map_constructor_arguments sub ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
          Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
        {pext_name;
         pext_kind;
         pext_loc;
         pext_attributes} =
      Te.constructor
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)
        ~loc:(sub.location sub pext_loc)
        ~attrs:(sub.attributes sub pext_attributes)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
          arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcty_open (ovf, lid, ct) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.class_type sub ct)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) ->
          val_ ~loc ~attrs (map_loc sub s) m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) ->
          method_ ~loc ~attrs (map_loc sub s) p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (s, mt1, mt2) ->
          functor_ ~loc ~attrs (map_loc sub s)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) mt1)
            (sub.module_type sub mt2)
      | Pmty_with (mt, l) ->
          with_ ~loc ~attrs (sub.module_type sub mt)
            (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
          Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
          Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst (lid, d) ->
          Pwith_typesubst (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
          Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_recmodule l ->
          rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (arg, arg_ty, body) ->
          functor_ ~loc ~attrs (map_loc sub arg)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) arg_ty)
            (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
          apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
          constraint_ ~loc ~attrs (sub.module_expr sub m)
                      (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
          eval ~loc ~attrs:(sub.attributes sub attrs) (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_description sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
          fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
            (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
          apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
          match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
          construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
          variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
          record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
            (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
          field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
          setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
            (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
          ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
            (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
          sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
          while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
          for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
            (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
          coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
            (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
          constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) ->
          send ~loc ~attrs (sub.expr sub e) (map_loc sub s)
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
          setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
          override ~loc ~attrs
            (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
          letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
            (sub.expr sub e)
      | Pexp_letexception (cd, e) ->
          letexception ~loc ~attrs
            (sub.extension_constructor sub cd)
            (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
          poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) ->
          newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (ovf, lid, e) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.expr sub e)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pexp_unreachable -> unreachable ~loc ~attrs ()
  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
          construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
          record ~loc ~attrs
                 (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
          constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
          structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
          fun_ ~loc ~attrs lab
            (map_opt (sub.expr sub) e)
            (sub.pat sub p)
            (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
          apply ~loc ~attrs (sub.class_expr sub ce)
            (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
          constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcl_open (ovf, lid, ce) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.class_expr sub ce)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) ->
          inherit_ ~loc ~attrs o (sub.class_expr sub ce)
            (map_opt (map_loc sub) s)
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
          method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      Ci.mk
       ~virt:pci_virt
       ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
        ~loc:(sub.location sub pci_loc)
        ~attrs:(sub.attributes sub pci_attributes)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_description =
        (fun this {popen_lid; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_lid)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );


      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
          Type.constructor
            (map_loc this pcd_name)
            ~args:(T.map_constructor_arguments this pcd_args)
            ?res:(map_opt (this.typ this) pcd_res)
            ~loc:(this.location this pcd_loc)
            ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PSig x -> PSig (this.signature this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(function
        | x :: l -> PStr (x :: x :: l)
        | l -> PStr l)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Pconst_string (x, None))))
      error

  let attribute_of_warning loc s =
    { loc; txt = "ocaml.ppwarning" },
    PStr ([Str.eval ~loc (Exp.constant (Pconst_string (s, None)))])

  include Locations.Helpers_impl

end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
        [Toploop.print_out_value]
        [Toploop.print_out_type]
        [Toploop.print_out_sig_item]
        [Toploop.print_out_phrase] *)

  type out_ident              = Outcometree.out_ident    =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of string

  type out_string              = Outcometree.out_string    =
    | Ostr_string
    | Ostr_bytes

  type out_attribute              = Outcometree.out_attribute    =
    { oattr_name: string }

  type out_value              = Outcometree.out_value    =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string * int * out_string (* string, size-to-print, kind *)
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type              = Outcometree.out_type    =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of string * string list * out_type list
    | Otyp_attribute of out_type * out_attribute

  and out_variant              = Outcometree.out_variant    =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_typ of out_type

  type out_class_type              = Outcometree.out_class_type    =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item              = Outcometree.out_class_sig_item    =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type              = Outcometree.out_module_type    =
    | Omty_abstract
    | Omty_functor of string * out_module_type option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item              = Outcometree.out_sig_item    =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of out_val_decl
    | Osig_ellipsis
  and out_type_decl              = Outcometree.out_type_decl    =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_immediate: bool;
      otype_unboxed: bool;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor              = Outcometree.out_extension_constructor    =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension              = Outcometree.out_type_extension    =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_val_decl              = Outcometree.out_val_decl    =
    { oval_name: string;
      oval_type: out_type;
      oval_prims: string list;
      oval_attributes: out_attribute list }
  and out_rec_status              = Outcometree.out_rec_status    =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status              = Outcometree.out_ext_status    =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase              = Outcometree.out_phrase    =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)

end

module Config = struct
  let ast_impl_magic_number = "Caml1999M022"
  let ast_intf_magic_number = "Caml1999N022"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Ast_407
= struct
#1 "ast_407.ml"
# 1 "src/ast_407.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                         Frédéric Bour, Facebook                        *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2018 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(* Ast ported on Wed Apr 18 10:33:29 BST 2018
   OCaml trunk was:
     commit c0bd6a27e138911560f43dc75d5fde2ade4d6cfe (HEAD, tag: 4.07.0+beta2)
     Author: Damien Doligez <damien.doligez@inria.fr>
     Date:   Tue Apr 10 14:50:48 2018 +0200

         change VERSION for 4.07.0+beta2
*)

module Location = Location
module Longident = Longident


module Asttypes = struct
  (** Auxiliary AST types used by parsetree and typedtree. *)

  type constant (*IF_CURRENT = Asttypes.constant *) =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag (*IF_CURRENT = Asttypes.rec_flag *) = Nonrecursive | Recursive

  type direction_flag (*IF_CURRENT = Asttypes.direction_flag *) = Upto | Downto

  (* Order matters, used in polymorphic comparison *)
  type private_flag (*IF_CURRENT = Asttypes.private_flag *) = Private | Public

  type mutable_flag (*IF_CURRENT = Asttypes.mutable_flag *) = Immutable | Mutable

  type virtual_flag (*IF_CURRENT = Asttypes.virtual_flag *) = Virtual | Concrete

  type override_flag (*IF_CURRENT = Asttypes.override_flag *) = Override | Fresh

  type closed_flag (*IF_CURRENT = Asttypes.closed_flag *) = Closed | Open

  type label = string

  type arg_label (*IF_CURRENT = Asttypes.arg_label *) =
      Nolabel
    | Labelled of string (*  label:T -> ... *)
    | Optional of string (* ?label:T -> ... *)

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance (*IF_CURRENT = Asttypes.variance *) =
    | Covariant
    | Contravariant
    | Invariant
end

module Parsetree = struct
  (** Abstract syntax tree produced by parsing *)

  open Asttypes

  type constant (*IF_CURRENT = Parsetree.constant *) =
      Pconst_integer of string * char option
    (* 3 3l 3L 3n

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes except 'l', 'L' and 'n' are rejected by the typechecker
    *)
    | Pconst_char of char
    (* 'c' *)
    | Pconst_string of string * string option
    (* "constant"
       {delim|other constant|delim}
    *)
    | Pconst_float of string * char option
    (* 3.4 2e5 1.4e-4

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes are rejected by the typechecker.
    *)

  (** {1 Extension points} *)

  type attribute = string loc * payload
         (* [@id ARG]
            [@@id ARG]

            Metadata containers passed around within the AST.
            The compiler ignores unknown attributes.
         *)

  and extension = string loc * payload
        (* [%id ARG]
           [%%id ARG]

           Sub-language placeholder -- rejected by the typechecker.
        *)

  and attributes = attribute list

  and payload (*IF_CURRENT = Parsetree.payload *) =
    | PStr of structure
    | PSig of signature (* : SIG *)
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {1 Core language} *)

  (* Type expressions *)

  and core_type (*IF_CURRENT = Parsetree.core_type *) =
      {
       ptyp_desc: core_type_desc;
       ptyp_loc: Location.t;
       ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and core_type_desc (*IF_CURRENT = Parsetree.core_type_desc *) =
    | Ptyp_any
          (*  _ *)
    | Ptyp_var of string
          (* 'a *)
    | Ptyp_arrow of arg_label * core_type * core_type
          (* T1 -> T2       Simple
             ~l:T1 -> T2    Labelled
             ?l:T1 -> T2    Optional
           *)
    | Ptyp_tuple of core_type list
          (* T1 * ... * Tn

             Invariant: n >= 2
          *)
    | Ptyp_constr of Longident.t loc * core_type list
          (* tconstr
             T tconstr
             (T1, ..., Tn) tconstr
           *)
    | Ptyp_object of object_field list * closed_flag
          (* < l1:T1; ...; ln:Tn >     (flag = Closed)
             < l1:T1; ...; ln:Tn; .. > (flag = Open)
           *)
    | Ptyp_class of Longident.t loc * core_type list
          (* #tconstr
             T #tconstr
             (T1, ..., Tn) #tconstr
           *)
    | Ptyp_alias of core_type * string
          (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
          (* [ `A|`B ]         (flag = Closed; labels = None)
             [> `A|`B ]        (flag = Open;   labels = None)
             [< `A|`B ]        (flag = Closed; labels = Some [])
             [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
           *)
    | Ptyp_poly of string loc list * core_type
          (* 'a1 ... 'an. T

             Can only appear in the following context:

             - As the core_type of a Ppat_constraint node corresponding
               to a constraint on a let-binding: let x : 'a1 ... 'an. T
               = e ...

             - Under Cfk_virtual for methods (not values).

             - As the core_type of a Pctf_method node.

             - As the core_type of a Pexp_poly node.

             - As the pld_type field of a label_declaration.

             - As a core_type of a Ptyp_object node.
           *)

    | Ptyp_package of package_type
          (* (module S) *)
    | Ptyp_extension of extension
          (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
        (*
          (module S)
          (module S with type t1 = T1 and ... and tn = Tn)
         *)

  and row_field (*IF_CURRENT = Parsetree.row_field *) =
    | Rtag of label loc * attributes * bool * core_type list
          (* [`A]                   ( true,  [] )
             [`A of T]              ( false, [T] )
             [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
             [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

            - The 2nd field is true if the tag contains a
              constant (empty) constructor.
            - '&' occurs when several types are used for the same constructor
              (see 4.2 in the manual)

            - TODO: switch to a record representation, and keep location
          *)
    | Rinherit of core_type
          (* [ T ] *)

  and object_field (*IF_CURRENT = Parsetree.object_field *) =
    | Otag of label loc * attributes * core_type
    | Oinherit of core_type

  (* Patterns *)

  and pattern (*IF_CURRENT = Parsetree.pattern *) =
      {
       ppat_desc: pattern_desc;
       ppat_loc: Location.t;
       ppat_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and pattern_desc (*IF_CURRENT = Parsetree.pattern_desc *) =
    | Ppat_any
          (* _ *)
    | Ppat_var of string loc
          (* x *)
    | Ppat_alias of pattern * string loc
          (* P as 'a *)
    | Ppat_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
          (* 'a'..'z'

             Other forms of interval are recognized by the parser
             but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
          (* (P1, ..., Pn)

             Invariant: n >= 2
          *)
    | Ppat_construct of Longident.t loc * pattern option
          (* C                None
             C P              Some P
             C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
           *)
    | Ppat_variant of label * pattern option
          (* `A             (None)
             `A P           (Some P)
           *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
          (* { l1=P1; ...; ln=Pn }     (flag = Closed)
             { l1=P1; ...; ln=Pn; _}   (flag = Open)

             Invariant: n > 0
           *)
    | Ppat_array of pattern list
          (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
          (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
          (* (P : T) *)
    | Ppat_type of Longident.t loc
          (* #tconst *)
    | Ppat_lazy of pattern
          (* lazy P *)
    | Ppat_unpack of string loc
          (* (module P)
             Note: (module P : S) is represented as
             Ppat_constraint(Ppat_unpack, Ptyp_package)
           *)
    | Ppat_exception of pattern
          (* exception P *)
    | Ppat_extension of extension
          (* [%id] *)
    | Ppat_open of Longident.t loc * pattern
          (* M.(P) *)

  (* Value expressions *)

  and expression (*IF_CURRENT = Parsetree.expression *) =
      {
       pexp_desc: expression_desc;
       pexp_loc: Location.t;
       pexp_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and expression_desc (*IF_CURRENT = Parsetree.expression_desc *) =
    | Pexp_ident of Longident.t loc
          (* x
             M.x
           *)
    | Pexp_constant of constant
          (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
          (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
           *)
    | Pexp_function of case list
          (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of arg_label * expression option * pattern * expression
          (* fun P -> E1                          (Simple, None)
             fun ~l:P -> E1                       (Labelled l, None)
             fun ?l:P -> E1                       (Optional l, None)
             fun ?l:(P = E0) -> E1                (Optional l, Some E0)

             Notes:
             - If E0 is provided, only Optional is allowed.
             - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
             - "let f P = E" is represented using Pexp_fun.
           *)
    | Pexp_apply of expression * (arg_label * expression) list
          (* E0 ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pexp_match of expression * case list
          (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * case list
          (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
          (* (E1, ..., En)

             Invariant: n >= 2
          *)
    | Pexp_construct of Longident.t loc * expression option
          (* C                None
             C E              Some E
             C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
          *)
    | Pexp_variant of label * expression option
          (* `A             (None)
             `A E           (Some E)
           *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
          (* { l1=P1; ...; ln=Pn }     (None)
             { E0 with l1=P1; ...; ln=Pn }   (Some E0)

             Invariant: n > 0
           *)
    | Pexp_field of expression * Longident.t loc
          (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
          (* E1.l <- E2 *)
    | Pexp_array of expression list
          (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
          (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
          (* E1; E2 *)
    | Pexp_while of expression * expression
          (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
          (* for i = E1 to E2 do E3 done      (flag = Upto)
             for i = E1 downto E2 do E3 done  (flag = Downto)
           *)
    | Pexp_constraint of expression * core_type
          (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
          (* (E :> T)        (None, T)
             (E : T0 :> T)   (Some T0, T)
           *)
    | Pexp_send of expression * label loc
          (*  E # m *)
    | Pexp_new of Longident.t loc
          (* new M.c *)
    | Pexp_setinstvar of label loc * expression
          (* x <- 2 *)
    | Pexp_override of (label loc * expression) list
          (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string loc * module_expr * expression
          (* let module M = ME in E *)
    | Pexp_letexception of extension_constructor * expression
          (* let exception C in E *)
    | Pexp_assert of expression
          (* assert E
             Note: "assert false" is treated in a special way by the
             type-checker. *)
    | Pexp_lazy of expression
          (* lazy E *)
    | Pexp_poly of expression * core_type option
          (* Used for method bodies.

             Can only be used as the expression under Cfk_concrete
             for methods (not values). *)
    | Pexp_object of class_structure
          (* object ... end *)
    | Pexp_newtype of string loc * expression
          (* fun (type t) -> E *)
    | Pexp_pack of module_expr
          (* (module ME)

             (module ME : S) is represented as
             Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of override_flag * Longident.t loc * expression
          (* M.(E)
             let open M in E
             let! open M in E *)
    | Pexp_extension of extension
          (* [%id] *)
    | Pexp_unreachable
          (* . *)

  and case (*IF_CURRENT = Parsetree.case *) =   (* (P -> E) or (P when E0 -> E) *)
      {
       pc_lhs: pattern;
       pc_guard: expression option;
       pc_rhs: expression;
      }

  (* Value descriptions *)

  and value_description (*IF_CURRENT = Parsetree.value_description *) =
      {
       pval_name: string loc;
       pval_type: core_type;
       pval_prim: string list;
       pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
       pval_loc: Location.t;
      }

  (*
    val x: T                            (prim = [])
    external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])
  *)

  (* Type declarations *)

  and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
      {
       ptype_name: string loc;
       ptype_params: (core_type * variance) list;
             (* ('a1,...'an) t; None represents  _*)
       ptype_cstrs: (core_type * core_type * Location.t) list;
             (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
       ptype_kind: type_kind;
       ptype_private: private_flag;   (* = private ... *)
       ptype_manifest: core_type option;  (* = T *)
       ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
       ptype_loc: Location.t;
      }

  (*
    type t                     (abstract, no manifest)
    type t = T0                (abstract, manifest=T0)
    type t = C of T | ...      (variant,  no manifest)
    type t = T0 = C of T | ... (variant,  manifest=T0)
    type t = {l: T; ...}       (record,   no manifest)
    type t = T0 = {l : T; ...} (record,   manifest=T0)
    type t = ..                (open,     no manifest)
  *)

  and type_kind (*IF_CURRENT = Parsetree.type_kind *) =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
    | Ptype_record of label_declaration list
          (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration (*IF_CURRENT = Parsetree.label_declaration *) =
      {
       pld_name: string loc;
       pld_mutable: mutable_flag;
       pld_type: core_type;
       pld_loc: Location.t;
       pld_attributes: attributes; (* l : T [@id1] [@id2] *)
      }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration (*IF_CURRENT = Parsetree.constructor_declaration *) =
      {
       pcd_name: string loc;
       pcd_args: constructor_arguments;
       pcd_res: core_type option;
       pcd_loc: Location.t;
       pcd_attributes: attributes; (* C of ... [@id1] [@id2] *)
      }

  and constructor_arguments (*IF_CURRENT = Parsetree.constructor_arguments *) =
    | Pcstr_tuple of core_type list
    | Pcstr_record of label_declaration list

  (*
    | C of T1 * ... * Tn     (res = None,    args = Pcstr_tuple [])
    | C: T0                  (res = Some T0, args = [])
    | C: T1 * ... * Tn -> T0 (res = Some T0, args = Pcstr_tuple)
    | C of {...}             (res = None,    args = Pcstr_record)
    | C: {...} -> T0         (res = Some T0, args = Pcstr_record)
    | C of {...} as t        (res = None,    args = Pcstr_record)
  *)

  and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
      {
       ptyext_path: Longident.t loc;
       ptyext_params: (core_type * variance) list;
       ptyext_constructors: extension_constructor list;
       ptyext_private: private_flag;
       ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      }
  (*
    type t += ...
  *)

  and extension_constructor (*IF_CURRENT = Parsetree.extension_constructor *) =
      {
       pext_name: string loc;
       pext_kind : extension_constructor_kind;
       pext_loc : Location.t;
       pext_attributes: attributes; (* C of ... [@id1] [@id2] *)
      }

  and extension_constructor_kind (*IF_CURRENT = Parsetree.extension_constructor_kind *) =
      Pext_decl of constructor_arguments * core_type option
        (*
           | C of T1 * ... * Tn     ([T1; ...; Tn], None)
           | C: T0                  ([], Some T0)
           | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
         *)
    | Pext_rebind of Longident.t loc
        (*
           | C = D
         *)

  (** {1 Class language} *)

  (* Type expressions for the class language *)

  and class_type (*IF_CURRENT = Parsetree.class_type *) =
      {
       pcty_desc: class_type_desc;
       pcty_loc: Location.t;
       pcty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_type_desc (*IF_CURRENT = Parsetree.class_type_desc *) =
    | Pcty_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
          (* object ... end *)
    | Pcty_arrow of arg_label * core_type * class_type
          (* T -> CT       Simple
             ~l:T -> CT    Labelled l
             ?l:T -> CT    Optional l
           *)
    | Pcty_extension of extension
          (* [%id] *)
    | Pcty_open of override_flag * Longident.t loc * class_type
          (* let open M in CT *)

  and class_signature (*IF_CURRENT = Parsetree.class_signature *) =
      {
       pcsig_self: core_type;
       pcsig_fields: class_type_field list;
      }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
   *)

  and class_type_field (*IF_CURRENT = Parsetree.class_type_field *) =
      {
       pctf_desc: class_type_field_desc;
       pctf_loc: Location.t;
       pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_type_field_desc (*IF_CURRENT = Parsetree.class_type_field_desc *) =
    | Pctf_inherit of class_type
          (* inherit CT *)
    | Pctf_val of (label loc * mutable_flag * virtual_flag * core_type)
          (* val x: T *)
    | Pctf_method  of (label loc * private_flag * virtual_flag * core_type)
          (* method x: T

             Note: T can be a Ptyp_poly.
           *)
    | Pctf_constraint  of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
          (* [@@@id] *)
    | Pctf_extension of extension
          (* [%%id] *)

  and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
      {
       pci_virt: virtual_flag;
       pci_params: (core_type * variance) list;
       pci_name: string loc;
       pci_expr: 'a;
       pci_loc: Location.t;
       pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr (*IF_CURRENT = Parsetree.class_expr *) =
      {
       pcl_desc: class_expr_desc;
       pcl_loc: Location.t;
       pcl_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and class_expr_desc (*IF_CURRENT = Parsetree.class_expr_desc *) =
    | Pcl_constr of Longident.t loc * core_type list
          (* c
             ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
          (* object ... end *)
    | Pcl_fun of arg_label * expression option * pattern * class_expr
          (* fun P -> CE                          (Simple, None)
             fun ~l:P -> CE                       (Labelled l, None)
             fun ?l:P -> CE                       (Optional l, None)
             fun ?l:(P = E0) -> CE                (Optional l, Some E0)
           *)
    | Pcl_apply of class_expr * (arg_label * expression) list
          (* CE ~l1:E1 ... ~ln:En
             li can be empty (non labeled argument) or start with '?'
             (optional argument).

             Invariant: n > 0
           *)
    | Pcl_let of rec_flag * value_binding list * class_expr
          (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
           *)
    | Pcl_constraint of class_expr * class_type
          (* (CE : CT) *)
    | Pcl_extension of extension
    (* [%id] *)
    | Pcl_open of override_flag * Longident.t loc * class_expr
    (* let open M in CE *)


  and class_structure (*IF_CURRENT = Parsetree.class_structure *) =
      {
       pcstr_self: pattern;
       pcstr_fields: class_field list;
      }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
   *)

  and class_field (*IF_CURRENT = Parsetree.class_field *) =
      {
       pcf_desc: class_field_desc;
       pcf_loc: Location.t;
       pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
      }

  and class_field_desc (*IF_CURRENT = Parsetree.class_field_desc *) =
    | Pcf_inherit of override_flag * class_expr * string loc option
          (* inherit CE
             inherit CE as x
             inherit! CE
             inherit! CE as x
           *)
    | Pcf_val of (label loc * mutable_flag * class_field_kind)
          (* val x = E
             val virtual x: T
           *)
    | Pcf_method of (label loc * private_flag * class_field_kind)
          (* method x = E            (E can be a Pexp_poly)
             method virtual x: T     (T can be a Ptyp_poly)
           *)
    | Pcf_constraint of (core_type * core_type)
          (* constraint T1 = T2 *)
    | Pcf_initializer of expression
          (* initializer E *)
    | Pcf_attribute of attribute
          (* [@@@id] *)
    | Pcf_extension of extension
          (* [%%id] *)

  and class_field_kind (*IF_CURRENT = Parsetree.class_field_kind *) =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {1 Module language} *)

  (* Type expressions for the module language *)

  and module_type (*IF_CURRENT = Parsetree.module_type *) =
      {
       pmty_desc: module_type_desc;
       pmty_loc: Location.t;
       pmty_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_type_desc (*IF_CURRENT = Parsetree.module_type_desc *) =
    | Pmty_ident of Longident.t loc
          (* S *)
    | Pmty_signature of signature
          (* sig ... end *)
    | Pmty_functor of string loc * module_type option * module_type
          (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
          (* MT with ... *)
    | Pmty_typeof of module_expr
          (* module type of ME *)
    | Pmty_extension of extension
          (* [%id] *)
    | Pmty_alias of Longident.t loc
          (* (module M) *)

  and signature = signature_item list

  and signature_item (*IF_CURRENT = Parsetree.signature_item *) =
      {
       psig_desc: signature_item_desc;
       psig_loc: Location.t;
      }

  and signature_item_desc (*IF_CURRENT = Parsetree.signature_item_desc *) =
    | Psig_value of value_description
          (*
            val x: T
            external x: T = "s1" ... "sn"
           *)
    | Psig_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Psig_typext of type_extension
          (* type t1 += ... *)
    | Psig_exception of extension_constructor
          (* exception C of T *)
    | Psig_module of module_declaration
          (* module X : MT *)
    | Psig_recmodule of module_declaration list
          (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
          (* module type S = MT
             module type S *)
    | Psig_open of open_description
          (* open X *)
    | Psig_include of include_description
          (* include MT *)
    | Psig_class of class_description list
          (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
          (* [@@@id] *)
    | Psig_extension of extension * attributes
          (* [%%id] *)

  and module_declaration (*IF_CURRENT = Parsetree.module_declaration *) =
      {
       pmd_name: string loc;
       pmd_type: module_type;
       pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmd_loc: Location.t;
      }
  (* S : MT *)

  and module_type_declaration (*IF_CURRENT = Parsetree.module_type_declaration *) =
      {
       pmtd_name: string loc;
       pmtd_type: module_type option;
       pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
       pmtd_loc: Location.t;
      }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and open_description (*IF_CURRENT = Parsetree.open_description *) =
      {
       popen_lid: Longident.t loc;
       popen_override: override_flag;
       popen_loc: Location.t;
       popen_attributes: attributes;
      }
  (* open! X - popen_override = Override (silences the 'used identifier
                                shadowing' warning)
     open  X - popen_override = Fresh
   *)

  and 'a include_infos (*IF_CURRENT = 'a Parsetree.include_infos *) =
      {
       pincl_mod: 'a;
       pincl_loc: Location.t;
       pincl_attributes: attributes;
      }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint (*IF_CURRENT = Parsetree.with_constraint *) =
    | Pwith_type of Longident.t loc * type_declaration
          (* with type X.t = ...

             Note: the last component of the longident must match
             the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
          (* with module X.Y = Z *)
    | Pwith_typesubst of Longident.t loc * type_declaration
          (* with type X.t := ..., same format as [Pwith_type] *)
    | Pwith_modsubst of Longident.t loc * Longident.t loc
          (* with module X.Y := Z *)

  (* Value expressions for the module language *)

  and module_expr (*IF_CURRENT = Parsetree.module_expr *) =
      {
       pmod_desc: module_expr_desc;
       pmod_loc: Location.t;
       pmod_attributes: attributes; (* ... [@id1] [@id2] *)
      }

  and module_expr_desc (*IF_CURRENT = Parsetree.module_expr_desc *) =
    | Pmod_ident of Longident.t loc
          (* X *)
    | Pmod_structure of structure
          (* struct ... end *)
    | Pmod_functor of string loc * module_type option * module_expr
          (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
          (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
          (* (ME : MT) *)
    | Pmod_unpack of expression
          (* (val E) *)
    | Pmod_extension of extension
          (* [%id] *)

  and structure = structure_item list

  and structure_item (*IF_CURRENT = Parsetree.structure_item *) =
      {
       pstr_desc: structure_item_desc;
       pstr_loc: Location.t;
      }

  and structure_item_desc (*IF_CURRENT = Parsetree.structure_item_desc *) =
    | Pstr_eval of expression * attributes
          (* E *)
    | Pstr_value of rec_flag * value_binding list
          (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
             let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
           *)
    | Pstr_primitive of value_description
          (*  val x: T
              external x: T = "s1" ... "sn" *)
    | Pstr_type of rec_flag * type_declaration list
          (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
          (* type t1 += ... *)
    | Pstr_exception of extension_constructor
          (* exception C of T
             exception C = M.X *)
    | Pstr_module of module_binding
          (* module X = ME *)
    | Pstr_recmodule of module_binding list
          (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
          (* module type S = MT *)
    | Pstr_open of open_description
          (* open X *)
    | Pstr_class of class_declaration list
          (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
          (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
          (* include ME *)
    | Pstr_attribute of attribute
          (* [@@@id] *)
    | Pstr_extension of extension * attributes
          (* [%%id] *)

  and value_binding (*IF_CURRENT = Parsetree.value_binding *) =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding (*IF_CURRENT = Parsetree.module_binding *) =
      {
       pmb_name: string loc;
       pmb_expr: module_expr;
       pmb_attributes: attributes;
       pmb_loc: Location.t;
      }
  (* X = ME *)

  (** {1 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase (*IF_CURRENT = Parsetree.toplevel_phrase *) =
    | Ptop_def of structure
    | Ptop_dir of string * directive_argument
       (* #use, #load ... *)

  and directive_argument (*IF_CURRENT = Parsetree.directive_argument *) =
    | Pdir_none
    | Pdir_string of string
    | Pdir_int of string * char option
    | Pdir_ident of Longident.t
    | Pdir_bool of bool

end

module Docstrings : sig
  (** {2 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {2 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** {2 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** {2 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text
  val empty_text_lazy : text Lazy.t

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

end = struct
  open Location

  (* Docstrings *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t;
    }

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc;
      }
    in
    ds

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (doc_loc, PStr [item])

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []
  let empty_text_lazy = lazy []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
      (text_loc, PStr [item])

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""; _} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

end

module Ast_helper : sig

  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Docstrings
  open Parsetree

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  (** {1 Default locations} *)

  val default_loc: loc ref
      (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
      (** Set the [default_loc] within the scope of the execution
          of the provided function. *)

  (** {1 Constants} *)

  module Const : sig
    val char : char -> constant
    val string : ?quotation_delimiter:string -> string -> constant
    val integer : ?suffix:char -> string -> constant
    val int : ?suffix:char -> int -> constant
    val int32 : ?suffix:char -> int32 -> constant
    val int64 : ?suffix:char -> int64 -> constant
    val nativeint : ?suffix:char -> nativeint -> constant
    val float : ?suffix:char -> string -> constant
  end

  (** {1 Core language} *)

  (** Type expressions *)
  module Typ :
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
      val attr: core_type -> attribute -> core_type

      val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
      val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type -> core_type
                 -> core_type
      val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val object_: ?loc:loc -> ?attrs:attrs -> object_field list
                     -> closed_flag -> core_type
      val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
      val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
      val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
                   -> label list option -> core_type
      val poly: ?loc:loc -> ?attrs:attrs -> str list -> core_type -> core_type
      val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
                   -> core_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

      val force_poly: core_type -> core_type

      val varify_constructors: str list -> core_type -> core_type
      (** [varify_constructors newtypes te] is type expression [te], of which
          any of nullary type constructor [tc] is replaced by type variable of
          the same name, if [tc]'s name appears in [newtypes].
          Raise [Syntaxerr.Variable_in_scope] if any type variable inside [te]
          appears in [newtypes].
          @since 4.05
       *)
    end

  (** Patterns *)
  module Pat:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
      val attr:pattern -> attribute -> pattern

      val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
      val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
      val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
      val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
      val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
      val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
                  -> pattern
      val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
      val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
      val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
      val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
      val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
      val open_: ?loc:loc -> ?attrs:attrs  -> lid -> pattern -> pattern
      val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
    end

  (** Expressions *)
  module Exp:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
      val attr: expression -> attribute -> expression

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
                -> expression -> expression
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option
                -> pattern -> expression -> expression
      val function_: ?loc:loc -> ?attrs:attrs -> case list -> expression
      val apply: ?loc:loc -> ?attrs:attrs -> expression
                 -> (arg_label * expression) list -> expression
      val match_: ?loc:loc -> ?attrs:attrs -> expression -> case list
                  -> expression
      val try_: ?loc:loc -> ?attrs:attrs -> expression -> case list -> expression
      val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
                     -> expression
      val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
                   -> expression
      val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
                  -> expression option -> expression
      val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
                    -> expression
      val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
      val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
                      -> expression option -> expression
      val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
                    -> expression
      val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
                  -> expression
      val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
                -> direction_flag -> expression -> expression
      val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                  -> core_type -> expression
      val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
                       -> expression
      val send: ?loc:loc -> ?attrs:attrs -> expression -> str -> expression
      val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
      val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
                    -> expression
      val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
                     -> expression
      val letexception:
        ?loc:loc -> ?attrs:attrs -> extension_constructor -> expression
        -> expression
      val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
                -> expression
      val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
      val newtype: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
      val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> expression
                 -> expression
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression
      val unreachable: ?loc:loc -> ?attrs:attrs -> unit -> expression

      val case: pattern -> ?guard:expression -> expression -> case
    end

  (** Value declarations *)
  module Val:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        ?prim:string list -> str -> core_type -> value_description
    end

  (** Type declarations *)
  module Type:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?params:(core_type * variance) list ->
        ?cstrs:(core_type * core_type * loc) list ->
        ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
        type_declaration

      val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        constructor_declaration
      val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
        ?mut:mutable_flag -> str -> core_type -> label_declaration
    end

  (** Type extensions *)
  module Te:
    sig
      val mk: ?attrs:attrs -> ?docs:docs ->
        ?params:(core_type * variance) list -> ?priv:private_flag ->
        lid -> extension_constructor list -> type_extension

      val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> extension_constructor_kind -> extension_constructor

      val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        ?args:constructor_arguments -> ?res:core_type -> str ->
        extension_constructor
      val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
        str -> lid -> extension_constructor
    end

  (** {1 Module language} *)

  (** Module type expressions *)
  module Mty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
      val attr: module_type -> attribute -> module_type

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
      val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_type -> module_type
      val with_: ?loc:loc -> ?attrs:attrs -> module_type ->
        with_constraint list -> module_type
      val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
    end

  (** Module expressions *)
  module Mod:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
      val attr: module_expr -> attribute -> module_expr

      val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
      val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
      val functor_: ?loc:loc -> ?attrs:attrs ->
        str -> module_type option -> module_expr -> module_expr
      val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr ->
        module_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type ->
        module_expr
      val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
    end

  (** Signature items *)
  module Sig:
    sig
      val mk: ?loc:loc -> signature_item_desc -> signature_item

      val value: ?loc:loc -> value_description -> signature_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item
      val type_extension: ?loc:loc -> type_extension -> signature_item
      val exception_: ?loc:loc -> extension_constructor -> signature_item
      val module_: ?loc:loc -> module_declaration -> signature_item
      val rec_module: ?loc:loc -> module_declaration list -> signature_item
      val modtype: ?loc:loc -> module_type_declaration -> signature_item
      val open_: ?loc:loc -> open_description -> signature_item
      val include_: ?loc:loc -> include_description -> signature_item
      val class_: ?loc:loc -> class_description list -> signature_item
      val class_type: ?loc:loc -> class_type_declaration list -> signature_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
      val attribute: ?loc:loc -> attribute -> signature_item
      val text: text -> signature_item list
    end

  (** Structure items *)
  module Str:
    sig
      val mk: ?loc:loc -> structure_item_desc -> structure_item

      val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
      val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
      val primitive: ?loc:loc -> value_description -> structure_item
      val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item
      val type_extension: ?loc:loc -> type_extension -> structure_item
      val exception_: ?loc:loc -> extension_constructor -> structure_item
      val module_: ?loc:loc -> module_binding -> structure_item
      val rec_module: ?loc:loc -> module_binding list -> structure_item
      val modtype: ?loc:loc -> module_type_declaration -> structure_item
      val open_: ?loc:loc -> open_description -> structure_item
      val class_: ?loc:loc -> class_declaration list -> structure_item
      val class_type: ?loc:loc -> class_type_declaration list -> structure_item
      val include_: ?loc:loc -> include_declaration -> structure_item
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
      val attribute: ?loc:loc -> attribute -> structure_item
      val text: text -> structure_item list
    end

  (** Module declarations *)
  module Md:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_type -> module_declaration
    end

  (** Module type declarations *)
  module Mtd:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?typ:module_type -> str -> module_type_declaration
    end

  (** Module bindings *)
  module Mb:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        str -> module_expr -> module_binding
    end

  (** Opens *)
  module Opn:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
        ?override:override_flag -> lid -> open_description
    end

  (** Includes *)
  module Incl:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
    end

  (** Value bindings *)
  module Vb:
    sig
      val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        pattern -> expression -> value_binding
    end


  (** {1 Class language} *)

  (** Class type expressions *)
  module Cty:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
      val attr: class_type -> attribute -> class_type

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
      val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
      val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type ->
        class_type -> class_type
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> class_type
                 -> class_type
    end

  (** Class type fields *)
  module Ctf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
        class_type_field_desc -> class_type_field
      val attr: class_type_field -> attribute -> class_type_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
        virtual_flag -> core_type -> class_type_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
        virtual_flag -> core_type -> class_type_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_type_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
      val attribute: ?loc:loc -> attribute -> class_type_field
      val text: text -> class_type_field list
    end

  (** Class expressions *)
  module Cl:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
      val attr: class_expr -> attribute -> class_expr

      val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
      val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
      val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option ->
        pattern -> class_expr -> class_expr
      val apply: ?loc:loc -> ?attrs:attrs -> class_expr ->
        (arg_label * expression) list -> class_expr
      val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list ->
        class_expr -> class_expr
      val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type ->
        class_expr
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
      val open_: ?loc:loc -> ?attrs:attrs -> override_flag -> lid -> class_expr
                 -> class_expr
    end

  (** Class fields *)
  module Cf:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
        class_field
      val attr: class_field -> attribute -> class_field

      val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr ->
        str option -> class_field
      val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
        class_field_kind -> class_field
      val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
        class_field_kind -> class_field
      val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
        class_field
      val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
      val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
      val attribute: ?loc:loc -> attribute -> class_field
      val text: text -> class_field list

      val virtual_: core_type -> class_field_kind
      val concrete: override_flag -> expression -> class_field_kind

    end

  (** Classes *)
  module Ci:
    sig
      val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
        ?virt:virtual_flag -> ?params:(core_type * variance) list ->
        str -> 'a -> 'a class_infos
    end

  (** Class signatures *)
  module Csig:
    sig
      val mk: core_type -> class_type_field list -> class_signature
    end

  (** Class structures *)
  module Cstr:
    sig
      val mk: pattern -> class_field list -> class_structure
    end

end = struct
  (**************************************************************************)
  (*                                                                        *)
  (*                                 OCaml                                  *)
  (*                                                                        *)
  (*                         Alain Frisch, LexiFi                           *)
  (*                                                                        *)
  (*   Copyright 2012 Institut National de Recherche en Informatique et     *)
  (*     en Automatique.                                                    *)
  (*                                                                        *)
  (*   All rights reserved.  This file is distributed under the terms of    *)
  (*   the GNU Lesser General Public License version 2.1, with the          *)
  (*   special exception on linking described in the file LICENSE.          *)
  (*                                                                        *)
  (**************************************************************************)

  (** Helpers to produce Parsetree fragments *)

  open Asttypes
  open Parsetree
  open Docstrings

  type lid = Longident.t loc
  type str = string loc
  type loc = Location.t
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    let old = !default_loc in
    default_loc := l;
    try let r = f () in default_loc := old; r
    with exn -> default_loc := old; raise exn

  module Const = struct
    let integer ?suffix i = Pconst_integer (i, suffix)
    let int ?suffix i = integer ?suffix (string_of_int i)
    let int32 ?(suffix='l') i = integer ~suffix (Int32.to_string i)
    let int64 ?(suffix='L') i = integer ~suffix (Int64.to_string i)
    let nativeint ?(suffix='n') i = integer ~suffix (Nativeint.to_string i)
    let float ?suffix f = Pconst_float (f, suffix)
    let char c = Pconst_char c
    let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter)
  end

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs}
    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)

    let varify_constructors var_names t =
      let check_variable vl loc v =
        if List.mem v vl then
          raise Syntaxerr.(Error(Variable_in_scope(loc,v))) in
      let var_names = List.map (fun v -> v.txt) var_names in
      let rec loop t =
        let desc =
          match t.ptyp_desc with
          | Ptyp_any -> Ptyp_any
          | Ptyp_var x ->
              check_variable var_names t.ptyp_loc x;
              Ptyp_var x
          | Ptyp_arrow (label,core_type,core_type') ->
              Ptyp_arrow(label, loop core_type, loop core_type')
          | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
          | Ptyp_constr( { txt = Longident.Lident s; _ }, [])
            when List.mem s var_names ->
              Ptyp_var s
          | Ptyp_constr(longident, lst) ->
              Ptyp_constr(longident, List.map loop lst)
          | Ptyp_object (lst, o) ->
              Ptyp_object (List.map loop_object_field lst, o)
          | Ptyp_class (longident, lst) ->
              Ptyp_class (longident, List.map loop lst)
          | Ptyp_alias(core_type, string) ->
              check_variable var_names t.ptyp_loc string;
              Ptyp_alias(loop core_type, string)
          | Ptyp_variant(row_field_list, flag, lbl_lst_option) ->
              Ptyp_variant(List.map loop_row_field row_field_list,
                           flag, lbl_lst_option)
          | Ptyp_poly(string_lst, core_type) ->
            List.iter (fun v ->
              check_variable var_names t.ptyp_loc v.txt) string_lst;
              Ptyp_poly(string_lst, loop core_type)
          | Ptyp_package(longident,lst) ->
              Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
          | Ptyp_extension (s, arg) ->
              Ptyp_extension (s, arg)
        in
        {t with ptyp_desc = desc}
      and loop_row_field  =
        function
          | Rtag(label,attrs,flag,lst) ->
              Rtag(label,attrs,flag,List.map loop lst)
          | Rinherit t ->
              Rinherit (loop t)
      and loop_object_field =
        function
          | Otag(label, attrs, t) ->
              Otag(label, attrs, loop t)
          | Oinherit t ->
              Oinherit (loop t)
      in
      loop t

  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d; ppat_loc = loc; ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b))
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d; pexp_loc = loc; pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let letexception ?loc ?attrs a b = mk ?loc ?attrs (Pexp_letexception (a, b))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_open (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)
    let unreachable ?loc ?attrs () = mk ?loc ?attrs Pexp_unreachable

    let case lhs ?guard rhs =
      {
       pc_lhs = lhs;
       pc_guard = guard;
       pc_rhs = rhs;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
  let mk ?(loc = !default_loc) ?(attrs = []) d =
    {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg arg_ty body =
      mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc rec_flag a = mk ?loc (Psig_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcl_desc = d;
       pcl_loc = loc;
       pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_open (a, b, c))
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
       pcty_desc = d;
       pcty_loc = loc;
       pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
    let open_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_open (a, b, c))
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
             ?(docs = empty_docs) d =
      {
       pctf_desc = d;
       pctf_loc = loc;
       pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
     let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
       List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
       pcf_desc = d;
       pcf_loc = loc;
       pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(prim = []) name typ =
      {
       pval_name = name;
       pval_type = typ;
       pval_attributes = add_docs_attrs docs attrs;
       pval_loc = loc;
       pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name typ =
      {
       pmd_name = name;
       pmd_type = typ;
       pmd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmd_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) ?typ name =
      {
       pmtd_name = name;
       pmtd_type = typ;
       pmtd_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name expr =
      {
       pmb_name = name;
       pmb_expr = expr;
       pmb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(override = Fresh) lid =
      {
       popen_lid = lid;
       popen_override = override;
       popen_loc = loc;
       popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
       pincl_mod = mexpr;
       pincl_loc = loc;
       pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(text = []) pat expr =
      {
       pvb_pat = pat;
       pvb_expr = expr;
       pvb_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(virt = Concrete) ?(params = []) name expr =
      {
       pci_virt = virt;
       pci_params = params;
       pci_name = name;
       pci_expr = expr;
       pci_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
        ?(params = [])
        ?(cstrs = [])
        ?(kind = Ptype_abstract)
        ?(priv = Public)
        ?manifest
        name =
      {
       ptype_name = name;
       ptype_params = params;
       ptype_cstrs = cstrs;
       ptype_kind = kind;
       ptype_private = priv;
       ptype_manifest = manifest;
       ptype_attributes =
         add_text_attrs text (add_docs_attrs docs attrs);
       ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(args = Pcstr_tuple []) ?res name =
      {
       pcd_name = name;
       pcd_args = args;
       pcd_res = res;
       pcd_loc = loc;
       pcd_attributes = add_info_attrs info attrs;
      }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(mut = Immutable) name typ =
      {
       pld_name = name;
       pld_mutable = mut;
       pld_type = typ;
       pld_loc = loc;
       pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(attrs = []) ?(docs = empty_docs)
          ?(params = []) ?(priv = Public) path constructors =
      {
       ptyext_path = path;
       ptyext_params = params;
       ptyext_constructors = constructors;
       ptyext_private = priv;
       ptyext_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
       pext_name = name;
       pext_kind = kind;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
               ?(info = empty_info) ?(args = Pcstr_tuple []) ?res name =
      {
       pext_name = name;
       pext_kind = Pext_decl(args, res);
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
       pext_name = name;
       pext_kind = Pext_rebind lid;
       pext_loc = loc;
       pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
       pcsig_self = self;
       pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
       pcstr_self = self;
       pcstr_fields = fields;
      }
  end

end

module Ast_mapper : sig
  (** The interface of a -ppx rewriter

    A -ppx rewriter is a program that accepts a serialized abstract syntax
    tree and outputs another, possibly modified, abstract syntax tree.
    This module encapsulates the interface between the compiler and
    the -ppx rewriters, handling such details as the serialization format,
    forwarding of command-line flags, and storing state.

    {!mapper} allows to implement AST rewriting using open recursion.
    A typical mapper would be based on {!default_mapper}, a deep
    identity mapper, and will fall back on it for handling the syntax it
    does not modify. For example:

    {[
  open Asttypes
  open Parsetree
  open Ast_mapper

  let test_mapper argv =
    { default_mapper with
      expr = fun mapper expr ->
        match expr with
        | { pexp_desc = Pexp_extension ({ txt = "test" }, PStr [])} ->
          Ast_helper.Exp.constant (Const_int 42)
        | other -> default_mapper.expr mapper other; }

  let () =
    register "ppx_test" test_mapper]}

    This -ppx rewriter, which replaces [[%test]] in expressions with
    the constant [42], can be compiled using
    [ocamlc -o ppx_test -I +compiler-libs ocamlcommon.cma ppx_test.ml].

    *)

  open Parsetree

  (** {1 A generic Parsetree mapper} *)

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {1 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

  include Locations.Helpers_intf

end = struct
  (* A generic Parsetree mapping class *)

  (*
  [@@@ocaml.warning "+9"]
    (* Ensure that record patterns don't miss any field. *)
  *)


  open Parsetree
  open Ast_helper
  open Location

  type mapper (*IF_CURRENT = Ast_mapper.mapper*) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
                            -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
                             -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
                           -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
                             -> module_type_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub = function
      | Rtag (l, attrs, b, tl) ->
          Rtag (map_loc sub l, sub.attributes sub attrs,
                b, List.map (sub.typ sub) tl)
      | Rinherit t -> Rinherit (sub.typ sub t)

    let object_field sub = function
      | Otag (l, attrs, t) ->
          Otag (map_loc sub l, sub.attributes sub attrs, sub.typ sub t)
      | Oinherit t -> Oinherit (sub.typ sub t)

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
          arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
          object_ ~loc ~attrs (List.map (object_field sub) l) o
      | Ptyp_class (lid, tl) ->
          class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
          variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs
                               (List.map (map_loc sub) sl) (sub.typ sub t)
      | Ptyp_package (lid, l) ->
          package ~loc ~attrs (map_loc sub lid)
            (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
        {ptype_name; ptype_params; ptype_cstrs;
         ptype_kind;
         ptype_private;
         ptype_manifest;
         ptype_attributes;
         ptype_loc} =
      Type.mk (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)
        ~loc:(sub.location sub ptype_loc)
        ~attrs:(sub.attributes sub ptype_attributes)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
          Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_constructor_arguments sub = function
      | Pcstr_tuple l -> Pcstr_tuple (List.map (sub.typ sub) l)
      | Pcstr_record l ->
          Pcstr_record (List.map (sub.label_declaration sub) l)

    let map_type_extension sub
        {ptyext_path; ptyext_params;
         ptyext_constructors;
         ptyext_private;
         ptyext_attributes} =
      Te.mk
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private
        ~attrs:(sub.attributes sub ptyext_attributes)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
          Pext_decl(map_constructor_arguments sub ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
          Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
        {pext_name;
         pext_kind;
         pext_loc;
         pext_attributes} =
      Te.constructor
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)
        ~loc:(sub.location sub pext_loc)
        ~attrs:(sub.attributes sub pext_attributes)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
          arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcty_open (ovf, lid, ct) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.class_type sub ct)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) ->
          val_ ~loc ~attrs (map_loc sub s) m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) ->
          method_ ~loc ~attrs (map_loc sub s) p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (s, mt1, mt2) ->
          functor_ ~loc ~attrs (map_loc sub s)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) mt1)
            (sub.module_type sub mt2)
      | Pmty_with (mt, l) ->
          with_ ~loc ~attrs (sub.module_type sub mt)
            (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
          Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
          Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst (lid, d) ->
          Pwith_typesubst (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
          Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_recmodule l ->
          rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (arg, arg_ty, body) ->
          functor_ ~loc ~attrs (map_loc sub arg)
            (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) arg_ty)
            (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
          apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
          constraint_ ~loc ~attrs (sub.module_expr sub m)
                      (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
          eval ~loc ~attrs:(sub.attributes sub attrs) (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.extension_constructor sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_description sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
          extension ~loc (sub.extension sub x) ~attrs:(sub.attributes sub attrs)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
          fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
            (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
          apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
          match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
          construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
          variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
          record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
            (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
          field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
          setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
            (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
          ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
            (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
          sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
          while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
          for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
            (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
          coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
            (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
          constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) ->
          send ~loc ~attrs (sub.expr sub e) (map_loc sub s)
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
          setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
          override ~loc ~attrs
            (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
          letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
            (sub.expr sub e)
      | Pexp_letexception (cd, e) ->
          letexception ~loc ~attrs
            (sub.extension_constructor sub cd)
            (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
          poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) ->
          newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (ovf, lid, e) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.expr sub e)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pexp_unreachable -> unreachable ~loc ~attrs ()
  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
          construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
          record ~loc ~attrs
                 (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
          constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
          structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
          fun_ ~loc ~attrs lab
            (map_opt (sub.expr sub) e)
            (sub.pat sub p)
            (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
          apply ~loc ~attrs (sub.class_expr sub ce)
            (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
          constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcl_open (ovf, lid, ce) ->
          open_ ~loc ~attrs ovf (map_loc sub lid) (sub.class_expr sub ce)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) ->
          inherit_ ~loc ~attrs o (sub.class_expr sub ce)
            (map_opt (map_loc sub) s)
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
          method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      Ci.mk
       ~virt:pci_virt
       ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
        ~loc:(sub.location sub pci_loc)
        ~attrs:(sub.attributes sub pci_attributes)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_description =
        (fun this {popen_lid; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_lid)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );


      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
          Type.constructor
            (map_loc this pcd_name)
            ~args:(T.map_constructor_arguments this pcd_args)
            ?res:(map_opt (this.typ this) pcd_res)
            ~loc:(this.location this pcd_loc)
            ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PSig x -> PSig (this.signature this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(function
        | x :: l -> PStr (x :: x :: l)
        | l -> PStr l)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Pconst_string (x, None))))
      error

  let attribute_of_warning loc s =
    { loc; txt = "ocaml.ppwarning" },
    PStr ([Str.eval ~loc (Exp.constant (Pconst_string (s, None)))])

  include Locations.Helpers_impl

end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
        [Toploop.print_out_value]
        [Toploop.print_out_type]
        [Toploop.print_out_sig_item]
        [Toploop.print_out_phrase] *)

  type out_ident (*IF_CURRENT = Outcometree.out_ident *) =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of string

  type out_string (*IF_CURRENT = Outcometree.out_string *) =
    | Ostr_string
    | Ostr_bytes

  type out_attribute (*IF_CURRENT = Outcometree.out_attribute *) =
    { oattr_name: string }

  type out_value (*IF_CURRENT = Outcometree.out_value *) =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string * int * out_string (* string, size-to-print, kind *)
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type (*IF_CURRENT = Outcometree.out_type *) =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of string * string list * out_type list
    | Otyp_attribute of out_type * out_attribute

  and out_variant (*IF_CURRENT = Outcometree.out_variant *) =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_typ of out_type

  type out_class_type (*IF_CURRENT = Outcometree.out_class_type *) =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item (*IF_CURRENT = Outcometree.out_class_sig_item *) =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type (*IF_CURRENT = Outcometree.out_module_type *) =
    | Omty_abstract
    | Omty_functor of string * out_module_type option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item (*IF_CURRENT = Outcometree.out_sig_item *) =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
          out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of out_val_decl
    | Osig_ellipsis
  and out_type_decl (*IF_CURRENT = Outcometree.out_type_decl *) =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_immediate: bool;
      otype_unboxed: bool;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor (*IF_CURRENT = Outcometree.out_extension_constructor *) =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension (*IF_CURRENT = Outcometree.out_type_extension *) =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_val_decl (*IF_CURRENT = Outcometree.out_val_decl *) =
    { oval_name: string;
      oval_type: out_type;
      oval_prims: string list;
      oval_attributes: out_attribute list }
  and out_rec_status (*IF_CURRENT = Outcometree.out_rec_status *) =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status (*IF_CURRENT = Outcometree.out_ext_status *) =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase (*IF_CURRENT = Outcometree.out_phrase *) =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)

end

module Config = struct
  let ast_impl_magic_number = "Caml1999M023"
  let ast_intf_magic_number = "Caml1999N023"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Stdlib0
= struct
#1 "stdlib0.ml"
# 1 "src/stdlib0.ml"
module Int = struct
  let to_string = string_of_int
end

module Option = struct
  let map f o =
    match o with
    | None -> None
    | Some v -> Some (f v)
end

end
module Ast_408_helper
= struct
#1 "ast_408_helper.ml"
# 1 "src/ast_408_helper.ml"
module Misc = struct

  let find_in_path = Misc.find_in_path
  let find_in_path_uncap = Misc.find_in_path_uncap

  type ref_and_value = R : 'a ref * 'a -> ref_and_value
  let protect_refs =
    let set_refs l = List.iter (fun (R (r, v)) -> r := v) l in
    fun refs f ->
      let backup = List.map (fun (R (r, _)) -> R (r, !r)) refs in
      set_refs refs;
      match f () with
      | x           -> set_refs backup; x
      | exception e -> set_refs backup; raise e

  let may_map = Stdlib0.Option.map

  module Stdlib = struct
    module String = struct
      include String
      module Map = Map.Make (String)
    end
  end
end

end
module Ast_408
= struct
#1 "ast_408.ml"
# 1 "src/ast_408.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                         Frédéric Bour, Facebook                        *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2018 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(* Ast ported on Thu Mar 21 09:50:42 GMT 2019
   OCaml was:
   commit 55c9ba466362f303eb4d5ed511f6fda142879137 (HEAD -> 4.08, origin/4.08)
     Author: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
     Date:   Tue Mar 19 08:11:02 2019 +0100

         Merge pull request #8521 from nojb/fix_unix_tests_408

         Actually run all lib-unix tests [4.08]
*)

open Stdlib0
open Ast_408_helper

module Location = Location
module Longident = Longident

module Asttypes = struct

  type constant (*IF_CURRENT = Asttypes.constant *) =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag (*IF_CURRENT = Asttypes.rec_flag *) = Nonrecursive | Recursive

  type direction_flag (*IF_CURRENT = Asttypes.direction_flag *) = Upto | Downto

  (* Order matters, used in polymorphic comparison *)
  type private_flag (*IF_CURRENT = Asttypes.private_flag *) = Private | Public

  type mutable_flag (*IF_CURRENT = Asttypes.mutable_flag *) = Immutable | Mutable

  type virtual_flag (*IF_CURRENT = Asttypes.virtual_flag *) = Virtual | Concrete

  type override_flag (*IF_CURRENT = Asttypes.override_flag *) = Override | Fresh

  type closed_flag (*IF_CURRENT = Asttypes.closed_flag *) = Closed | Open

  type label = string

  type arg_label (*IF_CURRENT = Asttypes.arg_label *) =
      Nolabel
    | Labelled of string (*  label:T -> ... *)
    | Optional of string (* ?label:T -> ... *)

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance (*IF_CURRENT = Asttypes.variance *) =
    | Covariant
    | Contravariant
    | Invariant

end

module Parsetree = struct

  open Asttypes

  type constant (*IF_CURRENT = Parsetree.constant *) =
      Pconst_integer of string * char option
    (* 3 3l 3L 3n

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes except 'l', 'L' and 'n' are rejected by the typechecker
    *)
    | Pconst_char of char
    (* 'c' *)
    | Pconst_string of string * string option
    (* "constant"
       {delim|other constant|delim}
    *)
    | Pconst_float of string * char option
    (* 3.4 2e5 1.4e-4

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes are rejected by the typechecker.
    *)

  (** {1 Extension points} *)

  type attribute (*IF_CURRENT = Parsetree.attribute *) = {
    attr_name : string loc;
    attr_payload : payload;
    attr_loc : Location.t;
  }
  (* [@id ARG]
     [@@id ARG]

     Metadata containers passed around within the AST.
     The compiler ignores unknown attributes.
  *)

  and extension = string loc * payload
  (* [%id ARG]
     [%%id ARG]

     Sub-language placeholder -- rejected by the typechecker.
  *)

  and attributes = attribute list

  and payload (*IF_CURRENT = Parsetree.payload *) =
    | PStr of structure
    | PSig of signature (* : SIG *)
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {1 Core language} *)

  (* Type expressions *)

  and core_type (*IF_CURRENT = Parsetree.core_type *) =
    {
      ptyp_desc: core_type_desc;
      ptyp_loc: Location.t;
      ptyp_loc_stack: Location.t list;
      ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and typ = core_type

  and core_type_desc (*IF_CURRENT = Parsetree.core_type_desc *) =
    | Ptyp_any
    (*  _ *)
    | Ptyp_var of string
    (* 'a *)
    | Ptyp_arrow of arg_label * core_type * core_type
    (* T1 -> T2       Simple
       ~l:T1 -> T2    Labelled
       ?l:T1 -> T2    Optional
    *)
    | Ptyp_tuple of core_type list
    (* T1 * ... * Tn

       Invariant: n >= 2
    *)
    | Ptyp_constr of Longident.t loc * core_type list
    (* tconstr
       T tconstr
       (T1, ..., Tn) tconstr
    *)
    | Ptyp_object of object_field list * closed_flag
    (* < l1:T1; ...; ln:Tn >     (flag = Closed)
       < l1:T1; ...; ln:Tn; .. > (flag = Open)
    *)
    | Ptyp_class of Longident.t loc * core_type list
    (* #tconstr
       T #tconstr
       (T1, ..., Tn) #tconstr
    *)
    | Ptyp_alias of core_type * string
    (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
    (* [ `A|`B ]         (flag = Closed; labels = None)
       [> `A|`B ]        (flag = Open;   labels = None)
       [< `A|`B ]        (flag = Closed; labels = Some [])
       [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
    *)
    | Ptyp_poly of string loc list * core_type
    (* 'a1 ... 'an. T

       Can only appear in the following context:

       - As the core_type of a Ppat_constraint node corresponding
       to a constraint on a let-binding: let x : 'a1 ... 'an. T
       = e ...

       - Under Cfk_virtual for methods (not values).

       - As the core_type of a Pctf_method node.

       - As the core_type of a Pexp_poly node.

       - As the pld_type field of a label_declaration.

       - As a core_type of a Ptyp_object node.
    *)

    | Ptyp_package of package_type
    (* (module S) *)
    | Ptyp_extension of extension
    (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
      (*
     (module S)
     (module S with type t1 = T1 and ... and tn = Tn)
  *)

  and row_field (*IF_CURRENT = Parsetree.row_field *) = {
    prf_desc : row_field_desc;
    prf_loc : Location.t;
    prf_attributes : attributes;
  }

  and row_field_desc (*IF_CURRENT = Parsetree.row_field_desc *) =
    | Rtag of label loc * bool * core_type list
    (* [`A]                   ( true,  [] )
       [`A of T]              ( false, [T] )
       [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
       [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

       - The 'bool' field is true if the tag contains a
       constant (empty) constructor.
       - '&' occurs when several types are used for the same constructor
       (see 4.2 in the manual)
    *)
    | Rinherit of core_type
    (* [ T ] *)

  and object_field (*IF_CURRENT = Parsetree.object_field *) = {
    pof_desc : object_field_desc;
    pof_loc : Location.t;
    pof_attributes : attributes;
  }

  and object_field_desc (*IF_CURRENT = Parsetree.object_field_desc *) =
    | Otag of label loc * core_type
    | Oinherit of core_type

  (* Patterns *)

  and pattern (*IF_CURRENT = Parsetree.pattern *) =
    {
      ppat_desc: pattern_desc;
      ppat_loc: Location.t;
      ppat_loc_stack: Location.t list;
      ppat_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and pat = pattern

  and pattern_desc (*IF_CURRENT = Parsetree.pattern_desc *) =
    | Ppat_any
    (* _ *)
    | Ppat_var of string loc
    (* x *)
    | Ppat_alias of pattern * string loc
    (* P as 'a *)
    | Ppat_constant of constant
    (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
    (* 'a'..'z'

       Other forms of interval are recognized by the parser
       but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
    (* (P1, ..., Pn)

       Invariant: n >= 2
    *)
    | Ppat_construct of Longident.t loc * pattern option
    (* C                None
       C P              Some P
       C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
    *)
    | Ppat_variant of label * pattern option
    (* `A             (None)
       `A P           (Some P)
    *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
    (* { l1=P1; ...; ln=Pn }     (flag = Closed)
       { l1=P1; ...; ln=Pn; _}   (flag = Open)

       Invariant: n > 0
    *)
    | Ppat_array of pattern list
    (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
    (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
    (* (P : T) *)
    | Ppat_type of Longident.t loc
    (* #tconst *)
    | Ppat_lazy of pattern
    (* lazy P *)
    | Ppat_unpack of string loc
    (* (module P)
       Note: (module P : S) is represented as
       Ppat_constraint(Ppat_unpack, Ptyp_package)
    *)
    | Ppat_exception of pattern
    (* exception P *)
    | Ppat_extension of extension
    (* [%id] *)
    | Ppat_open of Longident.t loc * pattern
    (* M.(P) *)

  (* Value expressions *)

  and expression (*IF_CURRENT = Parsetree.expression *) =
    {
      pexp_desc: expression_desc;
      pexp_loc: Location.t;
      pexp_loc_stack: Location.t list;
      pexp_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and expr = expression

  and expression_desc (*IF_CURRENT = Parsetree.expression_desc *) =
    | Pexp_ident of Longident.t loc
    (* x
       M.x
    *)
    | Pexp_constant of constant
    (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
    (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
    *)
    | Pexp_function of cases
    (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of arg_label * expression option * pattern * expression
    (* fun P -> E1                          (Simple, None)
       fun ~l:P -> E1                       (Labelled l, None)
       fun ?l:P -> E1                       (Optional l, None)
       fun ?l:(P = E0) -> E1                (Optional l, Some E0)

       Notes:
       - If E0 is provided, only Optional is allowed.
       - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
       - "let f P = E" is represented using Pexp_fun.
    *)
    | Pexp_apply of expression * (arg_label * expression) list
    (* E0 ~l1:E1 ... ~ln:En
       li can be empty (non labeled argument) or start with '?'
       (optional argument).

       Invariant: n > 0
    *)
    | Pexp_match of expression * cases
    (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * cases
    (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
    (* (E1, ..., En)

       Invariant: n >= 2
    *)
    | Pexp_construct of Longident.t loc * expression option
    (* C                None
       C E              Some E
       C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
    *)
    | Pexp_variant of label * expression option
    (* `A             (None)
       `A E           (Some E)
    *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
    (* { l1=P1; ...; ln=Pn }     (None)
       { E0 with l1=P1; ...; ln=Pn }   (Some E0)

       Invariant: n > 0
    *)
    | Pexp_field of expression * Longident.t loc
    (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
    (* E1.l <- E2 *)
    | Pexp_array of expression list
    (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
    (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
    (* E1; E2 *)
    | Pexp_while of expression * expression
    (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
    (* for i = E1 to E2 do E3 done      (flag = Upto)
       for i = E1 downto E2 do E3 done  (flag = Downto)
    *)
    | Pexp_constraint of expression * core_type
    (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
    (* (E :> T)        (None, T)
       (E : T0 :> T)   (Some T0, T)
    *)
    | Pexp_send of expression * label loc
    (*  E # m *)
    | Pexp_new of Longident.t loc
    (* new M.c *)
    | Pexp_setinstvar of label loc * expression
    (* x <- 2 *)
    | Pexp_override of (label loc * expression) list
    (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string loc * module_expr * expression
    (* let module M = ME in E *)
    | Pexp_letexception of extension_constructor * expression
    (* let exception C in E *)
    | Pexp_assert of expression
    (* assert E
       Note: "assert false" is treated in a special way by the
       type-checker. *)
    | Pexp_lazy of expression
    (* lazy E *)
    | Pexp_poly of expression * core_type option
    (* Used for method bodies.

       Can only be used as the expression under Cfk_concrete
       for methods (not values). *)
    | Pexp_object of class_structure
    (* object ... end *)
    | Pexp_newtype of string loc * expression
    (* fun (type t) -> E *)
    | Pexp_pack of module_expr
    (* (module ME)

       (module ME : S) is represented as
       Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of open_declaration * expression
    (* M.(E)
       let open M in E
       let! open M in E *)
    | Pexp_letop of letop
    (* let* P = E in E
       let* P = E and* P = E in E *)
    | Pexp_extension of extension
    (* [%id] *)
    | Pexp_unreachable
    (* . *)

  and case (*IF_CURRENT = Parsetree.case *) =   (* (P -> E) or (P when E0 -> E) *)
    {
      pc_lhs: pattern;
      pc_guard: expression option;
      pc_rhs: expression;
    }

  and cases = case list

  and letop (*IF_CURRENT = Parsetree.letop *) =
    {
      let_ : binding_op;
      ands : binding_op list;
      body : expression;
    }

  and binding_op (*IF_CURRENT = Parsetree.binding_op *) =
    {
      pbop_op : string loc;
      pbop_pat : pattern;
      pbop_exp : expression;
      pbop_loc : Location.t;
    }

  (* Value descriptions *)

  and value_description (*IF_CURRENT = Parsetree.value_description *) =
    {
      pval_name: string loc;
      pval_type: core_type;
      pval_prim: string list;
      pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      pval_loc: Location.t;
    }

(*
     val x: T                            (prim = [])
     external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])
  *)

  (* Type declarations *)

  and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
    {
      ptype_name: string loc;
      ptype_params: (core_type * variance) list;
      (* ('a1,...'an) t; None represents  _*)
      ptype_cstrs: (core_type * core_type * Location.t) list;
      (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
      ptype_kind: type_kind;
      ptype_private: private_flag;   (* = private ... *)
      ptype_manifest: core_type option;  (* = T *)
      ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      ptype_loc: Location.t;
    }

(*
     type t                     (abstract, no manifest)
     type t = T0                (abstract, manifest=T0)
     type t = C of T | ...      (variant,  no manifest)
     type t = T0 = C of T | ... (variant,  manifest=T0)
     type t = {l: T; ...}       (record,   no manifest)
     type t = T0 = {l : T; ...} (record,   manifest=T0)
     type t = ..                (open,     no manifest)
  *)

  and type_kind (*IF_CURRENT = Parsetree.type_kind *) =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
    | Ptype_record of label_declaration list
    (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration (*IF_CURRENT = Parsetree.label_declaration *) =
    {
      pld_name: string loc;
      pld_mutable: mutable_flag;
      pld_type: core_type;
      pld_loc: Location.t;
      pld_attributes: attributes; (* l : T [@id1] [@id2] *)
    }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration (*IF_CURRENT = Parsetree.constructor_declaration *) =
    {
      pcd_name: string loc;
      pcd_args: constructor_arguments;
      pcd_res: core_type option;
      pcd_loc: Location.t;
      pcd_attributes: attributes; (* C of ... [@id1] [@id2] *)
    }

  and constructor_arguments (*IF_CURRENT = Parsetree.constructor_arguments *) =
    | Pcstr_tuple of core_type list
    | Pcstr_record of label_declaration list

(*
     | C of T1 * ... * Tn     (res = None,    args = Pcstr_tuple [])
     | C: T0                  (res = Some T0, args = [])
     | C: T1 * ... * Tn -> T0 (res = Some T0, args = Pcstr_tuple)
     | C of {...}             (res = None,    args = Pcstr_record)
     | C: {...} -> T0         (res = Some T0, args = Pcstr_record)
     | C of {...} as t        (res = None,    args = Pcstr_record)
  *)

  and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
    {
      ptyext_path: Longident.t loc;
      ptyext_params: (core_type * variance) list;
      ptyext_constructors: extension_constructor list;
      ptyext_private: private_flag;
      ptyext_loc: Location.t;
      ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
    }
(*
     type t += ...
  *)

  and extension_constructor (*IF_CURRENT = Parsetree.extension_constructor *) =
    {
      pext_name: string loc;
      pext_kind : extension_constructor_kind;
      pext_loc : Location.t;
      pext_attributes: attributes; (* C of ... [@id1] [@id2] *)
    }

  (* exception E *)
  and type_exception (*IF_CURRENT = Parsetree.type_exception *) =
    {
      ptyexn_constructor: extension_constructor;
      ptyexn_loc: Location.t;
      ptyexn_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and extension_constructor_kind (*IF_CURRENT = Parsetree.extension_constructor_kind *) =
      Pext_decl of constructor_arguments * core_type option
      (*
       | C of T1 * ... * Tn     ([T1; ...; Tn], None)
       | C: T0                  ([], Some T0)
       | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
    *)
    | Pext_rebind of Longident.t loc
      (*
       | C = D
    *)

  (** {1 Class language} *)

  (* Type expressions for the class language *)

  and class_type (*IF_CURRENT = Parsetree.class_type *) =
    {
      pcty_desc: class_type_desc;
      pcty_loc: Location.t;
      pcty_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and class_type_desc (*IF_CURRENT = Parsetree.class_type_desc *) =
    | Pcty_constr of Longident.t loc * core_type list
    (* c
       ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
    (* object ... end *)
    | Pcty_arrow of arg_label * core_type * class_type
    (* T -> CT       Simple
       ~l:T -> CT    Labelled l
       ?l:T -> CT    Optional l
    *)
    | Pcty_extension of extension
    (* [%id] *)
    | Pcty_open of open_description * class_type
    (* let open M in CT *)

  and class_signature (*IF_CURRENT = Parsetree.class_signature *) =
    {
      pcsig_self: core_type;
      pcsig_fields: class_type_field list;
    }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
  *)

  and class_type_field (*IF_CURRENT = Parsetree.class_type_field *) =
    {
      pctf_desc: class_type_field_desc;
      pctf_loc: Location.t;
      pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and class_type_field_desc (*IF_CURRENT = Parsetree.class_type_field_desc *) =
    | Pctf_inherit of class_type
    (* inherit CT *)
    | Pctf_val of (label loc * mutable_flag * virtual_flag * core_type)
    (* val x: T *)
    | Pctf_method  of (label loc * private_flag * virtual_flag * core_type)
    (* method x: T

       Note: T can be a Ptyp_poly.
    *)
    | Pctf_constraint  of (core_type * core_type)
    (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
    (* [@@@id] *)
    | Pctf_extension of extension
    (* [%%id] *)

  and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
    {
      pci_virt: virtual_flag;
      pci_params: (core_type * variance) list;
      pci_name: string loc;
      pci_expr: 'a;
      pci_loc: Location.t;
      pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
    }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr (*IF_CURRENT = Parsetree.class_expr *) =
    {
      pcl_desc: class_expr_desc;
      pcl_loc: Location.t;
      pcl_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and class_expr_desc (*IF_CURRENT = Parsetree.class_expr_desc *) =
    | Pcl_constr of Longident.t loc * core_type list
    (* c
       ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
    (* object ... end *)
    | Pcl_fun of arg_label * expression option * pattern * class_expr
    (* fun P -> CE                          (Simple, None)
       fun ~l:P -> CE                       (Labelled l, None)
       fun ?l:P -> CE                       (Optional l, None)
       fun ?l:(P = E0) -> CE                (Optional l, Some E0)
    *)
    | Pcl_apply of class_expr * (arg_label * expression) list
    (* CE ~l1:E1 ... ~ln:En
       li can be empty (non labeled argument) or start with '?'
       (optional argument).

       Invariant: n > 0
    *)
    | Pcl_let of rec_flag * value_binding list * class_expr
    (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
    *)
    | Pcl_constraint of class_expr * class_type
    (* (CE : CT) *)
    | Pcl_extension of extension
    (* [%id] *)
    | Pcl_open of open_description * class_expr
    (* let open M in CE *)


  and class_structure (*IF_CURRENT = Parsetree.class_structure *) =
    {
      pcstr_self: pattern;
      pcstr_fields: class_field list;
    }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
  *)

  and class_field (*IF_CURRENT = Parsetree.class_field *) =
    {
      pcf_desc: class_field_desc;
      pcf_loc: Location.t;
      pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and class_field_desc (*IF_CURRENT = Parsetree.class_field_desc *) =
    | Pcf_inherit of override_flag * class_expr * string loc option
    (* inherit CE
       inherit CE as x
       inherit! CE
       inherit! CE as x
    *)
    | Pcf_val of (label loc * mutable_flag * class_field_kind)
    (* val x = E
       val virtual x: T
    *)
    | Pcf_method of (label loc * private_flag * class_field_kind)
    (* method x = E            (E can be a Pexp_poly)
       method virtual x: T     (T can be a Ptyp_poly)
    *)
    | Pcf_constraint of (core_type * core_type)
    (* constraint T1 = T2 *)
    | Pcf_initializer of expression
    (* initializer E *)
    | Pcf_attribute of attribute
    (* [@@@id] *)
    | Pcf_extension of extension
    (* [%%id] *)

  and class_field_kind (*IF_CURRENT = Parsetree.class_field_kind *) =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {1 Module language} *)

  (* Type expressions for the module language *)

  and module_type (*IF_CURRENT = Parsetree.module_type *) =
    {
      pmty_desc: module_type_desc;
      pmty_loc: Location.t;
      pmty_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and module_type_desc (*IF_CURRENT = Parsetree.module_type_desc *) =
    | Pmty_ident of Longident.t loc
    (* S *)
    | Pmty_signature of signature
    (* sig ... end *)
    | Pmty_functor of string loc * module_type option * module_type
    (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
    (* MT with ... *)
    | Pmty_typeof of module_expr
    (* module type of ME *)
    | Pmty_extension of extension
    (* [%id] *)
    | Pmty_alias of Longident.t loc
    (* (module M) *)

  and signature = signature_item list

  and signature_item (*IF_CURRENT = Parsetree.signature_item *) =
    {
      psig_desc: signature_item_desc;
      psig_loc: Location.t;
    }

  and signature_item_desc (*IF_CURRENT = Parsetree.signature_item_desc *) =
    | Psig_value of value_description
        (*
       val x: T
       external x: T = "s1" ... "sn"
    *)
    | Psig_type of rec_flag * type_declaration list
    (* type t1 = ... and ... and tn  = ... *)
    | Psig_typesubst of type_declaration list
    (* type t1 := ... and ... and tn := ...  *)
    | Psig_typext of type_extension
    (* type t1 += ... *)
    | Psig_exception of type_exception
    (* exception C of T *)
    | Psig_module of module_declaration
    (* module X = M
       module X : MT *)
    | Psig_modsubst of module_substitution
    (* module X := M *)
    | Psig_recmodule of module_declaration list
    (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
    (* module type S = MT
       module type S *)
    | Psig_open of open_description
    (* open X *)
    | Psig_include of include_description
    (* include MT *)
    | Psig_class of class_description list
    (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
    (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
    (* [@@@id] *)
    | Psig_extension of extension * attributes
    (* [%%id] *)

  and module_declaration (*IF_CURRENT = Parsetree.module_declaration *) =
    {
      pmd_name: string loc;
      pmd_type: module_type;
      pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pmd_loc: Location.t;
    }
  (* S : MT *)

  and module_substitution (*IF_CURRENT = Parsetree.module_substitution *) =
    {
      pms_name: string loc;
      pms_manifest: Longident.t loc;
      pms_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pms_loc: Location.t;
    }

  and module_type_declaration (*IF_CURRENT = Parsetree.module_type_declaration *) =
    {
      pmtd_name: string loc;
      pmtd_type: module_type option;
      pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pmtd_loc: Location.t;
    }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and 'a open_infos (*IF_CURRENT = 'a Parsetree.open_infos *) =
    {
      popen_expr: 'a;
      popen_override: override_flag;
      popen_loc: Location.t;
      popen_attributes: attributes;
    }
  (* open! X - popen_override = Override (silences the 'used identifier
     shadowing' warning)
     open  X - popen_override = Fresh
  *)

  and open_description = Longident.t loc open_infos
  (* open M.N
     open M(N).O *)

  and open_declaration = module_expr open_infos
  (* open M.N
     open M(N).O
     open struct ... end *)

  and 'a include_infos (*IF_CURRENT = 'a Parsetree.include_infos *) =
    {
      pincl_mod: 'a;
      pincl_loc: Location.t;
      pincl_attributes: attributes;
    }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint (*IF_CURRENT = Parsetree.with_constraint *) =
    | Pwith_type of Longident.t loc * type_declaration
    (* with type X.t = ...

       Note: the last component of the longident must match
       the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
    (* with module X.Y = Z *)
    | Pwith_typesubst of Longident.t loc * type_declaration
    (* with type X.t := ..., same format as [Pwith_type] *)
    | Pwith_modsubst of Longident.t loc * Longident.t loc
    (* with module X.Y := Z *)

  (* Value expressions for the module language *)

  and module_expr (*IF_CURRENT = Parsetree.module_expr *) =
    {
      pmod_desc: module_expr_desc;
      pmod_loc: Location.t;
      pmod_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and module_expr_desc (*IF_CURRENT = Parsetree.module_expr_desc *) =
    | Pmod_ident of Longident.t loc
    (* X *)
    | Pmod_structure of structure
    (* struct ... end *)
    | Pmod_functor of string loc * module_type option * module_expr
    (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
    (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
    (* (ME : MT) *)
    | Pmod_unpack of expression
    (* (val E) *)
    | Pmod_extension of extension
    (* [%id] *)

  and structure = structure_item list

  and structure_item (*IF_CURRENT = Parsetree.structure_item *) =
    {
      pstr_desc: structure_item_desc;
      pstr_loc: Location.t;
    }

  and structure_item_desc (*IF_CURRENT = Parsetree.structure_item_desc *) =
    | Pstr_eval of expression * attributes
    (* E *)
    | Pstr_value of rec_flag * value_binding list
    (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
    *)
    | Pstr_primitive of value_description
    (*  val x: T
        external x: T = "s1" ... "sn" *)
    | Pstr_type of rec_flag * type_declaration list
    (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
    (* type t1 += ... *)
    | Pstr_exception of type_exception
    (* exception C of T
       exception C = M.X *)
    | Pstr_module of module_binding
    (* module X = ME *)
    | Pstr_recmodule of module_binding list
    (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
    (* module type S = MT *)
    | Pstr_open of open_declaration
    (* open X *)
    | Pstr_class of class_declaration list
    (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
    (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
    (* include ME *)
    | Pstr_attribute of attribute
    (* [@@@id] *)
    | Pstr_extension of extension * attributes
    (* [%%id] *)

  and value_binding (*IF_CURRENT = Parsetree.value_binding *) =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding (*IF_CURRENT = Parsetree.module_binding *) =
    {
      pmb_name: string loc;
      pmb_expr: module_expr;
      pmb_attributes: attributes;
      pmb_loc: Location.t;
    }
  (* X = ME *)

  (** {1 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase (*IF_CURRENT = Parsetree.toplevel_phrase *) =
    | Ptop_def of structure
    | Ptop_dir of toplevel_directive
    (* #use, #load ... *)

  and toplevel_directive (*IF_CURRENT = Parsetree.toplevel_directive *) =
    {
      pdir_name : string loc;
      pdir_arg : directive_argument option;
      pdir_loc : Location.t;
    }

  and directive_argument (*IF_CURRENT = Parsetree.directive_argument *) =
    {
      pdira_desc : directive_argument_desc;
      pdira_loc : Location.t;
    }

  and directive_argument_desc (*IF_CURRENT = Parsetree.directive_argument_desc *) =
    | Pdir_string of string
    | Pdir_int of string * char option
    | Pdir_ident of Longident.t
    | Pdir_bool of bool

end

module Docstrings : sig
  (** (Re)Initialise all docstring state *)
  val init : unit -> unit

  (** Emit warnings for unattached and ambiguous docstrings *)
  val warn_bad_docstrings : unit -> unit

  (** {2 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Register a docstring *)
  val register : docstring -> unit

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {2 Set functions}

      These functions are used by the lexer to associate docstrings to
      the locations of tokens. *)

  (** Docstrings immediately preceding a token *)
  val set_pre_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately following a token *)
  val set_post_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings not immediately adjacent to a token *)
  val set_floating_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately following the token which precedes this one *)
  val set_pre_extra_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately preceding the token which follows this one *)
  val set_post_extra_docstrings : Lexing.position -> docstring list -> unit

  (** {2 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the item documentation for the current symbol. This also
      marks this documentation (for ambiguity warnings). *)
  val symbol_docs : unit -> docs
  val symbol_docs_lazy : unit -> docs Lazy.t

  (** Fetch the item documentation for the symbols between two
      positions. This also marks this documentation (for ambiguity
      warnings). *)
  val rhs_docs : int -> int -> docs
  val rhs_docs_lazy : int -> int -> docs Lazy.t

  (** Mark the item documentation for the current symbol (for ambiguity
      warnings). *)
  val mark_symbol_docs : unit -> unit

  (** Mark as associated the item documentation for the symbols between
      two positions (for ambiguity warnings) *)
  val mark_rhs_docs : int -> int -> unit

  (** {2 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the field info for the current symbol. *)
  val symbol_info : unit -> info

  (** Fetch the field info following the symbol at a given position. *)
  val rhs_info : int -> info

  (** {2 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text
  val empty_text_lazy : text Lazy.t

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the text preceding the current symbol. *)
  val symbol_text : unit -> text
  val symbol_text_lazy : unit -> text Lazy.t

  (** Fetch the text preceding the symbol at the given position. *)
  val rhs_text : int -> text
  val rhs_text_lazy : int -> text Lazy.t

  (** {2 Extra text}

      There may be additional text attached to the delimiters of a block
      (e.g. [struct] and [end]). This is fetched by the following
      functions, which are applied to the contents of the block rather
      than the delimiters. *)

  (** Fetch additional text preceding the current symbol *)
  val symbol_pre_extra_text : unit -> text

  (** Fetch additional text following the current symbol *)
  val symbol_post_extra_text : unit -> text

  (** Fetch additional text preceding the symbol at the given position *)
  val rhs_pre_extra_text : int -> text

  (** Fetch additional text following the symbol at the given position *)
  val rhs_post_extra_text : int -> text

  (** Fetch text following the symbol at the given position *)
  val rhs_post_text : int -> text

  module WithMenhir: sig
    (** Fetch the item documentation for the current symbol. This also
        marks this documentation (for ambiguity warnings). *)
    val symbol_docs : Lexing.position * Lexing.position -> docs
    val symbol_docs_lazy : Lexing.position * Lexing.position -> docs Lazy.t

    (** Fetch the item documentation for the symbols between two
        positions. This also marks this documentation (for ambiguity
        warnings). *)
    val rhs_docs : Lexing.position -> Lexing.position -> docs
    val rhs_docs_lazy : Lexing.position -> Lexing.position -> docs Lazy.t

    (** Mark the item documentation for the current symbol (for ambiguity
        warnings). *)
    val mark_symbol_docs : Lexing.position * Lexing.position -> unit

    (** Mark as associated the item documentation for the symbols between
        two positions (for ambiguity warnings) *)
    val mark_rhs_docs : Lexing.position -> Lexing.position -> unit

    (** Fetch the field info for the current symbol. *)
    val symbol_info : Lexing.position -> info

    (** Fetch the field info following the symbol at a given position. *)
    val rhs_info : Lexing.position -> info

    (** Fetch the text preceding the current symbol. *)
    val symbol_text : Lexing.position -> text
    val symbol_text_lazy : Lexing.position -> text Lazy.t

    (** Fetch the text preceding the symbol at the given position. *)
    val rhs_text : Lexing.position -> text
    val rhs_text_lazy : Lexing.position -> text Lazy.t

    (** {3 Extra text}

        There may be additional text attached to the delimiters of a block
        (e.g. [struct] and [end]). This is fetched by the following
        functions, which are applied to the contents of the block rather
        than the delimiters. *)

    (** Fetch additional text preceding the current symbol *)
    val symbol_pre_extra_text : Lexing.position -> text

    (** Fetch additional text following the current symbol *)
    val symbol_post_extra_text : Lexing.position -> text

    (** Fetch additional text preceding the symbol at the given position *)
    val rhs_pre_extra_text : Lexing.position -> text

    (** Fetch additional text following the symbol at the given position *)
    val rhs_post_extra_text : Lexing.position -> text

    (** Fetch text following the symbol at the given position *)
    val rhs_post_text : Lexing.position -> text

  end
end = struct
  open Location

  (* Docstrings *)

  (* A docstring is "attached" if it has been inserted in the AST. This
     is used for generating unexpected docstring warnings. *)
  type ds_attached =
    | Unattached   (* Not yet attached anything.*)
    | Info         (* Attached to a field or constructor. *)
    | Docs         (* Attached to an item or as floating text. *)

  (* A docstring is "associated" with an item if there are no blank lines between
     them. This is used for generating docstring ambiguity warnings. *)
  type ds_associated =
    | Zero             (* Not associated with an item *)
    | One              (* Associated with one item *)
    | Many             (* Associated with multiple items (ambiguity) *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t;
      mutable ds_attached: ds_attached;
      mutable ds_associated: ds_associated; }

  (* List of docstrings *)

  let docstrings : docstring list ref = ref []

  (* Warn for unused and ambiguous docstrings *)

  let warn_bad_docstrings () =
    if Warnings.is_active (Warnings.Bad_docstring true) then begin
      List.iter
        (fun ds ->
           match ds.ds_attached with
           | Info -> ()
           | Unattached ->
             prerr_warning ds.ds_loc (Warnings.Bad_docstring true)
           | Docs ->
             match ds.ds_associated with
             | Zero | One -> ()
             | Many ->
               prerr_warning ds.ds_loc (Warnings.Bad_docstring false))
        (List.rev !docstrings)
    end

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc;
        ds_attached = Unattached;
        ds_associated = Zero; }
    in
    ds

  let register ds =
    docstrings := ds :: !docstrings

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_loc_stack = [];
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
    { attr_name = doc_loc;
      attr_payload = PStr [item];
      attr_loc = Location.none }

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []
  let empty_text_lazy = lazy []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_loc_stack = [];
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
    { attr_name = text_loc;
      attr_payload = PStr [item];
      attr_loc = Location.none }

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""; _} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

  (* Find the first non-info docstring in a list, attach it and return it *)
  let get_docstring ~info dsl =
    let rec loop = function
      | [] -> None
      | {ds_attached = Info; _} :: rest -> loop rest
      | ds :: _ ->
        ds.ds_attached <- if info then Info else Docs;
        Some ds
    in
    loop dsl

  (* Find all the non-info docstrings in a list, attach them and return them *)
  let get_docstrings dsl =
    let rec loop acc = function
      | [] -> List.rev acc
      | {ds_attached = Info; _} :: rest -> loop acc rest
      | ds :: rest ->
        ds.ds_attached <- Docs;
        loop (ds :: acc) rest
    in
    loop [] dsl

  (* "Associate" all the docstrings in a list *)
  let associate_docstrings dsl =
    List.iter
      (fun ds ->
         match ds.ds_associated with
         | Zero -> ds.ds_associated <- One
         | (One | Many) -> ds.ds_associated <- Many)
      dsl

  (* Map from positions to pre docstrings *)

  let pre_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_pre_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add pre_table pos dsl

  let get_pre_docs pos =
    try
      let dsl = Hashtbl.find pre_table pos in
      associate_docstrings dsl;
      get_docstring ~info:false dsl
    with Not_found -> None

  let mark_pre_docs pos =
    try
      let dsl = Hashtbl.find pre_table pos in
      associate_docstrings dsl
    with Not_found -> ()

  (* Map from positions to post docstrings *)

  let post_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_post_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add post_table pos dsl

  let get_post_docs pos =
    try
      let dsl = Hashtbl.find post_table pos in
      associate_docstrings dsl;
      get_docstring ~info:false dsl
    with Not_found -> None

  let mark_post_docs pos =
    try
      let dsl = Hashtbl.find post_table pos in
      associate_docstrings dsl
    with Not_found -> ()

  let get_info pos =
    try
      let dsl = Hashtbl.find post_table pos in
      get_docstring ~info:true dsl
    with Not_found -> None

  (* Map from positions to floating docstrings *)

  let floating_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_floating_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add floating_table pos dsl

  let get_text pos =
    try
      let dsl = Hashtbl.find floating_table pos in
      get_docstrings dsl
    with Not_found -> []

  let get_post_text pos =
    try
      let dsl = Hashtbl.find post_table pos in
      get_docstrings dsl
    with Not_found -> []

  (* Maps from positions to extra docstrings *)

  let pre_extra_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_pre_extra_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add pre_extra_table pos dsl

  let get_pre_extra_text pos =
    try
      let dsl = Hashtbl.find pre_extra_table pos in
      get_docstrings dsl
    with Not_found -> []

  let post_extra_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_post_extra_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add post_extra_table pos dsl

  let get_post_extra_text pos =
    try
      let dsl = Hashtbl.find post_extra_table pos in
      get_docstrings dsl
    with Not_found -> []

  (* Docstrings from parser actions *)
  module WithParsing = struct
    let symbol_docs () =
      { docs_pre = get_pre_docs (Parsing.symbol_start_pos ());
        docs_post = get_post_docs (Parsing.symbol_end_pos ()); }

    let symbol_docs_lazy () =
      let p1 = Parsing.symbol_start_pos () in
      let p2 = Parsing.symbol_end_pos () in
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let rhs_docs pos1 pos2 =
      { docs_pre = get_pre_docs (Parsing.rhs_start_pos pos1);
        docs_post = get_post_docs (Parsing.rhs_end_pos pos2); }

    let rhs_docs_lazy pos1 pos2 =
      let p1 = Parsing.rhs_start_pos pos1 in
      let p2 = Parsing.rhs_end_pos pos2 in
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let mark_symbol_docs () =
      mark_pre_docs (Parsing.symbol_start_pos ());
      mark_post_docs (Parsing.symbol_end_pos ())

    let mark_rhs_docs pos1 pos2 =
      mark_pre_docs (Parsing.rhs_start_pos pos1);
      mark_post_docs (Parsing.rhs_end_pos pos2)

    let symbol_info () =
      get_info (Parsing.symbol_end_pos ())

    let rhs_info pos =
      get_info (Parsing.rhs_end_pos pos)

    let symbol_text () =
      get_text (Parsing.symbol_start_pos ())

    let symbol_text_lazy () =
      let pos = Parsing.symbol_start_pos () in
      lazy (get_text pos)

    let rhs_text pos =
      get_text (Parsing.rhs_start_pos pos)

    let rhs_post_text pos =
      get_post_text (Parsing.rhs_end_pos pos)

    let rhs_text_lazy pos =
      let pos = Parsing.rhs_start_pos pos in
      lazy (get_text pos)

    let symbol_pre_extra_text () =
      get_pre_extra_text (Parsing.symbol_start_pos ())

    let symbol_post_extra_text () =
      get_post_extra_text (Parsing.symbol_end_pos ())

    let rhs_pre_extra_text pos =
      get_pre_extra_text (Parsing.rhs_start_pos pos)

    let rhs_post_extra_text pos =
      get_post_extra_text (Parsing.rhs_end_pos pos)
  end

  include WithParsing

  module WithMenhir = struct
    let symbol_docs (startpos, endpos) =
      { docs_pre = get_pre_docs startpos;
        docs_post = get_post_docs endpos; }

    let symbol_docs_lazy (p1, p2) =
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let rhs_docs pos1 pos2 =
      { docs_pre = get_pre_docs pos1;
        docs_post = get_post_docs pos2; }

    let rhs_docs_lazy p1 p2 =
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let mark_symbol_docs (startpos, endpos) =
      mark_pre_docs startpos;
      mark_post_docs endpos;
      ()

    let mark_rhs_docs pos1 pos2 =
      mark_pre_docs pos1;
      mark_post_docs pos2;
      ()

    let symbol_info endpos =
      get_info endpos

    let rhs_info endpos =
      get_info endpos

    let symbol_text startpos =
      get_text startpos

    let symbol_text_lazy startpos =
      lazy (get_text startpos)

    let rhs_text pos =
      get_text pos

    let rhs_post_text pos =
      get_post_text pos

    let rhs_text_lazy pos =
      lazy (get_text pos)

    let symbol_pre_extra_text startpos =
      get_pre_extra_text startpos

    let symbol_post_extra_text endpos =
      get_post_extra_text endpos

    let rhs_pre_extra_text pos =
      get_pre_extra_text pos

    let rhs_post_extra_text pos =
      get_post_extra_text pos
  end

  (* (Re)Initialise all comment state *)

  let init () =
    docstrings := [];
    Hashtbl.reset pre_table;
    Hashtbl.reset post_table;
    Hashtbl.reset floating_table;
    Hashtbl.reset pre_extra_table;
    Hashtbl.reset post_extra_table
end

module Ast_helper : sig
  open Asttypes
  open Docstrings
  open Parsetree

  type 'a with_loc = 'a Location.loc
  type loc = Location.t

  type lid = Longident.t with_loc
  type str = string with_loc
  type attrs = attribute list

  (** {1 Default locations} *)

  val default_loc: loc ref
  (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
  (** Set the [default_loc] within the scope of the execution
      of the provided function. *)

  (** {1 Constants} *)

  module Const : sig
    val char : char -> constant
    val string : ?quotation_delimiter:string -> string -> constant
    val integer : ?suffix:char -> string -> constant
    val int : ?suffix:char -> int -> constant
    val int32 : ?suffix:char -> int32 -> constant
    val int64 : ?suffix:char -> int64 -> constant
    val nativeint : ?suffix:char -> nativeint -> constant
    val float : ?suffix:char -> string -> constant
  end

  (** {1 Attributes} *)
  module Attr : sig
    val mk: ?loc:loc -> str -> payload -> attribute
  end

  (** {1 Core language} *)

  (** Type expressions *)
  module Typ :
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
    val attr: core_type -> attribute -> core_type

    val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
    val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
    val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type -> core_type
      -> core_type
    val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
    val object_: ?loc:loc -> ?attrs:attrs -> object_field list
      -> closed_flag -> core_type
    val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
    val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
    val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
      -> label list option -> core_type
    val poly: ?loc:loc -> ?attrs:attrs -> str list -> core_type -> core_type
    val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
      -> core_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

    val force_poly: core_type -> core_type

    val varify_constructors: str list -> core_type -> core_type
    (** [varify_constructors newtypes te] is type expression [te], of which
        any of nullary type constructor [tc] is replaced by type variable of
        the same name, if [tc]'s name appears in [newtypes].
        Raise [Syntaxerr.Variable_in_scope] if any type variable inside [te]
        appears in [newtypes].
        @since 4.05
    *)
  end

  (** Patterns *)
  module Pat:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
    val attr:pattern -> attribute -> pattern

    val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
    val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
    val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
    val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
    val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
    val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
    val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
    val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
    val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
      -> pattern
    val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
    val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
    val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
    val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
    val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
    val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
    val open_: ?loc:loc -> ?attrs:attrs  -> lid -> pattern -> pattern
    val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
  end

  (** Expressions *)
  module Exp:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
    val attr: expression -> attribute -> expression

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
    val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
    val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
      -> expression -> expression
    val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option
      -> pattern -> expression -> expression
    val function_: ?loc:loc -> ?attrs:attrs -> cases -> expression
    val apply: ?loc:loc -> ?attrs:attrs -> expression
      -> (arg_label * expression) list -> expression
    val match_: ?loc:loc -> ?attrs:attrs -> expression -> cases
      -> expression
    val try_: ?loc:loc -> ?attrs:attrs -> expression -> cases -> expression
    val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
    val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
      -> expression
    val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
      -> expression
    val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
      -> expression option -> expression
    val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
    val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      -> expression
    val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
    val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression option -> expression
    val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression
    val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression
    val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
      -> direction_flag -> expression -> expression
    val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
      -> core_type -> expression
    val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
      -> expression
    val send: ?loc:loc -> ?attrs:attrs -> expression -> str -> expression
    val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
    val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
    val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
      -> expression
    val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
      -> expression
    val letexception:
      ?loc:loc -> ?attrs:attrs -> extension_constructor -> expression
      -> expression
    val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
    val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
    val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
      -> expression
    val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
    val newtype: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
    val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
    val open_: ?loc:loc -> ?attrs:attrs -> open_declaration -> expression
      -> expression
    val letop: ?loc:loc -> ?attrs:attrs -> binding_op
      -> binding_op list -> expression -> expression
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression
    val unreachable: ?loc:loc -> ?attrs:attrs -> unit -> expression

    val case: pattern -> ?guard:expression -> expression -> case
    val binding_op: str -> pattern -> expression -> loc -> binding_op
  end

  (** Value declarations *)
  module Val:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      ?prim:string list -> str -> core_type -> value_description
  end

  (** Type declarations *)
  module Type:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?params:(core_type * variance) list ->
      ?cstrs:(core_type * core_type * loc) list ->
      ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
      type_declaration

    val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
      ?args:constructor_arguments -> ?res:core_type -> str ->
      constructor_declaration
    val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
      ?mut:mutable_flag -> str -> core_type -> label_declaration
  end

  (** Type extensions *)
  module Te:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      ?params:(core_type * variance) list -> ?priv:private_flag ->
      lid -> extension_constructor list -> type_extension

    val mk_exception: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      extension_constructor -> type_exception

    val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      str -> extension_constructor_kind -> extension_constructor

    val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      ?args:constructor_arguments -> ?res:core_type -> str ->
      extension_constructor
    val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      str -> lid -> extension_constructor
  end

  (** {1 Module language} *)

  (** Module type expressions *)
  module Mty:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
    val attr: module_type -> attribute -> module_type

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
    val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
    val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
    val functor_: ?loc:loc -> ?attrs:attrs ->
      str -> module_type option -> module_type -> module_type
    val with_: ?loc:loc -> ?attrs:attrs -> module_type ->
      with_constraint list -> module_type
    val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
  end

  (** Module expressions *)
  module Mod:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
    val attr: module_expr -> attribute -> module_expr

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
    val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
    val functor_: ?loc:loc -> ?attrs:attrs ->
      str -> module_type option -> module_expr -> module_expr
    val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr ->
      module_expr
    val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type ->
      module_expr
    val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
  end

  (** Signature items *)
  module Sig:
  sig
    val mk: ?loc:loc -> signature_item_desc -> signature_item

    val value: ?loc:loc -> value_description -> signature_item
    val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item
    val type_subst: ?loc:loc -> type_declaration list -> signature_item
    val type_extension: ?loc:loc -> type_extension -> signature_item
    val exception_: ?loc:loc -> type_exception -> signature_item
    val module_: ?loc:loc -> module_declaration -> signature_item
    val mod_subst: ?loc:loc -> module_substitution -> signature_item
    val rec_module: ?loc:loc -> module_declaration list -> signature_item
    val modtype: ?loc:loc -> module_type_declaration -> signature_item
    val open_: ?loc:loc -> open_description -> signature_item
    val include_: ?loc:loc -> include_description -> signature_item
    val class_: ?loc:loc -> class_description list -> signature_item
    val class_type: ?loc:loc -> class_type_declaration list -> signature_item
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
    val attribute: ?loc:loc -> attribute -> signature_item
    val text: text -> signature_item list
  end

  (** Structure items *)
  module Str:
  sig
    val mk: ?loc:loc -> structure_item_desc -> structure_item

    val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
    val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
    val primitive: ?loc:loc -> value_description -> structure_item
    val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item
    val type_extension: ?loc:loc -> type_extension -> structure_item
    val exception_: ?loc:loc -> type_exception -> structure_item
    val module_: ?loc:loc -> module_binding -> structure_item
    val rec_module: ?loc:loc -> module_binding list -> structure_item
    val modtype: ?loc:loc -> module_type_declaration -> structure_item
    val open_: ?loc:loc -> open_declaration -> structure_item
    val class_: ?loc:loc -> class_declaration list -> structure_item
    val class_type: ?loc:loc -> class_type_declaration list -> structure_item
    val include_: ?loc:loc -> include_declaration -> structure_item
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
    val attribute: ?loc:loc -> attribute -> structure_item
    val text: text -> structure_item list
  end

  (** Module declarations *)
  module Md:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> module_type -> module_declaration
  end

  (** Module substitutions *)
  module Ms:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> lid -> module_substitution
  end

  (** Module type declarations *)
  module Mtd:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?typ:module_type -> str -> module_type_declaration
  end

  (** Module bindings *)
  module Mb:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> module_expr -> module_binding
  end

  (** Opens *)
  module Opn:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
      ?override:override_flag -> 'a -> 'a open_infos
  end

  (** Includes *)
  module Incl:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
  end

  (** Value bindings *)
  module Vb:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      pattern -> expression -> value_binding
  end


  (** {1 Class language} *)

  (** Class type expressions *)
  module Cty:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
    val attr: class_type -> attribute -> class_type

    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
    val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
    val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type ->
      class_type -> class_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
    val open_: ?loc:loc -> ?attrs:attrs -> open_description -> class_type
      -> class_type
  end

  (** Class type fields *)
  module Ctf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      class_type_field_desc -> class_type_field
    val attr: class_type_field -> attribute -> class_type_field

    val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
    val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
      virtual_flag -> core_type -> class_type_field
    val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
      virtual_flag -> core_type -> class_type_field
    val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
      class_type_field
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
    val attribute: ?loc:loc -> attribute -> class_type_field
    val text: text -> class_type_field list
  end

  (** Class expressions *)
  module Cl:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
    val attr: class_expr -> attribute -> class_expr

    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
    val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
    val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option ->
      pattern -> class_expr -> class_expr
    val apply: ?loc:loc -> ?attrs:attrs -> class_expr ->
      (arg_label * expression) list -> class_expr
    val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list ->
      class_expr -> class_expr
    val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type ->
      class_expr
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
    val open_: ?loc:loc -> ?attrs:attrs -> open_description -> class_expr
      -> class_expr
  end

  (** Class fields *)
  module Cf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
      class_field
    val attr: class_field -> attribute -> class_field

    val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr ->
      str option -> class_field
    val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
      class_field_kind -> class_field
    val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
      class_field_kind -> class_field
    val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
      class_field
    val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
    val attribute: ?loc:loc -> attribute -> class_field
    val text: text -> class_field list

    val virtual_: core_type -> class_field_kind
    val concrete: override_flag -> expression -> class_field_kind

  end

  (** Classes *)
  module Ci:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?virt:virtual_flag -> ?params:(core_type * variance) list ->
      str -> 'a -> 'a class_infos
  end

  (** Class signatures *)
  module Csig:
  sig
    val mk: core_type -> class_type_field list -> class_signature
  end

  (** Class structures *)
  module Cstr:
  sig
    val mk: pattern -> class_field list -> class_structure
  end

  (** Row fields *)
  module Rf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> row_field_desc -> row_field
    val tag: ?loc:loc -> ?attrs:attrs ->
      label with_loc -> bool -> core_type list -> row_field
    val inherit_: ?loc:loc -> core_type -> row_field
  end

  (** Object fields *)
  module Of:
  sig
    val mk: ?loc:loc -> ?attrs:attrs ->
      object_field_desc -> object_field
    val tag: ?loc:loc -> ?attrs:attrs ->
      label with_loc -> core_type -> object_field
    val inherit_: ?loc:loc -> core_type -> object_field
  end
end = struct
  open Asttypes
  open Parsetree
  open Docstrings

  type 'a with_loc = 'a Location.loc
  type loc = Location.t

  type lid = Longident.t with_loc
  type str = string with_loc
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    Misc.protect_refs [Misc.R (default_loc, l)] f

  module Const = struct
    let integer ?suffix i = Pconst_integer (i, suffix)
    let int ?suffix i = integer ?suffix (Int.to_string i)
    let int32 ?(suffix='l') i = integer ~suffix (Int32.to_string i)
    let int64 ?(suffix='L') i = integer ~suffix (Int64.to_string i)
    let nativeint ?(suffix='n') i = integer ~suffix (Nativeint.to_string i)
    let float ?suffix f = Pconst_float (f, suffix)
    let char c = Pconst_char c
    let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter)
  end

  module Attr = struct
    let mk ?(loc= !default_loc) name payload =
      { attr_name = name;
        attr_payload = payload;
        attr_loc = loc }
  end

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d;
       ptyp_loc = loc;
       ptyp_loc_stack = [];
       ptyp_attributes = attrs}

    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)

    let varify_constructors var_names t =
      let check_variable vl loc v =
        if List.mem v vl then
          raise Syntaxerr.(Error(Variable_in_scope(loc,v))) in
      let var_names = List.map (fun v -> v.txt) var_names in
      let rec loop t =
        let desc =
          match t.ptyp_desc with
          | Ptyp_any -> Ptyp_any
          | Ptyp_var x ->
            check_variable var_names t.ptyp_loc x;
            Ptyp_var x
          | Ptyp_arrow (label,core_type,core_type') ->
            Ptyp_arrow(label, loop core_type, loop core_type')
          | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
          | Ptyp_constr( { txt = Longident.Lident s; _ }, [])
            when List.mem s var_names ->
            Ptyp_var s
          | Ptyp_constr(longident, lst) ->
            Ptyp_constr(longident, List.map loop lst)
          | Ptyp_object (lst, o) ->
            Ptyp_object (List.map loop_object_field lst, o)
          | Ptyp_class (longident, lst) ->
            Ptyp_class (longident, List.map loop lst)
          | Ptyp_alias(core_type, string) ->
            check_variable var_names t.ptyp_loc string;
            Ptyp_alias(loop core_type, string)
          | Ptyp_variant(row_field_list, flag, lbl_lst_option) ->
            Ptyp_variant(List.map loop_row_field row_field_list,
                         flag, lbl_lst_option)
          | Ptyp_poly(string_lst, core_type) ->
            List.iter (fun v ->
              check_variable var_names t.ptyp_loc v.txt) string_lst;
            Ptyp_poly(string_lst, loop core_type)
          | Ptyp_package(longident,lst) ->
            Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
          | Ptyp_extension (s, arg) ->
            Ptyp_extension (s, arg)
        in
        {t with ptyp_desc = desc}
      and loop_row_field field =
        let prf_desc = match field.prf_desc with
          | Rtag(label,flag,lst) ->
            Rtag(label,flag,List.map loop lst)
          | Rinherit t ->
            Rinherit (loop t)
        in
        { field with prf_desc; }
      and loop_object_field field =
        let pof_desc = match field.pof_desc with
          | Otag(label, t) ->
            Otag(label, loop t)
          | Oinherit t ->
            Oinherit (loop t)
        in
        { field with pof_desc; }
      in
      loop t

  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d;
       ppat_loc = loc;
       ppat_loc_stack = [];
       ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b))
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d;
       pexp_loc = loc;
       pexp_loc_stack = [];
       pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let letexception ?loc ?attrs a b = mk ?loc ?attrs (Pexp_letexception (a, b))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_open (a, b))
    let letop ?loc ?attrs let_ ands body =
      mk ?loc ?attrs (Pexp_letop {let_; ands; body})
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)
    let unreachable ?loc ?attrs () = mk ?loc ?attrs Pexp_unreachable

    let case lhs ?guard rhs =
      {
        pc_lhs = lhs;
        pc_guard = guard;
        pc_rhs = rhs;
      }

    let binding_op op pat exp loc =
      {
        pbop_op = op;
        pbop_pat = pat;
        pbop_exp = exp;
        pbop_loc = loc;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg arg_ty body =
      mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc rec_flag a = mk ?loc (Psig_type (rec_flag, a))
    let type_subst ?loc a = mk ?loc (Psig_typesubst a)
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let mod_subst ?loc a = mk ?loc (Psig_modsubst a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
        pcl_desc = d;
        pcl_loc = loc;
        pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_open (a, b))
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
        pcty_desc = d;
        pcty_loc = loc;
        pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pcty_open (a, b))
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
        pctf_desc = d;
        pctf_loc = loc;
        pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
        pcf_desc = d;
        pcf_loc = loc;
        pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(prim = []) name typ =
      {
        pval_name = name;
        pval_type = typ;
        pval_attributes = add_docs_attrs docs attrs;
        pval_loc = loc;
        pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name typ =
      {
        pmd_name = name;
        pmd_type = typ;
        pmd_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmd_loc = loc;
      }
  end

  module Ms = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name syn =
      {
        pms_name = name;
        pms_manifest = syn;
        pms_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pms_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) ?typ name =
      {
        pmtd_name = name;
        pmtd_type = typ;
        pmtd_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name expr =
      {
        pmb_name = name;
        pmb_expr = expr;
        pmb_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(override = Fresh) expr =
      {
        popen_expr = expr;
        popen_override = override;
        popen_loc = loc;
        popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
        pincl_mod = mexpr;
        pincl_loc = loc;
        pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(text = []) pat expr =
      {
        pvb_pat = pat;
        pvb_expr = expr;
        pvb_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(virt = Concrete) ?(params = []) name expr =
      {
        pci_virt = virt;
        pci_params = params;
        pci_name = name;
        pci_expr = expr;
        pci_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(params = [])
          ?(cstrs = [])
          ?(kind = Ptype_abstract)
          ?(priv = Public)
          ?manifest
          name =
      {
        ptype_name = name;
        ptype_params = params;
        ptype_cstrs = cstrs;
        ptype_kind = kind;
        ptype_private = priv;
        ptype_manifest = manifest;
        ptype_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(args = Pcstr_tuple []) ?res name =
      {
        pcd_name = name;
        pcd_args = args;
        pcd_res = res;
        pcd_loc = loc;
        pcd_attributes = add_info_attrs info attrs;
      }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(mut = Immutable) name typ =
      {
        pld_name = name;
        pld_mutable = mut;
        pld_type = typ;
        pld_loc = loc;
        pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(params = []) ?(priv = Public) path constructors =
      {
        ptyext_path = path;
        ptyext_params = params;
        ptyext_constructors = constructors;
        ptyext_private = priv;
        ptyext_loc = loc;
        ptyext_attributes = add_docs_attrs docs attrs;
      }

    let mk_exception ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          constructor =
      {
        ptyexn_constructor = constructor;
        ptyexn_loc = loc;
        ptyexn_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
        pext_name = name;
        pext_kind = kind;
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(info = empty_info) ?(args = Pcstr_tuple []) ?res name =
      {
        pext_name = name;
        pext_kind = Pext_decl(args, res);
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
        pext_name = name;
        pext_kind = Pext_rebind lid;
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
        pcsig_self = self;
        pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
        pcstr_self = self;
        pcstr_fields = fields;
      }
  end

  (** Row fields *)
  module Rf = struct
    let mk ?(loc = !default_loc) ?(attrs = []) desc = {
      prf_desc = desc;
      prf_loc = loc;
      prf_attributes = attrs;
    }
    let tag ?loc ?attrs label const tys =
      mk ?loc ?attrs (Rtag (label, const, tys))
    let inherit_?loc ty =
      mk ?loc (Rinherit ty)
  end

  (** Object fields *)
  module Of = struct
    let mk ?(loc = !default_loc) ?(attrs=[]) desc = {
      pof_desc = desc;
      pof_loc = loc;
      pof_attributes = attrs;
    }
    let tag ?loc ?attrs label ty =
      mk ?loc ?attrs (Otag (label, ty))
    let inherit_ ?loc ty =
      mk ?loc (Oinherit ty)
  end
end

module Ast_mapper : sig
  open Parsetree

  (** {1 A generic Parsetree mapper} *)

  type mapper (*IF_CURRENT = Ast_mapper.mapper *) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    binding_op: mapper -> binding_op -> binding_op;
    case: mapper -> case -> case;
    cases: mapper -> cases -> cases;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
      -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
      -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
      -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_substitution: mapper -> module_substitution -> module_substitution;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
      -> module_type_declaration;
    open_declaration: mapper -> open_declaration -> open_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_exception: mapper -> type_exception -> type_exception;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {1 Apply mappers to compilation units} *)

  val tool_name: unit -> string
  (** Can be used within a ppx preprocessor to know which tool is
      calling it ["ocamlc"], ["ocamlopt"], ["ocamldoc"], ["ocamldep"],
      ["ocaml"], ...  Some global variables that reflect command-line
      options are automatically synchronized between the calling tool
      and the ppx preprocessor: {!Clflags.include_dirs},
      {!Load_path}, {!Clflags.open_modules}, {!Clflags.for_package},
      {!Clflags.debug}. *)


  val apply: source:string -> target:string -> mapper -> unit
  (** Apply a mapper (parametrized by the unit name) to a dumped
      parsetree found in the [source] file and put the result in the
      [target] file. The [structure] or [signature] field of the mapper
      is applied to the implementation or interface.  *)

  val run_main: (string list -> mapper) -> unit
  (** Entry point to call to implement a standalone -ppx rewriter from a
      mapper, parametrized by the command line arguments.  The current
      unit name can be obtained from {!Location.input_name}.  This
      function implements proper error reporting for uncaught
      exceptions. *)

  (** {1 Registration API} *)

  val register_function: (string -> (string list -> mapper) -> unit) ref

  val register: string -> (string list -> mapper) -> unit
  (** Apply the [register_function].  The default behavior is to run the
      mapper immediately, taking arguments from the process command
      line.  This is to support a scenario where a mapper is linked as a
      stand-alone executable.

      It is possible to overwrite the [register_function] to define
      "-ppx drivers", which combine several mappers in a single process.
      Typically, a driver starts by defining [register_function] to a
      custom implementation, then lets ppx rewriters (linked statically
      or dynamically) register themselves, and then run all or some of
      them.  It is also possible to have -ppx drivers apply rewriters to
      only specific parts of an AST.

      The first argument to [register] is a symbolic name to be used by
      the ppx driver.  *)


  (** {1 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

  include Locations.Helpers_intf

  (** {1 Helper functions to call external mappers} *)

  val add_ppx_context_str:
    tool_name:string -> Parsetree.structure -> Parsetree.structure
  (** Extract information from the current environment and encode it
      into an attribute which is prepended to the list of structure
      items in order to pass the information to an external
      processor. *)

  val add_ppx_context_sig:
    tool_name:string -> Parsetree.signature -> Parsetree.signature
  (** Same as [add_ppx_context_str], but for signatures. *)

  val drop_ppx_context_str:
    restore:bool -> Parsetree.structure -> Parsetree.structure
  (** Drop the ocaml.ppx.context attribute from a structure.  If
      [restore] is true, also restore the associated data in the current
      process. *)

  val drop_ppx_context_sig:
    restore:bool -> Parsetree.signature -> Parsetree.signature
  (** Same as [drop_ppx_context_str], but for signatures. *)

  (** {1 Cookies} *)

  (** Cookies are used to pass information from a ppx processor to
      a further invocation of itself, when called from the OCaml
      toplevel (or other tools that support cookies). *)

  val set_cookie: string -> Parsetree.expression -> unit
  val get_cookie: string -> Parsetree.expression option
end = struct
  open Parsetree
  open Ast_helper
  open Location

  module String = Misc.Stdlib.String

  type mapper (*IF_CURRENT = Ast_mapper.mapper *) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    binding_op: mapper -> binding_op -> binding_op;
    case: mapper -> case -> case;
    cases: mapper -> cases -> cases;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
      -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
      -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
      -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_substitution: mapper -> module_substitution -> module_substitution;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
      -> module_type_declaration;
    open_declaration: mapper -> open_declaration -> open_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_exception: mapper -> type_exception -> type_exception;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub {
      prf_desc;
      prf_loc;
      prf_attributes;
    } =
      let loc = sub.location sub prf_loc in
      let attrs = sub.attributes sub prf_attributes in
      let desc = match prf_desc with
        | Rtag (l, b, tl) -> Rtag (map_loc sub l, b, List.map (sub.typ sub) tl)
        | Rinherit t -> Rinherit (sub.typ sub t)
      in
      Rf.mk ~loc ~attrs desc

    let object_field sub {
      pof_desc;
      pof_loc;
      pof_attributes;
    } =
      let loc = sub.location sub pof_loc in
      let attrs = sub.attributes sub pof_attributes in
      let desc = match pof_desc with
        | Otag (l, t) -> Otag (map_loc sub l, sub.typ sub t)
        | Oinherit t -> Oinherit (sub.typ sub t)
      in
      Of.mk ~loc ~attrs desc

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs; ptyp_loc_stack = _ } =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
        arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
        object_ ~loc ~attrs (List.map (object_field sub) l) o
      | Ptyp_class (lid, tl) ->
        class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
        variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs
                               (List.map (map_loc sub) sl) (sub.typ sub t)
      | Ptyp_package (lid, l) ->
        package ~loc ~attrs (map_loc sub lid)
          (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
          {ptype_name; ptype_params; ptype_cstrs;
           ptype_kind;
           ptype_private;
           ptype_manifest;
           ptype_attributes;
           ptype_loc} =
      let loc = sub.location sub ptype_loc in
      let attrs = sub.attributes sub ptype_attributes in
      Type.mk ~loc ~attrs (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
        Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_constructor_arguments sub = function
      | Pcstr_tuple l -> Pcstr_tuple (List.map (sub.typ sub) l)
      | Pcstr_record l ->
        Pcstr_record (List.map (sub.label_declaration sub) l)

    let map_type_extension sub
          {ptyext_path; ptyext_params;
           ptyext_constructors;
           ptyext_private;
           ptyext_loc;
           ptyext_attributes} =
      let loc = sub.location sub ptyext_loc in
      let attrs = sub.attributes sub ptyext_attributes in
      Te.mk ~loc ~attrs
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private

    let map_type_exception sub
          {ptyexn_constructor; ptyexn_loc; ptyexn_attributes} =
      let loc = sub.location sub ptyexn_loc in
      let attrs = sub.attributes sub ptyexn_attributes in
      Te.mk_exception ~loc ~attrs
        (sub.extension_constructor sub ptyexn_constructor)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
        Pext_decl(map_constructor_arguments sub ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
        Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
          {pext_name;
           pext_kind;
           pext_loc;
           pext_attributes} =
      let loc = sub.location sub pext_loc in
      let attrs = sub.attributes sub pext_attributes in
      Te.constructor ~loc ~attrs
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
        arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcty_open (o, ct) ->
        open_ ~loc ~attrs (sub.open_description sub o) (sub.class_type sub ct)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) ->
        val_ ~loc ~attrs (map_loc sub s) m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) ->
        method_ ~loc ~attrs (map_loc sub s) p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
        constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (s, mt1, mt2) ->
        functor_ ~loc ~attrs (map_loc sub s)
          (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) mt1)
          (sub.module_type sub mt2)
      | Pmty_with (mt, l) ->
        with_ ~loc ~attrs (sub.module_type sub mt)
          (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
        Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
        Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst (lid, d) ->
        Pwith_typesubst (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
        Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type (rf, l) ->
        type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Psig_typesubst l ->
        type_subst ~loc (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.type_exception sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_modsubst x -> mod_subst ~loc (sub.module_substitution sub x)
      | Psig_recmodule l ->
        rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
        class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
        let attrs = sub.attributes sub attrs in
        extension ~loc ~attrs (sub.extension sub x)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (arg, arg_ty, body) ->
        functor_ ~loc ~attrs (map_loc sub arg)
          (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) arg_ty)
          (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
        apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
        constraint_ ~loc ~attrs (sub.module_expr sub m)
          (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
        let attrs = sub.attributes sub attrs in
        eval ~loc ~attrs (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.type_exception sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_declaration sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
        class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
        let attrs = sub.attributes sub attrs in
        extension ~loc ~attrs (sub.extension sub x)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs; pexp_loc_stack = _ } =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
        let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
          (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
        fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
          (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
        apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
        match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
        construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
        variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
        record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
          (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
        field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
        setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
          (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
        ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
          (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
        sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
        while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
        for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
          (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
        coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
          (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
        constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) ->
        send ~loc ~attrs (sub.expr sub e) (map_loc sub s)
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
        setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
        override ~loc ~attrs
          (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
        letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
          (sub.expr sub e)
      | Pexp_letexception (cd, e) ->
        letexception ~loc ~attrs
          (sub.extension_constructor sub cd)
          (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
        poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) ->
        newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (o, e) ->
        open_ ~loc ~attrs (sub.open_declaration sub o) (sub.expr sub e)
      | Pexp_letop {let_; ands; body} ->
        letop ~loc ~attrs (sub.binding_op sub let_)
          (List.map (sub.binding_op sub) ands) (sub.expr sub body)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pexp_unreachable -> unreachable ~loc ~attrs ()

    let map_binding_op sub {pbop_op; pbop_pat; pbop_exp; pbop_loc} =
      let open Exp in
      let op = map_loc sub pbop_op in
      let pat = sub.pat sub pbop_pat in
      let exp = sub.expr sub pbop_exp in
      let loc = sub.location sub pbop_loc in
      binding_op op pat exp loc

  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs; ppat_loc_stack = _ } =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
        construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
        record ~loc ~attrs
          (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
        constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
        structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
        fun_ ~loc ~attrs lab
          (map_opt (sub.expr sub) e)
          (sub.pat sub p)
          (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
        apply ~loc ~attrs (sub.class_expr sub ce)
          (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
        let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
          (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
        constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcl_open (o, ce) ->
        open_ ~loc ~attrs (sub.open_description sub o) (sub.class_expr sub ce)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) ->
        inherit_ ~loc ~attrs o (sub.class_expr sub ce)
          (map_opt (map_loc sub) s)
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
        method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
        constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      let loc = sub.location sub pci_loc in
      let attrs = sub.attributes sub pci_attributes in
      Ci.mk ~loc ~attrs
        ~virt:pci_virt
        ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      type_exception = T.map_type_exception;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;
      binding_op = E.map_binding_op;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_substitution =
        (fun this {pms_name; pms_manifest; pms_attributes; pms_loc} ->
           Ms.mk
             (map_loc this pms_name)
             (map_loc this pms_manifest)
             ~attrs:(this.attributes this pms_attributes)
             ~loc:(this.location this pms_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_declaration =
        (fun this {popen_expr; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (this.module_expr this popen_expr)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );

      open_description =
        (fun this {popen_expr; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_expr)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );

      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
           Type.constructor
             (map_loc this pcd_name)
             ~args:(T.map_constructor_arguments this pcd_args)
             ?res:(map_opt (this.typ this) pcd_res)
             ~loc:(this.location this pcd_loc)
             ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this a ->
        {
          attr_name = map_loc this a.attr_name;
          attr_payload = this.payload this a.attr_payload;
          attr_loc = this.location this a.attr_loc
        }
      );
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PSig x -> PSig (this.signature this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(fun x -> PStr x)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Pconst_string (x, None))))
      error

  let attribute_of_warning loc s =
    Attr.mk
      {loc; txt = "ocaml.ppwarning" }
      (PStr ([Str.eval ~loc (Exp.constant (Pconst_string (s, None)))]))

  include Locations.Helpers_impl

  let cookies = ref String.Map.empty

  let get_cookie k =
    try Some (String.Map.find k !cookies)
    with Not_found -> None

  let set_cookie k v =
    cookies := String.Map.add k v !cookies

  let tool_name_ref = ref "_none_"

  let tool_name () = !tool_name_ref


  module PpxContext = struct
    open Longident
    open Asttypes
    open Ast_helper

    let lid name = { txt = Lident name; loc = Location.none }

    let make_string x = Exp.constant (Pconst_string (x, None))

    let make_bool x =
      if x
      then Exp.construct (lid "true") None
      else Exp.construct (lid "false") None

    let rec make_list f lst =
      match lst with
      | x :: rest ->
        Exp.construct (lid "::") (Some (Exp.tuple [f x; make_list f rest]))
      | [] ->
        Exp.construct (lid "[]") None

    let make_pair f1 f2 (x1, x2) =
      Exp.tuple [f1 x1; f2 x2]

    let make_option f opt =
      match opt with
      | Some x -> Exp.construct (lid "Some") (Some (f x))
      | None   -> Exp.construct (lid "None") None

    let get_cookies () =
      lid "cookies",
      make_list (make_pair make_string (fun x -> x))
        (String.Map.bindings !cookies)

    let mk fields =
      {
        attr_name = { txt = "ocaml.ppx.context"; loc = Location.none };
        attr_payload = Parsetree.PStr [Str.eval (Exp.record fields None)];
        attr_loc = Location.none
      }

    let make ~tool_name () =
      let fields =
        [
          lid "tool_name",    make_string tool_name;
          lid "include_dirs", make_list make_string !Clflags.include_dirs;
          lid "load_path",    make_list make_string (Migrate_parsetree_compiler_functions.get_load_paths ());
          lid "open_modules", make_list make_string !Clflags.open_modules;
          lid "for_package",  make_option make_string !Clflags.for_package;
          lid "debug",        make_bool !Clflags.debug;
          lid "use_threads",  make_bool !Clflags.use_threads;
          lid "recursive_types", make_bool !Clflags.recursive_types;
          lid "principal", make_bool !Clflags.principal;
          lid "transparent_modules", make_bool !Clflags.transparent_modules;
          lid "unboxed_types", make_bool (Migrate_parsetree_compiler_functions.get_unboxed_types ());
          lid "unsafe_string", make_bool !Clflags.unsafe_string;
          get_cookies ()
        ]
      in
      mk fields

    let get_fields = function
      | PStr [{pstr_desc = Pstr_eval
                             ({ pexp_desc = Pexp_record (fields, None); _ }, []); _}] ->
        fields
      | _ ->
        raise_errorf "Internal error: invalid [@@@ocaml.ppx.context] syntax"

    let restore fields =
      let field name payload =
        let rec get_string = function
          | { pexp_desc = Pexp_constant (Pconst_string (str, None)); _ } -> str
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] string syntax" name
        and get_bool pexp =
          match pexp with
          | {pexp_desc = Pexp_construct ({txt = Longident.Lident "true"; _},
                                         None); _} ->
            true
          | {pexp_desc = Pexp_construct ({txt = Longident.Lident "false"; _},
                                         None); _} ->
            false
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] bool syntax" name
        and get_list elem = function
          | {pexp_desc =
               Pexp_construct ({txt = Longident.Lident "::"; _},
                               Some {pexp_desc = Pexp_tuple [exp; rest]; _}); _ } ->
            elem exp :: get_list elem rest
          | {pexp_desc =
               Pexp_construct ({txt = Longident.Lident "[]"; _}, None); _ } ->
            []
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] list syntax" name
        and get_pair f1 f2 = function
          | {pexp_desc = Pexp_tuple [e1; e2]; _} ->
            (f1 e1, f2 e2)
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] pair syntax" name
        and get_option elem = function
          | { pexp_desc =
                Pexp_construct ({ txt = Longident.Lident "Some"; _ }, Some exp); _ } ->
            Some (elem exp)
          | { pexp_desc =
                Pexp_construct ({ txt = Longident.Lident "None"; _ }, None); _ } ->
            None
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] option syntax" name
        in
        match name with
        | "tool_name" ->
          tool_name_ref := get_string payload
        | "include_dirs" ->
          Clflags.include_dirs := get_list get_string payload
        | "load_path" ->
           Migrate_parsetree_compiler_functions.load_path_init (get_list get_string payload)
        | "open_modules" ->
          Clflags.open_modules := get_list get_string payload
        | "for_package" ->
          Clflags.for_package := get_option get_string payload
        | "debug" ->
          Clflags.debug := get_bool payload
        | "use_threads" ->
          Clflags.use_threads := get_bool payload
        | "recursive_types" ->
          Clflags.recursive_types := get_bool payload
        | "principal" ->
          Clflags.principal := get_bool payload
        | "transparent_modules" ->
          Clflags.transparent_modules := get_bool payload
        | "unboxed_types" ->
          Migrate_parsetree_compiler_functions.set_unboxed_types (get_bool payload)
        | "unsafe_string" ->
          Clflags.unsafe_string := get_bool payload
        | "cookies" ->
          let l = get_list (get_pair get_string (fun x -> x)) payload in
          cookies :=
            List.fold_left
              (fun s (k, v) -> String.Map.add k v s) String.Map.empty
              l
        | _ ->
          ()
      in
      List.iter (function ({txt=Lident name; _}, x) -> field name x | _ -> ()) fields

    let update_cookies fields =
      let fields =
        List.filter
          (function ({txt=Lident "cookies"; _}, _) -> false | _ -> true)
          fields
      in
      fields @ [get_cookies ()]
  end

  let ppx_context = PpxContext.make

  let extension_of_exn exn = extension_of_error (Locations.location_error_of_exn exn)

  let apply_lazy ~source ~target mapper =
    let implem ast =
      let fields, ast =
        match ast with
        | {pstr_desc = Pstr_attribute ({attr_name = {txt = "ocaml.ppx.context"; _};
                                        attr_payload = x; _}); _} :: l ->
          PpxContext.get_fields x, l
        | _ -> [], ast
      in
      PpxContext.restore fields;
      let ast =
        try
          let mapper = mapper () in
          mapper.structure mapper ast
        with exn ->
          [{pstr_desc = Pstr_extension (extension_of_exn exn, []);
            pstr_loc  = Location.none}]
      in
      let fields = PpxContext.update_cookies fields in
      Str.attribute (PpxContext.mk fields) :: ast
    in
    let iface ast =
      let fields, ast =
        match ast with
        | {psig_desc = Psig_attribute ({attr_name = {txt = "ocaml.ppx.context"; _};
                                        attr_payload = x;
                                        attr_loc = _}); _} :: l ->
          PpxContext.get_fields x, l
        | _ -> [], ast
      in
      PpxContext.restore fields;
      let ast =
        try
          let mapper = mapper () in
          mapper.signature mapper ast
        with exn ->
          [{psig_desc = Psig_extension (extension_of_exn exn, []);
            psig_loc  = Location.none}]
      in
      let fields = PpxContext.update_cookies fields in
      Sig.attribute (PpxContext.mk fields) :: ast
    in

    let ic = open_in_bin source in
    let magic =
      really_input_string ic (String.length Config.ast_impl_magic_number)
    in

    let rewrite transform =
      Location.input_name := input_value ic;
      let ast = input_value ic in
      close_in ic;
      let ast = transform ast in
      let oc = open_out_bin target in
      output_string oc magic;
      output_value oc !Location.input_name;
      output_value oc ast;
      close_out oc
    and fail () =
      close_in ic;
      failwith "Ast_mapper: OCaml version mismatch or malformed input";
    in

    if magic = Config.ast_impl_magic_number then
      rewrite (implem : structure -> structure)
    else if magic = Config.ast_intf_magic_number then
      rewrite (iface : signature -> signature)
    else fail ()

  let drop_ppx_context_str ~restore = function
    | {pstr_desc = Pstr_attribute
                     {attr_name = {Location.txt = "ocaml.ppx.context"; _};
                      attr_payload = a;
                      attr_loc = _}; _ }
      :: items ->
      if restore then
        PpxContext.restore (PpxContext.get_fields a);
      items
    | items -> items

  let drop_ppx_context_sig ~restore = function
    | {psig_desc = Psig_attribute
                     {attr_name = {Location.txt = "ocaml.ppx.context"; _};
                      attr_payload = a;
                      attr_loc = _}; _ }
      :: items ->
      if restore then
        PpxContext.restore (PpxContext.get_fields a);
      items
    | items -> items

  let add_ppx_context_str ~tool_name ast =
    Ast_helper.Str.attribute (ppx_context ~tool_name ()) :: ast

  let add_ppx_context_sig ~tool_name ast =
    Ast_helper.Sig.attribute (ppx_context ~tool_name ()) :: ast


  let apply ~source ~target mapper =
    apply_lazy ~source ~target (fun () -> mapper)

  let run_main mapper =
    try
      let a = Sys.argv in
      let n = Array.length a in
      if n > 2 then
        let mapper () =
          try mapper (Array.to_list (Array.sub a 1 (n - 3)))
          with exn ->
            (* PR#6463 *)
            let f _ _ = raise exn in
            {default_mapper with structure = f; signature = f}
        in
        apply_lazy ~source:a.(n - 2) ~target:a.(n - 1) mapper
      else begin
        Printf.eprintf "Usage: %s [extra_args] <infile> <outfile>\n%!"
          Sys.executable_name;
        exit 2
      end
    with exn ->
      prerr_endline (Printexc.to_string exn);
      exit 2

  let register_function = ref (fun _name f -> run_main f)
  let register name f = !register_function name f
end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
     [Toploop.print_out_value]
     [Toploop.print_out_type]
     [Toploop.print_out_sig_item]
     [Toploop.print_out_phrase] *)

  (** An [out_name] is a string representation of an identifier which can be
      rewritten on the fly to avoid name collisions *)
  type out_name (*IF_CURRENT = Outcometree.out_name *) = { mutable printed_name: string }

  type out_ident (*IF_CURRENT = Outcometree.out_ident *) =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of out_name

  type out_string (*IF_CURRENT = Outcometree.out_string *) =
    | Ostr_string
    | Ostr_bytes

  type out_attribute (*IF_CURRENT = Outcometree.out_attribute *) =
    { oattr_name: string }

  type out_value (*IF_CURRENT = Outcometree.out_value *) =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string * int * out_string (* string, size-to-print, kind *)
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type (*IF_CURRENT = Outcometree.out_type *) =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of out_ident * string list * out_type list
    | Otyp_attribute of out_type * out_attribute

  and out_variant (*IF_CURRENT = Outcometree.out_variant *) =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_typ of out_type

  type out_class_type (*IF_CURRENT = Outcometree.out_class_type *) =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item (*IF_CURRENT = Outcometree.out_class_sig_item *) =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type (*IF_CURRENT = Outcometree.out_module_type *) =
    | Omty_abstract
    | Omty_functor of string * out_module_type option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item (*IF_CURRENT = Outcometree.out_sig_item *) =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
        out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
        out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of out_val_decl
    | Osig_ellipsis
  and out_type_decl (*IF_CURRENT = Outcometree.out_type_decl *) =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_immediate: bool;
      otype_unboxed: bool;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor (*IF_CURRENT = Outcometree.out_extension_constructor *) =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension (*IF_CURRENT = Outcometree.out_type_extension *) =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_val_decl (*IF_CURRENT = Outcometree.out_val_decl *) =
    { oval_name: string;
      oval_type: out_type;
      oval_prims: string list;
      oval_attributes: out_attribute list }
  and out_rec_status (*IF_CURRENT = Outcometree.out_rec_status *) =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status (*IF_CURRENT = Outcometree.out_ext_status *) =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase (*IF_CURRENT = Outcometree.out_phrase *) =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)
end

module Config = struct
  let ast_impl_magic_number = "Caml1999M025"
  let ast_intf_magic_number = "Caml1999N025"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
    binding_op              = id;
    module_substitution     = id;
    open_declaration        = id;
    type_exception          = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
    binding_op              = fail;
    module_substitution     = fail;
    open_declaration        = fail;
    type_exception          = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Ast_409_helper
= struct
#1 "ast_409_helper.ml"
# 1 "src/ast_409_helper.ml"
module Misc = struct

  let find_in_path = Misc.find_in_path
  let find_in_path_uncap = Misc.find_in_path_uncap

  type ref_and_value = R : 'a ref * 'a -> ref_and_value
  let protect_refs =
    let set_refs l = List.iter (fun (R (r, v)) -> r := v) l in
    fun refs f ->
      let backup = List.map (fun (R (r, _)) -> R (r, !r)) refs in
      set_refs refs;
      match f () with
      | x           -> set_refs backup; x
      | exception e -> set_refs backup; raise e

  let may_map = Stdlib0.Option.map

  module Stdlib = struct
    module String = struct
      include String
      module Map = Map.Make (String)
    end
  end
end

end
module Ast_409
= struct
#1 "ast_409.ml"
# 1 "src/ast_409.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                         Frédéric Bour, Facebook                        *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2018 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

open Stdlib0
open Ast_409_helper

module Location = Location
module Longident = Longident

module Asttypes = struct

  type constant (*IF_CURRENT = Asttypes.constant *) =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag (*IF_CURRENT = Asttypes.rec_flag *) = Nonrecursive | Recursive

  type direction_flag (*IF_CURRENT = Asttypes.direction_flag *) = Upto | Downto

  (* Order matters, used in polymorphic comparison *)
  type private_flag (*IF_CURRENT = Asttypes.private_flag *) = Private | Public

  type mutable_flag (*IF_CURRENT = Asttypes.mutable_flag *) = Immutable | Mutable

  type virtual_flag (*IF_CURRENT = Asttypes.virtual_flag *) = Virtual | Concrete

  type override_flag (*IF_CURRENT = Asttypes.override_flag *) = Override | Fresh

  type closed_flag (*IF_CURRENT = Asttypes.closed_flag *) = Closed | Open

  type label = string

  type arg_label (*IF_CURRENT = Asttypes.arg_label *) =
      Nolabel
    | Labelled of string (*  label:T -> ... *)
    | Optional of string (* ?label:T -> ... *)

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance (*IF_CURRENT = Asttypes.variance *) =
    | Covariant
    | Contravariant
    | Invariant

end

module Parsetree = struct

  open Asttypes

  type constant (*IF_CURRENT = Parsetree.constant *) =
      Pconst_integer of string * char option
    (* 3 3l 3L 3n

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes except 'l', 'L' and 'n' are rejected by the typechecker
    *)
    | Pconst_char of char
    (* 'c' *)
    | Pconst_string of string * string option
    (* "constant"
       {delim|other constant|delim}
    *)
    | Pconst_float of string * char option
    (* 3.4 2e5 1.4e-4

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes are rejected by the typechecker.
    *)

  (** {1 Extension points} *)

  type attribute (*IF_CURRENT = Parsetree.attribute *) = {
    attr_name : string loc;
    attr_payload : payload;
    attr_loc : Location.t;
  }
  (* [@id ARG]
     [@@id ARG]

     Metadata containers passed around within the AST.
     The compiler ignores unknown attributes.
  *)

  and extension = string loc * payload
  (* [%id ARG]
     [%%id ARG]

     Sub-language placeholder -- rejected by the typechecker.
  *)

  and attributes = attribute list

  and payload (*IF_CURRENT = Parsetree.payload *) =
    | PStr of structure
    | PSig of signature (* : SIG *)
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {1 Core language} *)

  (* Type expressions *)

  and core_type (*IF_CURRENT = Parsetree.core_type *) =
    {
      ptyp_desc: core_type_desc;
      ptyp_loc: Location.t;
      ptyp_loc_stack: Location.t list;
      ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and typ = core_type

  and core_type_desc (*IF_CURRENT = Parsetree.core_type_desc *) =
    | Ptyp_any
    (*  _ *)
    | Ptyp_var of string
    (* 'a *)
    | Ptyp_arrow of arg_label * core_type * core_type
    (* T1 -> T2       Simple
       ~l:T1 -> T2    Labelled
       ?l:T1 -> T2    Optional
    *)
    | Ptyp_tuple of core_type list
    (* T1 * ... * Tn

       Invariant: n >= 2
    *)
    | Ptyp_constr of Longident.t loc * core_type list
    (* tconstr
       T tconstr
       (T1, ..., Tn) tconstr
    *)
    | Ptyp_object of object_field list * closed_flag
    (* < l1:T1; ...; ln:Tn >     (flag = Closed)
       < l1:T1; ...; ln:Tn; .. > (flag = Open)
    *)
    | Ptyp_class of Longident.t loc * core_type list
    (* #tconstr
       T #tconstr
       (T1, ..., Tn) #tconstr
    *)
    | Ptyp_alias of core_type * string
    (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
    (* [ `A|`B ]         (flag = Closed; labels = None)
       [> `A|`B ]        (flag = Open;   labels = None)
       [< `A|`B ]        (flag = Closed; labels = Some [])
       [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
    *)
    | Ptyp_poly of string loc list * core_type
    (* 'a1 ... 'an. T

       Can only appear in the following context:

       - As the core_type of a Ppat_constraint node corresponding
       to a constraint on a let-binding: let x : 'a1 ... 'an. T
       = e ...

       - Under Cfk_virtual for methods (not values).

       - As the core_type of a Pctf_method node.

       - As the core_type of a Pexp_poly node.

       - As the pld_type field of a label_declaration.

       - As a core_type of a Ptyp_object node.
    *)

    | Ptyp_package of package_type
    (* (module S) *)
    | Ptyp_extension of extension
    (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
      (*
     (module S)
     (module S with type t1 = T1 and ... and tn = Tn)
  *)

  and row_field (*IF_CURRENT = Parsetree.row_field *) = {
    prf_desc : row_field_desc;
    prf_loc : Location.t;
    prf_attributes : attributes;
  }

  and row_field_desc (*IF_CURRENT = Parsetree.row_field_desc *) =
    | Rtag of label loc * bool * core_type list
    (* [`A]                   ( true,  [] )
       [`A of T]              ( false, [T] )
       [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
       [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

       - The 'bool' field is true if the tag contains a
       constant (empty) constructor.
       - '&' occurs when several types are used for the same constructor
       (see 4.2 in the manual)
    *)
    | Rinherit of core_type
    (* [ T ] *)

  and object_field (*IF_CURRENT = Parsetree.object_field *) = {
    pof_desc : object_field_desc;
    pof_loc : Location.t;
    pof_attributes : attributes;
  }

  and object_field_desc (*IF_CURRENT = Parsetree.object_field_desc *) =
    | Otag of label loc * core_type
    | Oinherit of core_type

  (* Patterns *)

  and pattern (*IF_CURRENT = Parsetree.pattern *) =
    {
      ppat_desc: pattern_desc;
      ppat_loc: Location.t;
      ppat_loc_stack: Location.t list;
      ppat_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and pat = pattern

  and pattern_desc (*IF_CURRENT = Parsetree.pattern_desc *) =
    | Ppat_any
    (* _ *)
    | Ppat_var of string loc
    (* x *)
    | Ppat_alias of pattern * string loc
    (* P as 'a *)
    | Ppat_constant of constant
    (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
    (* 'a'..'z'

       Other forms of interval are recognized by the parser
       but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
    (* (P1, ..., Pn)

       Invariant: n >= 2
    *)
    | Ppat_construct of Longident.t loc * pattern option
    (* C                None
       C P              Some P
       C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
    *)
    | Ppat_variant of label * pattern option
    (* `A             (None)
       `A P           (Some P)
    *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
    (* { l1=P1; ...; ln=Pn }     (flag = Closed)
       { l1=P1; ...; ln=Pn; _}   (flag = Open)

       Invariant: n > 0
    *)
    | Ppat_array of pattern list
    (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
    (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
    (* (P : T) *)
    | Ppat_type of Longident.t loc
    (* #tconst *)
    | Ppat_lazy of pattern
    (* lazy P *)
    | Ppat_unpack of string loc
    (* (module P)
       Note: (module P : S) is represented as
       Ppat_constraint(Ppat_unpack, Ptyp_package)
    *)
    | Ppat_exception of pattern
    (* exception P *)
    | Ppat_extension of extension
    (* [%id] *)
    | Ppat_open of Longident.t loc * pattern
    (* M.(P) *)

  (* Value expressions *)

  and expression (*IF_CURRENT = Parsetree.expression *) =
    {
      pexp_desc: expression_desc;
      pexp_loc: Location.t;
      pexp_loc_stack: Location.t list;
      pexp_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and expr = expression

  and expression_desc (*IF_CURRENT = Parsetree.expression_desc *) =
    | Pexp_ident of Longident.t loc
    (* x
       M.x
    *)
    | Pexp_constant of constant
    (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
    (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
    *)
    | Pexp_function of cases
    (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of arg_label * expression option * pattern * expression
    (* fun P -> E1                          (Simple, None)
       fun ~l:P -> E1                       (Labelled l, None)
       fun ?l:P -> E1                       (Optional l, None)
       fun ?l:(P = E0) -> E1                (Optional l, Some E0)

       Notes:
       - If E0 is provided, only Optional is allowed.
       - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
       - "let f P = E" is represented using Pexp_fun.
    *)
    | Pexp_apply of expression * (arg_label * expression) list
    (* E0 ~l1:E1 ... ~ln:En
       li can be empty (non labeled argument) or start with '?'
       (optional argument).

       Invariant: n > 0
    *)
    | Pexp_match of expression * cases
    (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * cases
    (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
    (* (E1, ..., En)

       Invariant: n >= 2
    *)
    | Pexp_construct of Longident.t loc * expression option
    (* C                None
       C E              Some E
       C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
    *)
    | Pexp_variant of label * expression option
    (* `A             (None)
       `A E           (Some E)
    *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
    (* { l1=P1; ...; ln=Pn }     (None)
       { E0 with l1=P1; ...; ln=Pn }   (Some E0)

       Invariant: n > 0
    *)
    | Pexp_field of expression * Longident.t loc
    (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
    (* E1.l <- E2 *)
    | Pexp_array of expression list
    (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
    (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
    (* E1; E2 *)
    | Pexp_while of expression * expression
    (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
    (* for i = E1 to E2 do E3 done      (flag = Upto)
       for i = E1 downto E2 do E3 done  (flag = Downto)
    *)
    | Pexp_constraint of expression * core_type
    (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
    (* (E :> T)        (None, T)
       (E : T0 :> T)   (Some T0, T)
    *)
    | Pexp_send of expression * label loc
    (*  E # m *)
    | Pexp_new of Longident.t loc
    (* new M.c *)
    | Pexp_setinstvar of label loc * expression
    (* x <- 2 *)
    | Pexp_override of (label loc * expression) list
    (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string loc * module_expr * expression
    (* let module M = ME in E *)
    | Pexp_letexception of extension_constructor * expression
    (* let exception C in E *)
    | Pexp_assert of expression
    (* assert E
       Note: "assert false" is treated in a special way by the
       type-checker. *)
    | Pexp_lazy of expression
    (* lazy E *)
    | Pexp_poly of expression * core_type option
    (* Used for method bodies.

       Can only be used as the expression under Cfk_concrete
       for methods (not values). *)
    | Pexp_object of class_structure
    (* object ... end *)
    | Pexp_newtype of string loc * expression
    (* fun (type t) -> E *)
    | Pexp_pack of module_expr
    (* (module ME)

       (module ME : S) is represented as
       Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of open_declaration * expression
    (* M.(E)
       let open M in E
       let! open M in E *)
    | Pexp_letop of letop
    (* let* P = E in E
       let* P = E and* P = E in E *)
    | Pexp_extension of extension
    (* [%id] *)
    | Pexp_unreachable
    (* . *)

  and case (*IF_CURRENT = Parsetree.case *) =   (* (P -> E) or (P when E0 -> E) *)
    {
      pc_lhs: pattern;
      pc_guard: expression option;
      pc_rhs: expression;
    }

  and cases = case list

  and letop (*IF_CURRENT = Parsetree.letop *) =
    {
      let_ : binding_op;
      ands : binding_op list;
      body : expression;
    }

  and binding_op (*IF_CURRENT = Parsetree.binding_op *) =
    {
      pbop_op : string loc;
      pbop_pat : pattern;
      pbop_exp : expression;
      pbop_loc : Location.t;
    }

  (* Value descriptions *)

  and value_description (*IF_CURRENT = Parsetree.value_description *) =
    {
      pval_name: string loc;
      pval_type: core_type;
      pval_prim: string list;
      pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      pval_loc: Location.t;
    }

(*
     val x: T                            (prim = [])
     external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])
  *)

  (* Type declarations *)

  and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
    {
      ptype_name: string loc;
      ptype_params: (core_type * variance) list;
      (* ('a1,...'an) t; None represents  _*)
      ptype_cstrs: (core_type * core_type * Location.t) list;
      (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
      ptype_kind: type_kind;
      ptype_private: private_flag;   (* = private ... *)
      ptype_manifest: core_type option;  (* = T *)
      ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      ptype_loc: Location.t;
    }

(*
     type t                     (abstract, no manifest)
     type t = T0                (abstract, manifest=T0)
     type t = C of T | ...      (variant,  no manifest)
     type t = T0 = C of T | ... (variant,  manifest=T0)
     type t = {l: T; ...}       (record,   no manifest)
     type t = T0 = {l : T; ...} (record,   manifest=T0)
     type t = ..                (open,     no manifest)
  *)

  and type_kind (*IF_CURRENT = Parsetree.type_kind *) =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
    | Ptype_record of label_declaration list
    (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration (*IF_CURRENT = Parsetree.label_declaration *) =
    {
      pld_name: string loc;
      pld_mutable: mutable_flag;
      pld_type: core_type;
      pld_loc: Location.t;
      pld_attributes: attributes; (* l : T [@id1] [@id2] *)
    }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration (*IF_CURRENT = Parsetree.constructor_declaration *) =
    {
      pcd_name: string loc;
      pcd_args: constructor_arguments;
      pcd_res: core_type option;
      pcd_loc: Location.t;
      pcd_attributes: attributes; (* C of ... [@id1] [@id2] *)
    }

  and constructor_arguments (*IF_CURRENT = Parsetree.constructor_arguments *) =
    | Pcstr_tuple of core_type list
    | Pcstr_record of label_declaration list

(*
     | C of T1 * ... * Tn     (res = None,    args = Pcstr_tuple [])
     | C: T0                  (res = Some T0, args = [])
     | C: T1 * ... * Tn -> T0 (res = Some T0, args = Pcstr_tuple)
     | C of {...}             (res = None,    args = Pcstr_record)
     | C: {...} -> T0         (res = Some T0, args = Pcstr_record)
     | C of {...} as t        (res = None,    args = Pcstr_record)
  *)

  and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
    {
      ptyext_path: Longident.t loc;
      ptyext_params: (core_type * variance) list;
      ptyext_constructors: extension_constructor list;
      ptyext_private: private_flag;
      ptyext_loc: Location.t;
      ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
    }
(*
     type t += ...
  *)

  and extension_constructor (*IF_CURRENT = Parsetree.extension_constructor *) =
    {
      pext_name: string loc;
      pext_kind : extension_constructor_kind;
      pext_loc : Location.t;
      pext_attributes: attributes; (* C of ... [@id1] [@id2] *)
    }

  (* exception E *)
  and type_exception (*IF_CURRENT = Parsetree.type_exception *) =
    {
      ptyexn_constructor: extension_constructor;
      ptyexn_loc: Location.t;
      ptyexn_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and extension_constructor_kind (*IF_CURRENT = Parsetree.extension_constructor_kind *) =
      Pext_decl of constructor_arguments * core_type option
      (*
       | C of T1 * ... * Tn     ([T1; ...; Tn], None)
       | C: T0                  ([], Some T0)
       | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
    *)
    | Pext_rebind of Longident.t loc
      (*
       | C = D
    *)

  (** {1 Class language} *)

  (* Type expressions for the class language *)

  and class_type (*IF_CURRENT = Parsetree.class_type *) =
    {
      pcty_desc: class_type_desc;
      pcty_loc: Location.t;
      pcty_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and class_type_desc (*IF_CURRENT = Parsetree.class_type_desc *) =
    | Pcty_constr of Longident.t loc * core_type list
    (* c
       ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
    (* object ... end *)
    | Pcty_arrow of arg_label * core_type * class_type
    (* T -> CT       Simple
       ~l:T -> CT    Labelled l
       ?l:T -> CT    Optional l
    *)
    | Pcty_extension of extension
    (* [%id] *)
    | Pcty_open of open_description * class_type
    (* let open M in CT *)

  and class_signature (*IF_CURRENT = Parsetree.class_signature *) =
    {
      pcsig_self: core_type;
      pcsig_fields: class_type_field list;
    }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
  *)

  and class_type_field (*IF_CURRENT = Parsetree.class_type_field *) =
    {
      pctf_desc: class_type_field_desc;
      pctf_loc: Location.t;
      pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and class_type_field_desc (*IF_CURRENT = Parsetree.class_type_field_desc *) =
    | Pctf_inherit of class_type
    (* inherit CT *)
    | Pctf_val of (label loc * mutable_flag * virtual_flag * core_type)
    (* val x: T *)
    | Pctf_method  of (label loc * private_flag * virtual_flag * core_type)
    (* method x: T

       Note: T can be a Ptyp_poly.
    *)
    | Pctf_constraint  of (core_type * core_type)
    (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
    (* [@@@id] *)
    | Pctf_extension of extension
    (* [%%id] *)

  and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
    {
      pci_virt: virtual_flag;
      pci_params: (core_type * variance) list;
      pci_name: string loc;
      pci_expr: 'a;
      pci_loc: Location.t;
      pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
    }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr (*IF_CURRENT = Parsetree.class_expr *) =
    {
      pcl_desc: class_expr_desc;
      pcl_loc: Location.t;
      pcl_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and class_expr_desc (*IF_CURRENT = Parsetree.class_expr_desc *) =
    | Pcl_constr of Longident.t loc * core_type list
    (* c
       ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
    (* object ... end *)
    | Pcl_fun of arg_label * expression option * pattern * class_expr
    (* fun P -> CE                          (Simple, None)
       fun ~l:P -> CE                       (Labelled l, None)
       fun ?l:P -> CE                       (Optional l, None)
       fun ?l:(P = E0) -> CE                (Optional l, Some E0)
    *)
    | Pcl_apply of class_expr * (arg_label * expression) list
    (* CE ~l1:E1 ... ~ln:En
       li can be empty (non labeled argument) or start with '?'
       (optional argument).

       Invariant: n > 0
    *)
    | Pcl_let of rec_flag * value_binding list * class_expr
    (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
    *)
    | Pcl_constraint of class_expr * class_type
    (* (CE : CT) *)
    | Pcl_extension of extension
    (* [%id] *)
    | Pcl_open of open_description * class_expr
    (* let open M in CE *)


  and class_structure (*IF_CURRENT = Parsetree.class_structure *) =
    {
      pcstr_self: pattern;
      pcstr_fields: class_field list;
    }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
  *)

  and class_field (*IF_CURRENT = Parsetree.class_field *) =
    {
      pcf_desc: class_field_desc;
      pcf_loc: Location.t;
      pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and class_field_desc (*IF_CURRENT = Parsetree.class_field_desc *) =
    | Pcf_inherit of override_flag * class_expr * string loc option
    (* inherit CE
       inherit CE as x
       inherit! CE
       inherit! CE as x
    *)
    | Pcf_val of (label loc * mutable_flag * class_field_kind)
    (* val x = E
       val virtual x: T
    *)
    | Pcf_method of (label loc * private_flag * class_field_kind)
    (* method x = E            (E can be a Pexp_poly)
       method virtual x: T     (T can be a Ptyp_poly)
    *)
    | Pcf_constraint of (core_type * core_type)
    (* constraint T1 = T2 *)
    | Pcf_initializer of expression
    (* initializer E *)
    | Pcf_attribute of attribute
    (* [@@@id] *)
    | Pcf_extension of extension
    (* [%%id] *)

  and class_field_kind (*IF_CURRENT = Parsetree.class_field_kind *) =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {1 Module language} *)

  (* Type expressions for the module language *)

  and module_type (*IF_CURRENT = Parsetree.module_type *) =
    {
      pmty_desc: module_type_desc;
      pmty_loc: Location.t;
      pmty_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and module_type_desc (*IF_CURRENT = Parsetree.module_type_desc *) =
    | Pmty_ident of Longident.t loc
    (* S *)
    | Pmty_signature of signature
    (* sig ... end *)
    | Pmty_functor of string loc * module_type option * module_type
    (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
    (* MT with ... *)
    | Pmty_typeof of module_expr
    (* module type of ME *)
    | Pmty_extension of extension
    (* [%id] *)
    | Pmty_alias of Longident.t loc
    (* (module M) *)

  and signature = signature_item list

  and signature_item (*IF_CURRENT = Parsetree.signature_item *) =
    {
      psig_desc: signature_item_desc;
      psig_loc: Location.t;
    }

  and signature_item_desc (*IF_CURRENT = Parsetree.signature_item_desc *) =
    | Psig_value of value_description
        (*
       val x: T
       external x: T = "s1" ... "sn"
    *)
    | Psig_type of rec_flag * type_declaration list
    (* type t1 = ... and ... and tn  = ... *)
    | Psig_typesubst of type_declaration list
    (* type t1 := ... and ... and tn := ...  *)
    | Psig_typext of type_extension
    (* type t1 += ... *)
    | Psig_exception of type_exception
    (* exception C of T *)
    | Psig_module of module_declaration
    (* module X = M
       module X : MT *)
    | Psig_modsubst of module_substitution
    (* module X := M *)
    | Psig_recmodule of module_declaration list
    (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
    (* module type S = MT
       module type S *)
    | Psig_open of open_description
    (* open X *)
    | Psig_include of include_description
    (* include MT *)
    | Psig_class of class_description list
    (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
    (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
    (* [@@@id] *)
    | Psig_extension of extension * attributes
    (* [%%id] *)

  and module_declaration (*IF_CURRENT = Parsetree.module_declaration *) =
    {
      pmd_name: string loc;
      pmd_type: module_type;
      pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pmd_loc: Location.t;
    }
  (* S : MT *)

  and module_substitution (*IF_CURRENT = Parsetree.module_substitution *) =
    {
      pms_name: string loc;
      pms_manifest: Longident.t loc;
      pms_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pms_loc: Location.t;
    }

  and module_type_declaration (*IF_CURRENT = Parsetree.module_type_declaration *) =
    {
      pmtd_name: string loc;
      pmtd_type: module_type option;
      pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pmtd_loc: Location.t;
    }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and 'a open_infos (*IF_CURRENT = 'a Parsetree.open_infos *) =
    {
      popen_expr: 'a;
      popen_override: override_flag;
      popen_loc: Location.t;
      popen_attributes: attributes;
    }
  (* open! X - popen_override = Override (silences the 'used identifier
     shadowing' warning)
     open  X - popen_override = Fresh
  *)

  and open_description = Longident.t loc open_infos
  (* open M.N
     open M(N).O *)

  and open_declaration = module_expr open_infos
  (* open M.N
     open M(N).O
     open struct ... end *)

  and 'a include_infos (*IF_CURRENT = 'a Parsetree.include_infos *) =
    {
      pincl_mod: 'a;
      pincl_loc: Location.t;
      pincl_attributes: attributes;
    }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint (*IF_CURRENT = Parsetree.with_constraint *) =
    | Pwith_type of Longident.t loc * type_declaration
    (* with type X.t = ...

       Note: the last component of the longident must match
       the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
    (* with module X.Y = Z *)
    | Pwith_typesubst of Longident.t loc * type_declaration
    (* with type X.t := ..., same format as [Pwith_type] *)
    | Pwith_modsubst of Longident.t loc * Longident.t loc
    (* with module X.Y := Z *)

  (* Value expressions for the module language *)

  and module_expr (*IF_CURRENT = Parsetree.module_expr *) =
    {
      pmod_desc: module_expr_desc;
      pmod_loc: Location.t;
      pmod_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and module_expr_desc (*IF_CURRENT = Parsetree.module_expr_desc *) =
    | Pmod_ident of Longident.t loc
    (* X *)
    | Pmod_structure of structure
    (* struct ... end *)
    | Pmod_functor of string loc * module_type option * module_expr
    (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
    (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
    (* (ME : MT) *)
    | Pmod_unpack of expression
    (* (val E) *)
    | Pmod_extension of extension
    (* [%id] *)

  and structure = structure_item list

  and structure_item (*IF_CURRENT = Parsetree.structure_item *) =
    {
      pstr_desc: structure_item_desc;
      pstr_loc: Location.t;
    }

  and structure_item_desc (*IF_CURRENT = Parsetree.structure_item_desc *) =
    | Pstr_eval of expression * attributes
    (* E *)
    | Pstr_value of rec_flag * value_binding list
    (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
    *)
    | Pstr_primitive of value_description
    (*  val x: T
        external x: T = "s1" ... "sn" *)
    | Pstr_type of rec_flag * type_declaration list
    (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
    (* type t1 += ... *)
    | Pstr_exception of type_exception
    (* exception C of T
       exception C = M.X *)
    | Pstr_module of module_binding
    (* module X = ME *)
    | Pstr_recmodule of module_binding list
    (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
    (* module type S = MT *)
    | Pstr_open of open_declaration
    (* open X *)
    | Pstr_class of class_declaration list
    (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
    (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
    (* include ME *)
    | Pstr_attribute of attribute
    (* [@@@id] *)
    | Pstr_extension of extension * attributes
    (* [%%id] *)

  and value_binding (*IF_CURRENT = Parsetree.value_binding *) =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding (*IF_CURRENT = Parsetree.module_binding *) =
    {
      pmb_name: string loc;
      pmb_expr: module_expr;
      pmb_attributes: attributes;
      pmb_loc: Location.t;
    }
  (* X = ME *)

  (** {1 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase (*IF_CURRENT = Parsetree.toplevel_phrase *) =
    | Ptop_def of structure
    | Ptop_dir of toplevel_directive
    (* #use, #load ... *)

  and toplevel_directive (*IF_CURRENT = Parsetree.toplevel_directive *) =
    {
      pdir_name : string loc;
      pdir_arg : directive_argument option;
      pdir_loc : Location.t;
    }

  and directive_argument (*IF_CURRENT = Parsetree.directive_argument *) =
    {
      pdira_desc : directive_argument_desc;
      pdira_loc : Location.t;
    }

  and directive_argument_desc (*IF_CURRENT = Parsetree.directive_argument_desc *) =
    | Pdir_string of string
    | Pdir_int of string * char option
    | Pdir_ident of Longident.t
    | Pdir_bool of bool

end

module Docstrings : sig
  (** (Re)Initialise all docstring state *)
  val init : unit -> unit

  (** Emit warnings for unattached and ambiguous docstrings *)
  val warn_bad_docstrings : unit -> unit

  (** {2 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Register a docstring *)
  val register : docstring -> unit

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {2 Set functions}

      These functions are used by the lexer to associate docstrings to
      the locations of tokens. *)

  (** Docstrings immediately preceding a token *)
  val set_pre_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately following a token *)
  val set_post_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings not immediately adjacent to a token *)
  val set_floating_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately following the token which precedes this one *)
  val set_pre_extra_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately preceding the token which follows this one *)
  val set_post_extra_docstrings : Lexing.position -> docstring list -> unit

  (** {2 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the item documentation for the current symbol. This also
      marks this documentation (for ambiguity warnings). *)
  val symbol_docs : unit -> docs
  val symbol_docs_lazy : unit -> docs Lazy.t

  (** Fetch the item documentation for the symbols between two
      positions. This also marks this documentation (for ambiguity
      warnings). *)
  val rhs_docs : int -> int -> docs
  val rhs_docs_lazy : int -> int -> docs Lazy.t

  (** Mark the item documentation for the current symbol (for ambiguity
      warnings). *)
  val mark_symbol_docs : unit -> unit

  (** Mark as associated the item documentation for the symbols between
      two positions (for ambiguity warnings) *)
  val mark_rhs_docs : int -> int -> unit

  (** {2 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the field info for the current symbol. *)
  val symbol_info : unit -> info

  (** Fetch the field info following the symbol at a given position. *)
  val rhs_info : int -> info

  (** {2 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text
  val empty_text_lazy : text Lazy.t

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the text preceding the current symbol. *)
  val symbol_text : unit -> text
  val symbol_text_lazy : unit -> text Lazy.t

  (** Fetch the text preceding the symbol at the given position. *)
  val rhs_text : int -> text
  val rhs_text_lazy : int -> text Lazy.t

  (** {2 Extra text}

      There may be additional text attached to the delimiters of a block
      (e.g. [struct] and [end]). This is fetched by the following
      functions, which are applied to the contents of the block rather
      than the delimiters. *)

  (** Fetch additional text preceding the current symbol *)
  val symbol_pre_extra_text : unit -> text

  (** Fetch additional text following the current symbol *)
  val symbol_post_extra_text : unit -> text

  (** Fetch additional text preceding the symbol at the given position *)
  val rhs_pre_extra_text : int -> text

  (** Fetch additional text following the symbol at the given position *)
  val rhs_post_extra_text : int -> text

  (** Fetch text following the symbol at the given position *)
  val rhs_post_text : int -> text

  module WithMenhir: sig
    (** Fetch the item documentation for the current symbol. This also
        marks this documentation (for ambiguity warnings). *)
    val symbol_docs : Lexing.position * Lexing.position -> docs
    val symbol_docs_lazy : Lexing.position * Lexing.position -> docs Lazy.t

    (** Fetch the item documentation for the symbols between two
        positions. This also marks this documentation (for ambiguity
        warnings). *)
    val rhs_docs : Lexing.position -> Lexing.position -> docs
    val rhs_docs_lazy : Lexing.position -> Lexing.position -> docs Lazy.t

    (** Mark the item documentation for the current symbol (for ambiguity
        warnings). *)
    val mark_symbol_docs : Lexing.position * Lexing.position -> unit

    (** Mark as associated the item documentation for the symbols between
        two positions (for ambiguity warnings) *)
    val mark_rhs_docs : Lexing.position -> Lexing.position -> unit

    (** Fetch the field info for the current symbol. *)
    val symbol_info : Lexing.position -> info

    (** Fetch the field info following the symbol at a given position. *)
    val rhs_info : Lexing.position -> info

    (** Fetch the text preceding the current symbol. *)
    val symbol_text : Lexing.position -> text
    val symbol_text_lazy : Lexing.position -> text Lazy.t

    (** Fetch the text preceding the symbol at the given position. *)
    val rhs_text : Lexing.position -> text
    val rhs_text_lazy : Lexing.position -> text Lazy.t

    (** {3 Extra text}

        There may be additional text attached to the delimiters of a block
        (e.g. [struct] and [end]). This is fetched by the following
        functions, which are applied to the contents of the block rather
        than the delimiters. *)

    (** Fetch additional text preceding the current symbol *)
    val symbol_pre_extra_text : Lexing.position -> text

    (** Fetch additional text following the current symbol *)
    val symbol_post_extra_text : Lexing.position -> text

    (** Fetch additional text preceding the symbol at the given position *)
    val rhs_pre_extra_text : Lexing.position -> text

    (** Fetch additional text following the symbol at the given position *)
    val rhs_post_extra_text : Lexing.position -> text

    (** Fetch text following the symbol at the given position *)
    val rhs_post_text : Lexing.position -> text

  end
end = struct
  open Location

  (* Docstrings *)

  (* A docstring is "attached" if it has been inserted in the AST. This
     is used for generating unexpected docstring warnings. *)
  type ds_attached =
    | Unattached   (* Not yet attached anything.*)
    | Info         (* Attached to a field or constructor. *)
    | Docs         (* Attached to an item or as floating text. *)

  (* A docstring is "associated" with an item if there are no blank lines between
     them. This is used for generating docstring ambiguity warnings. *)
  type ds_associated =
    | Zero             (* Not associated with an item *)
    | One              (* Associated with one item *)
    | Many             (* Associated with multiple items (ambiguity) *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t;
      mutable ds_attached: ds_attached;
      mutable ds_associated: ds_associated; }

  (* List of docstrings *)

  let docstrings : docstring list ref = ref []

  (* Warn for unused and ambiguous docstrings *)

  let warn_bad_docstrings () =
    if Warnings.is_active (Warnings.Bad_docstring true) then begin
      List.iter
        (fun ds ->
           match ds.ds_attached with
           | Info -> ()
           | Unattached ->
             prerr_warning ds.ds_loc (Warnings.Bad_docstring true)
           | Docs ->
             match ds.ds_associated with
             | Zero | One -> ()
             | Many ->
               prerr_warning ds.ds_loc (Warnings.Bad_docstring false))
        (List.rev !docstrings)
    end

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc;
        ds_attached = Unattached;
        ds_associated = Zero; }
    in
    ds

  let register ds =
    docstrings := ds :: !docstrings

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_loc_stack = [];
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
    { attr_name = doc_loc;
      attr_payload = PStr [item];
      attr_loc = Location.none }

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []
  let empty_text_lazy = lazy []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_loc_stack = [];
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
    { attr_name = text_loc;
      attr_payload = PStr [item];
      attr_loc = Location.none }

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""; _} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

  (* Find the first non-info docstring in a list, attach it and return it *)
  let get_docstring ~info dsl =
    let rec loop = function
      | [] -> None
      | {ds_attached = Info; _} :: rest -> loop rest
      | ds :: _ ->
        ds.ds_attached <- if info then Info else Docs;
        Some ds
    in
    loop dsl

  (* Find all the non-info docstrings in a list, attach them and return them *)
  let get_docstrings dsl =
    let rec loop acc = function
      | [] -> List.rev acc
      | {ds_attached = Info; _} :: rest -> loop acc rest
      | ds :: rest ->
        ds.ds_attached <- Docs;
        loop (ds :: acc) rest
    in
    loop [] dsl

  (* "Associate" all the docstrings in a list *)
  let associate_docstrings dsl =
    List.iter
      (fun ds ->
         match ds.ds_associated with
         | Zero -> ds.ds_associated <- One
         | (One | Many) -> ds.ds_associated <- Many)
      dsl

  (* Map from positions to pre docstrings *)

  let pre_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_pre_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add pre_table pos dsl

  let get_pre_docs pos =
    try
      let dsl = Hashtbl.find pre_table pos in
      associate_docstrings dsl;
      get_docstring ~info:false dsl
    with Not_found -> None

  let mark_pre_docs pos =
    try
      let dsl = Hashtbl.find pre_table pos in
      associate_docstrings dsl
    with Not_found -> ()

  (* Map from positions to post docstrings *)

  let post_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_post_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add post_table pos dsl

  let get_post_docs pos =
    try
      let dsl = Hashtbl.find post_table pos in
      associate_docstrings dsl;
      get_docstring ~info:false dsl
    with Not_found -> None

  let mark_post_docs pos =
    try
      let dsl = Hashtbl.find post_table pos in
      associate_docstrings dsl
    with Not_found -> ()

  let get_info pos =
    try
      let dsl = Hashtbl.find post_table pos in
      get_docstring ~info:true dsl
    with Not_found -> None

  (* Map from positions to floating docstrings *)

  let floating_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_floating_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add floating_table pos dsl

  let get_text pos =
    try
      let dsl = Hashtbl.find floating_table pos in
      get_docstrings dsl
    with Not_found -> []

  let get_post_text pos =
    try
      let dsl = Hashtbl.find post_table pos in
      get_docstrings dsl
    with Not_found -> []

  (* Maps from positions to extra docstrings *)

  let pre_extra_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_pre_extra_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add pre_extra_table pos dsl

  let get_pre_extra_text pos =
    try
      let dsl = Hashtbl.find pre_extra_table pos in
      get_docstrings dsl
    with Not_found -> []

  let post_extra_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_post_extra_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add post_extra_table pos dsl

  let get_post_extra_text pos =
    try
      let dsl = Hashtbl.find post_extra_table pos in
      get_docstrings dsl
    with Not_found -> []

  (* Docstrings from parser actions *)
  module WithParsing = struct
    let symbol_docs () =
      { docs_pre = get_pre_docs (Parsing.symbol_start_pos ());
        docs_post = get_post_docs (Parsing.symbol_end_pos ()); }

    let symbol_docs_lazy () =
      let p1 = Parsing.symbol_start_pos () in
      let p2 = Parsing.symbol_end_pos () in
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let rhs_docs pos1 pos2 =
      { docs_pre = get_pre_docs (Parsing.rhs_start_pos pos1);
        docs_post = get_post_docs (Parsing.rhs_end_pos pos2); }

    let rhs_docs_lazy pos1 pos2 =
      let p1 = Parsing.rhs_start_pos pos1 in
      let p2 = Parsing.rhs_end_pos pos2 in
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let mark_symbol_docs () =
      mark_pre_docs (Parsing.symbol_start_pos ());
      mark_post_docs (Parsing.symbol_end_pos ())

    let mark_rhs_docs pos1 pos2 =
      mark_pre_docs (Parsing.rhs_start_pos pos1);
      mark_post_docs (Parsing.rhs_end_pos pos2)

    let symbol_info () =
      get_info (Parsing.symbol_end_pos ())

    let rhs_info pos =
      get_info (Parsing.rhs_end_pos pos)

    let symbol_text () =
      get_text (Parsing.symbol_start_pos ())

    let symbol_text_lazy () =
      let pos = Parsing.symbol_start_pos () in
      lazy (get_text pos)

    let rhs_text pos =
      get_text (Parsing.rhs_start_pos pos)

    let rhs_post_text pos =
      get_post_text (Parsing.rhs_end_pos pos)

    let rhs_text_lazy pos =
      let pos = Parsing.rhs_start_pos pos in
      lazy (get_text pos)

    let symbol_pre_extra_text () =
      get_pre_extra_text (Parsing.symbol_start_pos ())

    let symbol_post_extra_text () =
      get_post_extra_text (Parsing.symbol_end_pos ())

    let rhs_pre_extra_text pos =
      get_pre_extra_text (Parsing.rhs_start_pos pos)

    let rhs_post_extra_text pos =
      get_post_extra_text (Parsing.rhs_end_pos pos)
  end

  include WithParsing

  module WithMenhir = struct
    let symbol_docs (startpos, endpos) =
      { docs_pre = get_pre_docs startpos;
        docs_post = get_post_docs endpos; }

    let symbol_docs_lazy (p1, p2) =
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let rhs_docs pos1 pos2 =
      { docs_pre = get_pre_docs pos1;
        docs_post = get_post_docs pos2; }

    let rhs_docs_lazy p1 p2 =
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let mark_symbol_docs (startpos, endpos) =
      mark_pre_docs startpos;
      mark_post_docs endpos;
      ()

    let mark_rhs_docs pos1 pos2 =
      mark_pre_docs pos1;
      mark_post_docs pos2;
      ()

    let symbol_info endpos =
      get_info endpos

    let rhs_info endpos =
      get_info endpos

    let symbol_text startpos =
      get_text startpos

    let symbol_text_lazy startpos =
      lazy (get_text startpos)

    let rhs_text pos =
      get_text pos

    let rhs_post_text pos =
      get_post_text pos

    let rhs_text_lazy pos =
      lazy (get_text pos)

    let symbol_pre_extra_text startpos =
      get_pre_extra_text startpos

    let symbol_post_extra_text endpos =
      get_post_extra_text endpos

    let rhs_pre_extra_text pos =
      get_pre_extra_text pos

    let rhs_post_extra_text pos =
      get_post_extra_text pos
  end

  (* (Re)Initialise all comment state *)

  let init () =
    docstrings := [];
    Hashtbl.reset pre_table;
    Hashtbl.reset post_table;
    Hashtbl.reset floating_table;
    Hashtbl.reset pre_extra_table;
    Hashtbl.reset post_extra_table
end

module Ast_helper : sig
  open Asttypes
  open Docstrings
  open Parsetree

  type 'a with_loc = 'a Location.loc
  type loc = Location.t

  type lid = Longident.t with_loc
  type str = string with_loc
  type attrs = attribute list

  (** {1 Default locations} *)

  val default_loc: loc ref
  (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
  (** Set the [default_loc] within the scope of the execution
      of the provided function. *)

  (** {1 Constants} *)

  module Const : sig
    val char : char -> constant
    val string : ?quotation_delimiter:string -> string -> constant
    val integer : ?suffix:char -> string -> constant
    val int : ?suffix:char -> int -> constant
    val int32 : ?suffix:char -> int32 -> constant
    val int64 : ?suffix:char -> int64 -> constant
    val nativeint : ?suffix:char -> nativeint -> constant
    val float : ?suffix:char -> string -> constant
  end

  (** {1 Attributes} *)
  module Attr : sig
    val mk: ?loc:loc -> str -> payload -> attribute
  end

  (** {1 Core language} *)

  (** Type expressions *)
  module Typ :
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
    val attr: core_type -> attribute -> core_type

    val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
    val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
    val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type -> core_type
      -> core_type
    val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
    val object_: ?loc:loc -> ?attrs:attrs -> object_field list
      -> closed_flag -> core_type
    val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
    val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
    val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
      -> label list option -> core_type
    val poly: ?loc:loc -> ?attrs:attrs -> str list -> core_type -> core_type
    val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
      -> core_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

    val force_poly: core_type -> core_type

    val varify_constructors: str list -> core_type -> core_type
    (** [varify_constructors newtypes te] is type expression [te], of which
        any of nullary type constructor [tc] is replaced by type variable of
        the same name, if [tc]'s name appears in [newtypes].
        Raise [Syntaxerr.Variable_in_scope] if any type variable inside [te]
        appears in [newtypes].
        @since 4.05
    *)
  end

  (** Patterns *)
  module Pat:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
    val attr:pattern -> attribute -> pattern

    val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
    val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
    val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
    val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
    val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
    val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
    val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
    val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
    val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
      -> pattern
    val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
    val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
    val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
    val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
    val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
    val unpack: ?loc:loc -> ?attrs:attrs -> str -> pattern
    val open_: ?loc:loc -> ?attrs:attrs  -> lid -> pattern -> pattern
    val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
  end

  (** Expressions *)
  module Exp:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
    val attr: expression -> attribute -> expression

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
    val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
    val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
      -> expression -> expression
    val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option
      -> pattern -> expression -> expression
    val function_: ?loc:loc -> ?attrs:attrs -> cases -> expression
    val apply: ?loc:loc -> ?attrs:attrs -> expression
      -> (arg_label * expression) list -> expression
    val match_: ?loc:loc -> ?attrs:attrs -> expression -> cases
      -> expression
    val try_: ?loc:loc -> ?attrs:attrs -> expression -> cases -> expression
    val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
    val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
      -> expression
    val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
      -> expression
    val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
      -> expression option -> expression
    val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
    val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      -> expression
    val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
    val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression option -> expression
    val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression
    val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression
    val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
      -> direction_flag -> expression -> expression
    val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
      -> core_type -> expression
    val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
      -> expression
    val send: ?loc:loc -> ?attrs:attrs -> expression -> str -> expression
    val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
    val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
    val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
      -> expression
    val letmodule: ?loc:loc -> ?attrs:attrs -> str -> module_expr -> expression
      -> expression
    val letexception:
      ?loc:loc -> ?attrs:attrs -> extension_constructor -> expression
      -> expression
    val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
    val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
    val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
      -> expression
    val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
    val newtype: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
    val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
    val open_: ?loc:loc -> ?attrs:attrs -> open_declaration -> expression
      -> expression
    val letop: ?loc:loc -> ?attrs:attrs -> binding_op
      -> binding_op list -> expression -> expression
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression
    val unreachable: ?loc:loc -> ?attrs:attrs -> unit -> expression

    val case: pattern -> ?guard:expression -> expression -> case
    val binding_op: str -> pattern -> expression -> loc -> binding_op
  end

  (** Value declarations *)
  module Val:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      ?prim:string list -> str -> core_type -> value_description
  end

  (** Type declarations *)
  module Type:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?params:(core_type * variance) list ->
      ?cstrs:(core_type * core_type * loc) list ->
      ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
      type_declaration

    val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
      ?args:constructor_arguments -> ?res:core_type -> str ->
      constructor_declaration
    val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
      ?mut:mutable_flag -> str -> core_type -> label_declaration
  end

  (** Type extensions *)
  module Te:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      ?params:(core_type * variance) list -> ?priv:private_flag ->
      lid -> extension_constructor list -> type_extension

    val mk_exception: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      extension_constructor -> type_exception

    val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      str -> extension_constructor_kind -> extension_constructor

    val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      ?args:constructor_arguments -> ?res:core_type -> str ->
      extension_constructor
    val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      str -> lid -> extension_constructor
  end

  (** {1 Module language} *)

  (** Module type expressions *)
  module Mty:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
    val attr: module_type -> attribute -> module_type

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
    val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
    val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
    val functor_: ?loc:loc -> ?attrs:attrs ->
      str -> module_type option -> module_type -> module_type
    val with_: ?loc:loc -> ?attrs:attrs -> module_type ->
      with_constraint list -> module_type
    val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
  end

  (** Module expressions *)
  module Mod:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
    val attr: module_expr -> attribute -> module_expr

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
    val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
    val functor_: ?loc:loc -> ?attrs:attrs ->
      str -> module_type option -> module_expr -> module_expr
    val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr ->
      module_expr
    val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type ->
      module_expr
    val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
  end

  (** Signature items *)
  module Sig:
  sig
    val mk: ?loc:loc -> signature_item_desc -> signature_item

    val value: ?loc:loc -> value_description -> signature_item
    val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item
    val type_subst: ?loc:loc -> type_declaration list -> signature_item
    val type_extension: ?loc:loc -> type_extension -> signature_item
    val exception_: ?loc:loc -> type_exception -> signature_item
    val module_: ?loc:loc -> module_declaration -> signature_item
    val mod_subst: ?loc:loc -> module_substitution -> signature_item
    val rec_module: ?loc:loc -> module_declaration list -> signature_item
    val modtype: ?loc:loc -> module_type_declaration -> signature_item
    val open_: ?loc:loc -> open_description -> signature_item
    val include_: ?loc:loc -> include_description -> signature_item
    val class_: ?loc:loc -> class_description list -> signature_item
    val class_type: ?loc:loc -> class_type_declaration list -> signature_item
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
    val attribute: ?loc:loc -> attribute -> signature_item
    val text: text -> signature_item list
  end

  (** Structure items *)
  module Str:
  sig
    val mk: ?loc:loc -> structure_item_desc -> structure_item

    val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
    val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
    val primitive: ?loc:loc -> value_description -> structure_item
    val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item
    val type_extension: ?loc:loc -> type_extension -> structure_item
    val exception_: ?loc:loc -> type_exception -> structure_item
    val module_: ?loc:loc -> module_binding -> structure_item
    val rec_module: ?loc:loc -> module_binding list -> structure_item
    val modtype: ?loc:loc -> module_type_declaration -> structure_item
    val open_: ?loc:loc -> open_declaration -> structure_item
    val class_: ?loc:loc -> class_declaration list -> structure_item
    val class_type: ?loc:loc -> class_type_declaration list -> structure_item
    val include_: ?loc:loc -> include_declaration -> structure_item
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
    val attribute: ?loc:loc -> attribute -> structure_item
    val text: text -> structure_item list
  end

  (** Module declarations *)
  module Md:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> module_type -> module_declaration
  end

  (** Module substitutions *)
  module Ms:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> lid -> module_substitution
  end

  (** Module type declarations *)
  module Mtd:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?typ:module_type -> str -> module_type_declaration
  end

  (** Module bindings *)
  module Mb:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> module_expr -> module_binding
  end

  (** Opens *)
  module Opn:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
      ?override:override_flag -> 'a -> 'a open_infos
  end

  (** Includes *)
  module Incl:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
  end

  (** Value bindings *)
  module Vb:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      pattern -> expression -> value_binding
  end


  (** {1 Class language} *)

  (** Class type expressions *)
  module Cty:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
    val attr: class_type -> attribute -> class_type

    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
    val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
    val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type ->
      class_type -> class_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
    val open_: ?loc:loc -> ?attrs:attrs -> open_description -> class_type
      -> class_type
  end

  (** Class type fields *)
  module Ctf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      class_type_field_desc -> class_type_field
    val attr: class_type_field -> attribute -> class_type_field

    val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
    val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
      virtual_flag -> core_type -> class_type_field
    val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
      virtual_flag -> core_type -> class_type_field
    val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
      class_type_field
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
    val attribute: ?loc:loc -> attribute -> class_type_field
    val text: text -> class_type_field list
  end

  (** Class expressions *)
  module Cl:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
    val attr: class_expr -> attribute -> class_expr

    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
    val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
    val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option ->
      pattern -> class_expr -> class_expr
    val apply: ?loc:loc -> ?attrs:attrs -> class_expr ->
      (arg_label * expression) list -> class_expr
    val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list ->
      class_expr -> class_expr
    val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type ->
      class_expr
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
    val open_: ?loc:loc -> ?attrs:attrs -> open_description -> class_expr
      -> class_expr
  end

  (** Class fields *)
  module Cf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
      class_field
    val attr: class_field -> attribute -> class_field

    val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr ->
      str option -> class_field
    val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
      class_field_kind -> class_field
    val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
      class_field_kind -> class_field
    val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
      class_field
    val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
    val attribute: ?loc:loc -> attribute -> class_field
    val text: text -> class_field list

    val virtual_: core_type -> class_field_kind
    val concrete: override_flag -> expression -> class_field_kind

  end

  (** Classes *)
  module Ci:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?virt:virtual_flag -> ?params:(core_type * variance) list ->
      str -> 'a -> 'a class_infos
  end

  (** Class signatures *)
  module Csig:
  sig
    val mk: core_type -> class_type_field list -> class_signature
  end

  (** Class structures *)
  module Cstr:
  sig
    val mk: pattern -> class_field list -> class_structure
  end

  (** Row fields *)
  module Rf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> row_field_desc -> row_field
    val tag: ?loc:loc -> ?attrs:attrs ->
      label with_loc -> bool -> core_type list -> row_field
    val inherit_: ?loc:loc -> core_type -> row_field
  end

  (** Object fields *)
  module Of:
  sig
    val mk: ?loc:loc -> ?attrs:attrs ->
      object_field_desc -> object_field
    val tag: ?loc:loc -> ?attrs:attrs ->
      label with_loc -> core_type -> object_field
    val inherit_: ?loc:loc -> core_type -> object_field
  end
end = struct
  open Asttypes
  open Parsetree
  open Docstrings

  type 'a with_loc = 'a Location.loc
  type loc = Location.t

  type lid = Longident.t with_loc
  type str = string with_loc
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    Misc.protect_refs [Misc.R (default_loc, l)] f

  module Const = struct
    let integer ?suffix i = Pconst_integer (i, suffix)
    let int ?suffix i = integer ?suffix (Int.to_string i)
    let int32 ?(suffix='l') i = integer ~suffix (Int32.to_string i)
    let int64 ?(suffix='L') i = integer ~suffix (Int64.to_string i)
    let nativeint ?(suffix='n') i = integer ~suffix (Nativeint.to_string i)
    let float ?suffix f = Pconst_float (f, suffix)
    let char c = Pconst_char c
    let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter)
  end

  module Attr = struct
    let mk ?(loc= !default_loc) name payload =
      { attr_name = name;
        attr_payload = payload;
        attr_loc = loc }
  end

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d;
       ptyp_loc = loc;
       ptyp_loc_stack = [];
       ptyp_attributes = attrs}

    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)

    let varify_constructors var_names t =
      let check_variable vl loc v =
        if List.mem v vl then
          raise Syntaxerr.(Error(Variable_in_scope(loc,v))) in
      let var_names = List.map (fun v -> v.txt) var_names in
      let rec loop t =
        let desc =
          match t.ptyp_desc with
          | Ptyp_any -> Ptyp_any
          | Ptyp_var x ->
            check_variable var_names t.ptyp_loc x;
            Ptyp_var x
          | Ptyp_arrow (label,core_type,core_type') ->
            Ptyp_arrow(label, loop core_type, loop core_type')
          | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
          | Ptyp_constr( { txt = Longident.Lident s; _ }, [])
            when List.mem s var_names ->
            Ptyp_var s
          | Ptyp_constr(longident, lst) ->
            Ptyp_constr(longident, List.map loop lst)
          | Ptyp_object (lst, o) ->
            Ptyp_object (List.map loop_object_field lst, o)
          | Ptyp_class (longident, lst) ->
            Ptyp_class (longident, List.map loop lst)
          | Ptyp_alias(core_type, string) ->
            check_variable var_names t.ptyp_loc string;
            Ptyp_alias(loop core_type, string)
          | Ptyp_variant(row_field_list, flag, lbl_lst_option) ->
            Ptyp_variant(List.map loop_row_field row_field_list,
                         flag, lbl_lst_option)
          | Ptyp_poly(string_lst, core_type) ->
            List.iter (fun v ->
              check_variable var_names t.ptyp_loc v.txt) string_lst;
            Ptyp_poly(string_lst, loop core_type)
          | Ptyp_package(longident,lst) ->
            Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
          | Ptyp_extension (s, arg) ->
            Ptyp_extension (s, arg)
        in
        {t with ptyp_desc = desc}
      and loop_row_field field =
        let prf_desc = match field.prf_desc with
          | Rtag(label,flag,lst) ->
            Rtag(label,flag,List.map loop lst)
          | Rinherit t ->
            Rinherit (loop t)
        in
        { field with prf_desc; }
      and loop_object_field field =
        let pof_desc = match field.pof_desc with
          | Otag(label, t) ->
            Otag(label, loop t)
          | Oinherit t ->
            Oinherit (loop t)
        in
        { field with pof_desc; }
      in
      loop t

  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d;
       ppat_loc = loc;
       ppat_loc_stack = [];
       ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b))
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d;
       pexp_loc = loc;
       pexp_loc_stack = [];
       pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let letexception ?loc ?attrs a b = mk ?loc ?attrs (Pexp_letexception (a, b))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_open (a, b))
    let letop ?loc ?attrs let_ ands body =
      mk ?loc ?attrs (Pexp_letop {let_; ands; body})
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)
    let unreachable ?loc ?attrs () = mk ?loc ?attrs Pexp_unreachable

    let case lhs ?guard rhs =
      {
        pc_lhs = lhs;
        pc_guard = guard;
        pc_rhs = rhs;
      }

    let binding_op op pat exp loc =
      {
        pbop_op = op;
        pbop_pat = pat;
        pbop_exp = exp;
        pbop_loc = loc;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b c = mk ?loc ?attrs (Pmty_functor (a, b, c))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg arg_ty body =
      mk ?loc ?attrs (Pmod_functor (arg, arg_ty, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc rec_flag a = mk ?loc (Psig_type (rec_flag, a))
    let type_subst ?loc a = mk ?loc (Psig_typesubst a)
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let mod_subst ?loc a = mk ?loc (Psig_modsubst a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
        pcl_desc = d;
        pcl_loc = loc;
        pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_open (a, b))
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
        pcty_desc = d;
        pcty_loc = loc;
        pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pcty_open (a, b))
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
        pctf_desc = d;
        pctf_loc = loc;
        pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) d =
      {
        pcf_desc = d;
        pcf_loc = loc;
        pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(prim = []) name typ =
      {
        pval_name = name;
        pval_type = typ;
        pval_attributes = add_docs_attrs docs attrs;
        pval_loc = loc;
        pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name typ =
      {
        pmd_name = name;
        pmd_type = typ;
        pmd_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmd_loc = loc;
      }
  end

  module Ms = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name syn =
      {
        pms_name = name;
        pms_manifest = syn;
        pms_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pms_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) ?typ name =
      {
        pmtd_name = name;
        pmtd_type = typ;
        pmtd_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = []) name expr =
      {
        pmb_name = name;
        pmb_expr = expr;
        pmb_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(override = Fresh) expr =
      {
        popen_expr = expr;
        popen_override = override;
        popen_loc = loc;
        popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
        pincl_mod = mexpr;
        pincl_loc = loc;
        pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(text = []) pat expr =
      {
        pvb_pat = pat;
        pvb_expr = expr;
        pvb_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(virt = Concrete) ?(params = []) name expr =
      {
        pci_virt = virt;
        pci_params = params;
        pci_name = name;
        pci_expr = expr;
        pci_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(text = [])
          ?(params = [])
          ?(cstrs = [])
          ?(kind = Ptype_abstract)
          ?(priv = Public)
          ?manifest
          name =
      {
        ptype_name = name;
        ptype_params = params;
        ptype_cstrs = cstrs;
        ptype_kind = kind;
        ptype_private = priv;
        ptype_manifest = manifest;
        ptype_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(args = Pcstr_tuple []) ?res name =
      {
        pcd_name = name;
        pcd_args = args;
        pcd_res = res;
        pcd_loc = loc;
        pcd_attributes = add_info_attrs info attrs;
      }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
          ?(mut = Immutable) name typ =
      {
        pld_name = name;
        pld_mutable = mut;
        pld_type = typ;
        pld_loc = loc;
        pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(params = []) ?(priv = Public) path constructors =
      {
        ptyext_path = path;
        ptyext_params = params;
        ptyext_constructors = constructors;
        ptyext_private = priv;
        ptyext_loc = loc;
        ptyext_attributes = add_docs_attrs docs attrs;
      }

    let mk_exception ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          constructor =
      {
        ptyexn_constructor = constructor;
        ptyexn_loc = loc;
        ptyexn_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
        pext_name = name;
        pext_kind = kind;
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
          ?(info = empty_info) ?(args = Pcstr_tuple []) ?res name =
      {
        pext_name = name;
        pext_kind = Pext_decl(args, res);
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
          ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
        pext_name = name;
        pext_kind = Pext_rebind lid;
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
        pcsig_self = self;
        pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
        pcstr_self = self;
        pcstr_fields = fields;
      }
  end

  (** Row fields *)
  module Rf = struct
    let mk ?(loc = !default_loc) ?(attrs = []) desc = {
      prf_desc = desc;
      prf_loc = loc;
      prf_attributes = attrs;
    }
    let tag ?loc ?attrs label const tys =
      mk ?loc ?attrs (Rtag (label, const, tys))
    let inherit_?loc ty =
      mk ?loc (Rinherit ty)
  end

  (** Object fields *)
  module Of = struct
    let mk ?(loc = !default_loc) ?(attrs=[]) desc = {
      pof_desc = desc;
      pof_loc = loc;
      pof_attributes = attrs;
    }
    let tag ?loc ?attrs label ty =
      mk ?loc ?attrs (Otag (label, ty))
    let inherit_ ?loc ty =
      mk ?loc (Oinherit ty)
  end
end

module Ast_mapper : sig
  open Parsetree

  (** {1 A generic Parsetree mapper} *)

  type mapper (*IF_CURRENT = Ast_mapper.mapper *) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    binding_op: mapper -> binding_op -> binding_op;
    case: mapper -> case -> case;
    cases: mapper -> cases -> cases;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
      -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
      -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
      -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_substitution: mapper -> module_substitution -> module_substitution;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
      -> module_type_declaration;
    open_declaration: mapper -> open_declaration -> open_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_exception: mapper -> type_exception -> type_exception;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {1 Apply mappers to compilation units} *)

  val tool_name: unit -> string
  (** Can be used within a ppx preprocessor to know which tool is
      calling it ["ocamlc"], ["ocamlopt"], ["ocamldoc"], ["ocamldep"],
      ["ocaml"], ...  Some global variables that reflect command-line
      options are automatically synchronized between the calling tool
      and the ppx preprocessor: {!Clflags.include_dirs},
      {!Load_path}, {!Clflags.open_modules}, {!Clflags.for_package},
      {!Clflags.debug}. *)


  val apply: source:string -> target:string -> mapper -> unit
  (** Apply a mapper (parametrized by the unit name) to a dumped
      parsetree found in the [source] file and put the result in the
      [target] file. The [structure] or [signature] field of the mapper
      is applied to the implementation or interface.  *)

  val run_main: (string list -> mapper) -> unit
  (** Entry point to call to implement a standalone -ppx rewriter from a
      mapper, parametrized by the command line arguments.  The current
      unit name can be obtained from {!Location.input_name}.  This
      function implements proper error reporting for uncaught
      exceptions. *)

  (** {1 Registration API} *)

  val register_function: (string -> (string list -> mapper) -> unit) ref

  val register: string -> (string list -> mapper) -> unit
  (** Apply the [register_function].  The default behavior is to run the
      mapper immediately, taking arguments from the process command
      line.  This is to support a scenario where a mapper is linked as a
      stand-alone executable.

      It is possible to overwrite the [register_function] to define
      "-ppx drivers", which combine several mappers in a single process.
      Typically, a driver starts by defining [register_function] to a
      custom implementation, then lets ppx rewriters (linked statically
      or dynamically) register themselves, and then run all or some of
      them.  It is also possible to have -ppx drivers apply rewriters to
      only specific parts of an AST.

      The first argument to [register] is a symbolic name to be used by
      the ppx driver.  *)


  (** {1 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

  include Locations.Helpers_intf

  (** {1 Helper functions to call external mappers} *)

  val add_ppx_context_str:
    tool_name:string -> Parsetree.structure -> Parsetree.structure
  (** Extract information from the current environment and encode it
      into an attribute which is prepended to the list of structure
      items in order to pass the information to an external
      processor. *)

  val add_ppx_context_sig:
    tool_name:string -> Parsetree.signature -> Parsetree.signature
  (** Same as [add_ppx_context_str], but for signatures. *)

  val drop_ppx_context_str:
    restore:bool -> Parsetree.structure -> Parsetree.structure
  (** Drop the ocaml.ppx.context attribute from a structure.  If
      [restore] is true, also restore the associated data in the current
      process. *)

  val drop_ppx_context_sig:
    restore:bool -> Parsetree.signature -> Parsetree.signature
  (** Same as [drop_ppx_context_str], but for signatures. *)

  (** {1 Cookies} *)

  (** Cookies are used to pass information from a ppx processor to
      a further invocation of itself, when called from the OCaml
      toplevel (or other tools that support cookies). *)

  val set_cookie: string -> Parsetree.expression -> unit
  val get_cookie: string -> Parsetree.expression option
end = struct
  open Parsetree
  open Ast_helper
  open Location

  module String = Misc.Stdlib.String

  type mapper (*IF_CURRENT = Ast_mapper.mapper *) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    binding_op: mapper -> binding_op -> binding_op;
    case: mapper -> case -> case;
    cases: mapper -> cases -> cases;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
      -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
      -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
      -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_substitution: mapper -> module_substitution -> module_substitution;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
      -> module_type_declaration;
    open_declaration: mapper -> open_declaration -> open_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_exception: mapper -> type_exception -> type_exception;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub {
      prf_desc;
      prf_loc;
      prf_attributes;
    } =
      let loc = sub.location sub prf_loc in
      let attrs = sub.attributes sub prf_attributes in
      let desc = match prf_desc with
        | Rtag (l, b, tl) -> Rtag (map_loc sub l, b, List.map (sub.typ sub) tl)
        | Rinherit t -> Rinherit (sub.typ sub t)
      in
      Rf.mk ~loc ~attrs desc

    let object_field sub {
      pof_desc;
      pof_loc;
      pof_attributes;
    } =
      let loc = sub.location sub pof_loc in
      let attrs = sub.attributes sub pof_attributes in
      let desc = match pof_desc with
        | Otag (l, t) -> Otag (map_loc sub l, sub.typ sub t)
        | Oinherit t -> Oinherit (sub.typ sub t)
      in
      Of.mk ~loc ~attrs desc

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs; ptyp_loc_stack = _ } =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
        arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
        object_ ~loc ~attrs (List.map (object_field sub) l) o
      | Ptyp_class (lid, tl) ->
        class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
        variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs
                               (List.map (map_loc sub) sl) (sub.typ sub t)
      | Ptyp_package (lid, l) ->
        package ~loc ~attrs (map_loc sub lid)
          (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
          {ptype_name; ptype_params; ptype_cstrs;
           ptype_kind;
           ptype_private;
           ptype_manifest;
           ptype_attributes;
           ptype_loc} =
      let loc = sub.location sub ptype_loc in
      let attrs = sub.attributes sub ptype_attributes in
      Type.mk ~loc ~attrs (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
        Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_constructor_arguments sub = function
      | Pcstr_tuple l -> Pcstr_tuple (List.map (sub.typ sub) l)
      | Pcstr_record l ->
        Pcstr_record (List.map (sub.label_declaration sub) l)

    let map_type_extension sub
          {ptyext_path; ptyext_params;
           ptyext_constructors;
           ptyext_private;
           ptyext_loc;
           ptyext_attributes} =
      let loc = sub.location sub ptyext_loc in
      let attrs = sub.attributes sub ptyext_attributes in
      Te.mk ~loc ~attrs
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private

    let map_type_exception sub
          {ptyexn_constructor; ptyexn_loc; ptyexn_attributes} =
      let loc = sub.location sub ptyexn_loc in
      let attrs = sub.attributes sub ptyexn_attributes in
      Te.mk_exception ~loc ~attrs
        (sub.extension_constructor sub ptyexn_constructor)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
        Pext_decl(map_constructor_arguments sub ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
        Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
          {pext_name;
           pext_kind;
           pext_loc;
           pext_attributes} =
      let loc = sub.location sub pext_loc in
      let attrs = sub.attributes sub pext_attributes in
      Te.constructor ~loc ~attrs
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
        arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcty_open (o, ct) ->
        open_ ~loc ~attrs (sub.open_description sub o) (sub.class_type sub ct)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) ->
        val_ ~loc ~attrs (map_loc sub s) m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) ->
        method_ ~loc ~attrs (map_loc sub s) p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
        constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (s, mt1, mt2) ->
        functor_ ~loc ~attrs (map_loc sub s)
          (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) mt1)
          (sub.module_type sub mt2)
      | Pmty_with (mt, l) ->
        with_ ~loc ~attrs (sub.module_type sub mt)
          (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
        Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
        Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst (lid, d) ->
        Pwith_typesubst (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
        Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type (rf, l) ->
        type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Psig_typesubst l ->
        type_subst ~loc (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.type_exception sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_modsubst x -> mod_subst ~loc (sub.module_substitution sub x)
      | Psig_recmodule l ->
        rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
        class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
        let attrs = sub.attributes sub attrs in
        extension ~loc ~attrs (sub.extension sub x)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (arg, arg_ty, body) ->
        functor_ ~loc ~attrs (map_loc sub arg)
          (Migrate_parsetree_compiler_functions.may_map (sub.module_type sub) arg_ty)
          (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
        apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
        constraint_ ~loc ~attrs (sub.module_expr sub m)
          (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
        let attrs = sub.attributes sub attrs in
        eval ~loc ~attrs (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.type_exception sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_declaration sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
        class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
        let attrs = sub.attributes sub attrs in
        extension ~loc ~attrs (sub.extension sub x)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs; pexp_loc_stack = _ } =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
        let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
          (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
        fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
          (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
        apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
        match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
        construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
        variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
        record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
          (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
        field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
        setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
          (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
        ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
          (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
        sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
        while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
        for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
          (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
        coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
          (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
        constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) ->
        send ~loc ~attrs (sub.expr sub e) (map_loc sub s)
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
        setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
        override ~loc ~attrs
          (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
        letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
          (sub.expr sub e)
      | Pexp_letexception (cd, e) ->
        letexception ~loc ~attrs
          (sub.extension_constructor sub cd)
          (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
        poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) ->
        newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (o, e) ->
        open_ ~loc ~attrs (sub.open_declaration sub o) (sub.expr sub e)
      | Pexp_letop {let_; ands; body} ->
        letop ~loc ~attrs (sub.binding_op sub let_)
          (List.map (sub.binding_op sub) ands) (sub.expr sub body)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pexp_unreachable -> unreachable ~loc ~attrs ()

    let map_binding_op sub {pbop_op; pbop_pat; pbop_exp; pbop_loc} =
      let open Exp in
      let op = map_loc sub pbop_op in
      let pat = sub.pat sub pbop_pat in
      let exp = sub.expr sub pbop_exp in
      let loc = sub.location sub pbop_loc in
      binding_op op pat exp loc

  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs; ppat_loc_stack = _ } =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
        construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
        record ~loc ~attrs
          (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
        constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
        constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
        structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
        fun_ ~loc ~attrs lab
          (map_opt (sub.expr sub) e)
          (sub.pat sub p)
          (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
        apply ~loc ~attrs (sub.class_expr sub ce)
          (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
        let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
          (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
        constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcl_open (o, ce) ->
        open_ ~loc ~attrs (sub.open_description sub o) (sub.class_expr sub ce)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) ->
        inherit_ ~loc ~attrs o (sub.class_expr sub ce)
          (map_opt (map_loc sub) s)
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
        method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
        constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      let loc = sub.location sub pci_loc in
      let attrs = sub.attributes sub pci_attributes in
      Ci.mk ~loc ~attrs
        ~virt:pci_virt
        ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      type_exception = T.map_type_exception;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;
      binding_op = E.map_binding_op;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_substitution =
        (fun this {pms_name; pms_manifest; pms_attributes; pms_loc} ->
           Ms.mk
             (map_loc this pms_name)
             (map_loc this pms_manifest)
             ~attrs:(this.attributes this pms_attributes)
             ~loc:(this.location this pms_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_declaration =
        (fun this {popen_expr; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (this.module_expr this popen_expr)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );

      open_description =
        (fun this {popen_expr; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_expr)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );

      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
           Type.constructor
             (map_loc this pcd_name)
             ~args:(T.map_constructor_arguments this pcd_args)
             ?res:(map_opt (this.typ this) pcd_res)
             ~loc:(this.location this pcd_loc)
             ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this a ->
        {
          attr_name = map_loc this a.attr_name;
          attr_payload = this.payload this a.attr_payload;
          attr_loc = this.location this a.attr_loc
        }
      );
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PSig x -> PSig (this.signature this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(fun x -> PStr x)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Pconst_string (x, None))))
      error

  let attribute_of_warning loc s =
    Attr.mk
      {loc; txt = "ocaml.ppwarning" }
      (PStr ([Str.eval ~loc (Exp.constant (Pconst_string (s, None)))]))

  include Locations.Helpers_impl

  let cookies = ref String.Map.empty

  let get_cookie k =
    try Some (String.Map.find k !cookies)
    with Not_found -> None

  let set_cookie k v =
    cookies := String.Map.add k v !cookies

  let tool_name_ref = ref "_none_"

  let tool_name () = !tool_name_ref


  module PpxContext = struct
    open Longident
    open Asttypes
    open Ast_helper

    let lid name = { txt = Lident name; loc = Location.none }

    let make_string x = Exp.constant (Pconst_string (x, None))

    let make_bool x =
      if x
      then Exp.construct (lid "true") None
      else Exp.construct (lid "false") None

    let rec make_list f lst =
      match lst with
      | x :: rest ->
        Exp.construct (lid "::") (Some (Exp.tuple [f x; make_list f rest]))
      | [] ->
        Exp.construct (lid "[]") None

    let make_pair f1 f2 (x1, x2) =
      Exp.tuple [f1 x1; f2 x2]

    let make_option f opt =
      match opt with
      | Some x -> Exp.construct (lid "Some") (Some (f x))
      | None   -> Exp.construct (lid "None") None

    let get_cookies () =
      lid "cookies",
      make_list (make_pair make_string (fun x -> x))
        (String.Map.bindings !cookies)

    let mk fields =
      {
        attr_name = { txt = "ocaml.ppx.context"; loc = Location.none };
        attr_payload = Parsetree.PStr [Str.eval (Exp.record fields None)];
        attr_loc = Location.none
      }

    let make ~tool_name () =
      let fields =
        [
          lid "tool_name",    make_string tool_name;
          lid "include_dirs", make_list make_string !Clflags.include_dirs;
          lid "load_path",    make_list make_string (Migrate_parsetree_compiler_functions.get_load_paths ());
          lid "open_modules", make_list make_string !Clflags.open_modules;
          lid "for_package",  make_option make_string !Clflags.for_package;
          lid "debug",        make_bool !Clflags.debug;
          lid "use_threads",  make_bool !Clflags.use_threads;
          lid "recursive_types", make_bool !Clflags.recursive_types;
          lid "principal", make_bool !Clflags.principal;
          lid "transparent_modules", make_bool !Clflags.transparent_modules;
          lid "unboxed_types", make_bool (Migrate_parsetree_compiler_functions.get_unboxed_types ());
          lid "unsafe_string", make_bool !Clflags.unsafe_string;
          get_cookies ()
        ]
      in
      mk fields

    let get_fields = function
      | PStr [{pstr_desc = Pstr_eval
                             ({ pexp_desc = Pexp_record (fields, None); _ }, []); _}] ->
        fields
      | _ ->
        raise_errorf "Internal error: invalid [@@@ocaml.ppx.context] syntax"

    let restore fields =
      let field name payload =
        let rec get_string = function
          | { pexp_desc = Pexp_constant (Pconst_string (str, None)); _ } -> str
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] string syntax" name
        and get_bool pexp =
          match pexp with
          | {pexp_desc = Pexp_construct ({txt = Longident.Lident "true"; _},
                                         None); _} ->
            true
          | {pexp_desc = Pexp_construct ({txt = Longident.Lident "false"; _},
                                         None); _} ->
            false
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] bool syntax" name
        and get_list elem = function
          | {pexp_desc =
               Pexp_construct ({txt = Longident.Lident "::"; _},
                               Some {pexp_desc = Pexp_tuple [exp; rest]; _}); _ } ->
            elem exp :: get_list elem rest
          | {pexp_desc =
               Pexp_construct ({txt = Longident.Lident "[]"; _}, None); _ } ->
            []
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] list syntax" name
        and get_pair f1 f2 = function
          | {pexp_desc = Pexp_tuple [e1; e2]; _} ->
            (f1 e1, f2 e2)
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] pair syntax" name
        and get_option elem = function
          | { pexp_desc =
                Pexp_construct ({ txt = Longident.Lident "Some"; _ }, Some exp); _ } ->
            Some (elem exp)
          | { pexp_desc =
                Pexp_construct ({ txt = Longident.Lident "None"; _ }, None); _ } ->
            None
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] option syntax" name
        in
        match name with
        | "tool_name" ->
          tool_name_ref := get_string payload
        | "include_dirs" ->
          Clflags.include_dirs := get_list get_string payload
        | "load_path" ->
           Migrate_parsetree_compiler_functions.load_path_init (get_list get_string payload)
        | "open_modules" ->
          Clflags.open_modules := get_list get_string payload
        | "for_package" ->
          Clflags.for_package := get_option get_string payload
        | "debug" ->
          Clflags.debug := get_bool payload
        | "use_threads" ->
          Clflags.use_threads := get_bool payload
        | "recursive_types" ->
          Clflags.recursive_types := get_bool payload
        | "principal" ->
          Clflags.principal := get_bool payload
        | "transparent_modules" ->
          Clflags.transparent_modules := get_bool payload
        | "unboxed_types" ->
          Migrate_parsetree_compiler_functions.set_unboxed_types (get_bool payload)
        | "unsafe_string" ->
          Clflags.unsafe_string := get_bool payload
        | "cookies" ->
          let l = get_list (get_pair get_string (fun x -> x)) payload in
          cookies :=
            List.fold_left
              (fun s (k, v) -> String.Map.add k v s) String.Map.empty
              l
        | _ ->
          ()
      in
      List.iter (function ({txt=Lident name; _}, x) -> field name x | _ -> ()) fields

    let update_cookies fields =
      let fields =
        List.filter
          (function ({txt=Lident "cookies"; _}, _) -> false | _ -> true)
          fields
      in
      fields @ [get_cookies ()]
  end

  let ppx_context = PpxContext.make

  let extension_of_exn exn = extension_of_error (Locations.location_error_of_exn exn)

  let apply_lazy ~source ~target mapper =
    let implem ast =
      let fields, ast =
        match ast with
        | {pstr_desc = Pstr_attribute ({attr_name = {txt = "ocaml.ppx.context"; _};
                                        attr_payload = x; _}); _} :: l ->
          PpxContext.get_fields x, l
        | _ -> [], ast
      in
      PpxContext.restore fields;
      let ast =
        try
          let mapper = mapper () in
          mapper.structure mapper ast
        with exn ->
          [{pstr_desc = Pstr_extension (extension_of_exn exn, []);
            pstr_loc  = Location.none}]
      in
      let fields = PpxContext.update_cookies fields in
      Str.attribute (PpxContext.mk fields) :: ast
    in
    let iface ast =
      let fields, ast =
        match ast with
        | {psig_desc = Psig_attribute ({attr_name = {txt = "ocaml.ppx.context"; _};
                                        attr_payload = x;
                                        attr_loc = _}); _} :: l ->
          PpxContext.get_fields x, l
        | _ -> [], ast
      in
      PpxContext.restore fields;
      let ast =
        try
          let mapper = mapper () in
          mapper.signature mapper ast
        with exn ->
          [{psig_desc = Psig_extension (extension_of_exn exn, []);
            psig_loc  = Location.none}]
      in
      let fields = PpxContext.update_cookies fields in
      Sig.attribute (PpxContext.mk fields) :: ast
    in

    let ic = open_in_bin source in
    let magic =
      really_input_string ic (String.length Config.ast_impl_magic_number)
    in

    let rewrite transform =
      Location.input_name := input_value ic;
      let ast = input_value ic in
      close_in ic;
      let ast = transform ast in
      let oc = open_out_bin target in
      output_string oc magic;
      output_value oc !Location.input_name;
      output_value oc ast;
      close_out oc
    and fail () =
      close_in ic;
      failwith "Ast_mapper: OCaml version mismatch or malformed input";
    in

    if magic = Config.ast_impl_magic_number then
      rewrite (implem : structure -> structure)
    else if magic = Config.ast_intf_magic_number then
      rewrite (iface : signature -> signature)
    else fail ()

  let drop_ppx_context_str ~restore = function
    | {pstr_desc = Pstr_attribute
                     {attr_name = {Location.txt = "ocaml.ppx.context"; _};
                      attr_payload = a;
                      attr_loc = _}; _ }
      :: items ->
      if restore then
        PpxContext.restore (PpxContext.get_fields a);
      items
    | items -> items

  let drop_ppx_context_sig ~restore = function
    | {psig_desc = Psig_attribute
                     {attr_name = {Location.txt = "ocaml.ppx.context"; _};
                      attr_payload = a;
                      attr_loc = _}; _ }
      :: items ->
      if restore then
        PpxContext.restore (PpxContext.get_fields a);
      items
    | items -> items

  let add_ppx_context_str ~tool_name ast =
    Ast_helper.Str.attribute (ppx_context ~tool_name ()) :: ast

  let add_ppx_context_sig ~tool_name ast =
    Ast_helper.Sig.attribute (ppx_context ~tool_name ()) :: ast


  let apply ~source ~target mapper =
    apply_lazy ~source ~target (fun () -> mapper)

  let run_main mapper =
    try
      let a = Sys.argv in
      let n = Array.length a in
      if n > 2 then
        let mapper () =
          try mapper (Array.to_list (Array.sub a 1 (n - 3)))
          with exn ->
            (* PR#6463 *)
            let f _ _ = raise exn in
            {default_mapper with structure = f; signature = f}
        in
        apply_lazy ~source:a.(n - 2) ~target:a.(n - 1) mapper
      else begin
        Printf.eprintf "Usage: %s [extra_args] <infile> <outfile>\n%!"
          Sys.executable_name;
        exit 2
      end
    with exn ->
      prerr_endline (Printexc.to_string exn);
      exit 2

  let register_function = ref (fun _name f -> run_main f)
  let register name f = !register_function name f
end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
     [Toploop.print_out_value]
     [Toploop.print_out_type]
     [Toploop.print_out_sig_item]
     [Toploop.print_out_phrase] *)

  (** An [out_name] is a string representation of an identifier which can be
      rewritten on the fly to avoid name collisions *)
  type out_name (*IF_CURRENT = Outcometree.out_name *) = { mutable printed_name: string }

  type out_ident (*IF_CURRENT = Outcometree.out_ident *) =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of out_name

  type out_string (*IF_CURRENT = Outcometree.out_string *) =
    | Ostr_string
    | Ostr_bytes

  type out_attribute (*IF_CURRENT = Outcometree.out_attribute *) =
    { oattr_name: string }

  type out_value (*IF_CURRENT = Outcometree.out_value *) =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string * int * out_string (* string, size-to-print, kind *)
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type (*IF_CURRENT = Outcometree.out_type *) =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of out_ident * string list * out_type list
    | Otyp_attribute of out_type * out_attribute

  and out_variant (*IF_CURRENT = Outcometree.out_variant *) =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_typ of out_type

  type out_class_type (*IF_CURRENT = Outcometree.out_class_type *) =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item (*IF_CURRENT = Outcometree.out_class_sig_item *) =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type (*IF_CURRENT = Outcometree.out_module_type *) =
    | Omty_abstract
    | Omty_functor of string * out_module_type option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item (*IF_CURRENT = Outcometree.out_sig_item *) =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
        out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
        out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of out_val_decl
    | Osig_ellipsis
  and out_type_decl (*IF_CURRENT = Outcometree.out_type_decl *) =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_immediate: bool;
      otype_unboxed: bool;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor (*IF_CURRENT = Outcometree.out_extension_constructor *) =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension (*IF_CURRENT = Outcometree.out_type_extension *) =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_val_decl (*IF_CURRENT = Outcometree.out_val_decl *) =
    { oval_name: string;
      oval_type: out_type;
      oval_prims: string list;
      oval_attributes: out_attribute list }
  and out_rec_status (*IF_CURRENT = Outcometree.out_rec_status *) =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status (*IF_CURRENT = Outcometree.out_ext_status *) =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase (*IF_CURRENT = Outcometree.out_phrase *) =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)
end

module Config = struct
  let ast_impl_magic_number = "Caml1999M026"
  let ast_intf_magic_number = "Caml1999N026"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
    binding_op              = id;
    module_substitution     = id;
    open_declaration        = id;
    type_exception          = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
    binding_op              = fail;
    module_substitution     = fail;
    open_declaration        = fail;
    type_exception          = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Ast_410
= struct
#1 "ast_410.ml"
# 1 "src/ast_410.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                         Frédéric Bour, Facebook                        *)
(*            Jérémie Dimino and Leo White, Jane Street Europe            *)
(*            Xavier Leroy, projet Cristal, INRIA Rocquencourt            *)
(*                         Alain Frisch, LexiFi                           *)
(*       Daniel de Rauglaudre, projet Cristal, INRIA Rocquencourt         *)
(*                                                                        *)
(*   Copyright 2018 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

open Stdlib0
open Ast_409_helper

module Location = Location
module Longident = Longident

[@@@warning "-9"]

module Asttypes = struct
  type constant (*IF_CURRENT = Asttypes.constant *) =
      Const_int of int
    | Const_char of char
    | Const_string of string * string option
    | Const_float of string
    | Const_int32 of int32
    | Const_int64 of int64
    | Const_nativeint of nativeint

  type rec_flag (*IF_CURRENT = Asttypes.rec_flag *) = Nonrecursive | Recursive

  type direction_flag (*IF_CURRENT = Asttypes.direction_flag *) = Upto | Downto

  (* Order matters, used in polymorphic comparison *)
  type private_flag (*IF_CURRENT = Asttypes.private_flag *) = Private | Public

  type mutable_flag (*IF_CURRENT = Asttypes.mutable_flag *) = Immutable | Mutable

  type virtual_flag (*IF_CURRENT = Asttypes.virtual_flag *) = Virtual | Concrete

  type override_flag (*IF_CURRENT = Asttypes.override_flag *) = Override | Fresh

  type closed_flag (*IF_CURRENT = Asttypes.closed_flag *) = Closed | Open

  type label = string

  type arg_label (*IF_CURRENT = Asttypes.arg_label *) =
      Nolabel
    | Labelled of string (*  label:T -> ... *)
    | Optional of string (* ?label:T -> ... *)

  type 'a loc = 'a Location.loc = {
    txt : 'a;
    loc : Location.t;
  }


  type variance (*IF_CURRENT = Asttypes.variance *) =
    | Covariant
    | Contravariant
    | Invariant
end

module Parsetree = struct

  open Asttypes

  type constant (*IF_CURRENT = Parsetree.constant *) =
      Pconst_integer of string * char option
    (* 3 3l 3L 3n

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes except 'l', 'L' and 'n' are rejected by the typechecker
    *)
    | Pconst_char of char
    (* 'c' *)
    | Pconst_string of string * string option
    (* "constant"
       {delim|other constant|delim}
    *)
    | Pconst_float of string * char option
    (* 3.4 2e5 1.4e-4

       Suffixes [g-z][G-Z] are accepted by the parser.
       Suffixes are rejected by the typechecker.
    *)

  type location_stack = Location.t list

  (** {1 Extension points} *)

  type attribute (*IF_CURRENT = Parsetree.attribute *) = {
    attr_name : string loc;
    attr_payload : payload;
    attr_loc : Location.t;
  }
  (* [@id ARG]
     [@@id ARG]

     Metadata containers passed around within the AST.
     The compiler ignores unknown attributes.
  *)

  and extension = string loc * payload
  (* [%id ARG]
     [%%id ARG]

     Sub-language placeholder -- rejected by the typechecker.
  *)

  and attributes = attribute list

  and payload (*IF_CURRENT = Parsetree.payload *) =
    | PStr of structure
    | PSig of signature (* : SIG *)
    | PTyp of core_type  (* : T *)
    | PPat of pattern * expression option  (* ? P  or  ? P when E *)

  (** {1 Core language} *)

  (* Type expressions *)

  and core_type (*IF_CURRENT = Parsetree.core_type *) =
    {
      ptyp_desc: core_type_desc;
      ptyp_loc: Location.t;
      ptyp_loc_stack: location_stack;
      ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and core_type_desc (*IF_CURRENT = Parsetree.core_type_desc *) =
    | Ptyp_any
    (*  _ *)
    | Ptyp_var of string
    (* 'a *)
    | Ptyp_arrow of arg_label * core_type * core_type
    (* T1 -> T2       Simple
       ~l:T1 -> T2    Labelled
       ?l:T1 -> T2    Optional
    *)
    | Ptyp_tuple of core_type list
    (* T1 * ... * Tn

       Invariant: n >= 2
    *)
    | Ptyp_constr of Longident.t loc * core_type list
    (* tconstr
       T tconstr
       (T1, ..., Tn) tconstr
    *)
    | Ptyp_object of object_field list * closed_flag
    (* < l1:T1; ...; ln:Tn >     (flag = Closed)
       < l1:T1; ...; ln:Tn; .. > (flag = Open)
    *)
    | Ptyp_class of Longident.t loc * core_type list
    (* #tconstr
       T #tconstr
       (T1, ..., Tn) #tconstr
    *)
    | Ptyp_alias of core_type * string
    (* T as 'a *)
    | Ptyp_variant of row_field list * closed_flag * label list option
    (* [ `A|`B ]         (flag = Closed; labels = None)
       [> `A|`B ]        (flag = Open;   labels = None)
       [< `A|`B ]        (flag = Closed; labels = Some [])
       [< `A|`B > `X `Y ](flag = Closed; labels = Some ["X";"Y"])
    *)
    | Ptyp_poly of string loc list * core_type
    (* 'a1 ... 'an. T

       Can only appear in the following context:

       - As the core_type of a Ppat_constraint node corresponding
         to a constraint on a let-binding: let x : 'a1 ... 'an. T
         = e ...

       - Under Cfk_virtual for methods (not values).

       - As the core_type of a Pctf_method node.

       - As the core_type of a Pexp_poly node.

       - As the pld_type field of a label_declaration.

       - As a core_type of a Ptyp_object node.
    *)

    | Ptyp_package of package_type
    (* (module S) *)
    | Ptyp_extension of extension
    (* [%id] *)

  and package_type = Longident.t loc * (Longident.t loc * core_type) list
      (*
        (module S)
        (module S with type t1 = T1 and ... and tn = Tn)
       *)

  and row_field (*IF_CURRENT = Parsetree.row_field *) = {
    prf_desc : row_field_desc;
    prf_loc : Location.t;
    prf_attributes : attributes;
  }

  and row_field_desc (*IF_CURRENT = Parsetree.row_field_desc *) =
    | Rtag of label loc * bool * core_type list
    (* [`A]                   ( true,  [] )
       [`A of T]              ( false, [T] )
       [`A of T1 & .. & Tn]   ( false, [T1;...Tn] )
       [`A of & T1 & .. & Tn] ( true,  [T1;...Tn] )

       - The 'bool' field is true if the tag contains a
         constant (empty) constructor.
       - '&' occurs when several types are used for the same constructor
         (see 4.2 in the manual)
    *)
    | Rinherit of core_type
    (* [ T ] *)

  and object_field (*IF_CURRENT = Parsetree.object_field *) = {
    pof_desc : object_field_desc;
    pof_loc : Location.t;
    pof_attributes : attributes;
  }

  and object_field_desc (*IF_CURRENT = Parsetree.object_field_desc *) =
    | Otag of label loc * core_type
    | Oinherit of core_type

  (* Patterns *)

  and pattern (*IF_CURRENT = Parsetree.pattern *) =
    {
      ppat_desc: pattern_desc;
      ppat_loc: Location.t;
      ppat_loc_stack: location_stack;
      ppat_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and pattern_desc (*IF_CURRENT = Parsetree.pattern_desc *) =
    | Ppat_any
    (* _ *)
    | Ppat_var of string loc
    (* x *)
    | Ppat_alias of pattern * string loc
    (* P as 'a *)
    | Ppat_constant of constant
    (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Ppat_interval of constant * constant
    (* 'a'..'z'

       Other forms of interval are recognized by the parser
       but rejected by the type-checker. *)
    | Ppat_tuple of pattern list
    (* (P1, ..., Pn)

       Invariant: n >= 2
    *)
    | Ppat_construct of Longident.t loc * pattern option
    (* C                None
       C P              Some P
       C (P1, ..., Pn)  Some (Ppat_tuple [P1; ...; Pn])
    *)
    | Ppat_variant of label * pattern option
    (* `A             (None)
       `A P           (Some P)
    *)
    | Ppat_record of (Longident.t loc * pattern) list * closed_flag
    (* { l1=P1; ...; ln=Pn }     (flag = Closed)
       { l1=P1; ...; ln=Pn; _}   (flag = Open)

       Invariant: n > 0
    *)
    | Ppat_array of pattern list
    (* [| P1; ...; Pn |] *)
    | Ppat_or of pattern * pattern
    (* P1 | P2 *)
    | Ppat_constraint of pattern * core_type
    (* (P : T) *)
    | Ppat_type of Longident.t loc
    (* #tconst *)
    | Ppat_lazy of pattern
    (* lazy P *)
    | Ppat_unpack of string option loc
    (* (module P)        Some "P"
       (module _)        None

       Note: (module P : S) is represented as
       Ppat_constraint(Ppat_unpack, Ptyp_package)
    *)
    | Ppat_exception of pattern
    (* exception P *)
    | Ppat_extension of extension
    (* [%id] *)
    | Ppat_open of Longident.t loc * pattern
    (* M.(P) *)

  (* Value expressions *)

  and expression (*IF_CURRENT = Parsetree.expression *) =
    {
      pexp_desc: expression_desc;
      pexp_loc: Location.t;
      pexp_loc_stack: location_stack;
      pexp_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and expression_desc (*IF_CURRENT = Parsetree.expression_desc *) =
    | Pexp_ident of Longident.t loc
    (* x
       M.x
    *)
    | Pexp_constant of constant
    (* 1, 'a', "true", 1.0, 1l, 1L, 1n *)
    | Pexp_let of rec_flag * value_binding list * expression
    (* let P1 = E1 and ... and Pn = EN in E       (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN in E   (flag = Recursive)
    *)
    | Pexp_function of case list
    (* function P1 -> E1 | ... | Pn -> En *)
    | Pexp_fun of arg_label * expression option * pattern * expression
    (* fun P -> E1                          (Simple, None)
       fun ~l:P -> E1                       (Labelled l, None)
       fun ?l:P -> E1                       (Optional l, None)
       fun ?l:(P = E0) -> E1                (Optional l, Some E0)

       Notes:
       - If E0 is provided, only Optional is allowed.
       - "fun P1 P2 .. Pn -> E1" is represented as nested Pexp_fun.
       - "let f P = E" is represented using Pexp_fun.
    *)
    | Pexp_apply of expression * (arg_label * expression) list
    (* E0 ~l1:E1 ... ~ln:En
       li can be empty (non labeled argument) or start with '?'
       (optional argument).

       Invariant: n > 0
    *)
    | Pexp_match of expression * case list
    (* match E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_try of expression * case list
    (* try E0 with P1 -> E1 | ... | Pn -> En *)
    | Pexp_tuple of expression list
    (* (E1, ..., En)

       Invariant: n >= 2
    *)
    | Pexp_construct of Longident.t loc * expression option
    (* C                None
       C E              Some E
       C (E1, ..., En)  Some (Pexp_tuple[E1;...;En])
    *)
    | Pexp_variant of label * expression option
    (* `A             (None)
       `A E           (Some E)
    *)
    | Pexp_record of (Longident.t loc * expression) list * expression option
    (* { l1=P1; ...; ln=Pn }     (None)
       { E0 with l1=P1; ...; ln=Pn }   (Some E0)

       Invariant: n > 0
    *)
    | Pexp_field of expression * Longident.t loc
    (* E.l *)
    | Pexp_setfield of expression * Longident.t loc * expression
    (* E1.l <- E2 *)
    | Pexp_array of expression list
    (* [| E1; ...; En |] *)
    | Pexp_ifthenelse of expression * expression * expression option
    (* if E1 then E2 else E3 *)
    | Pexp_sequence of expression * expression
    (* E1; E2 *)
    | Pexp_while of expression * expression
    (* while E1 do E2 done *)
    | Pexp_for of
        pattern *  expression * expression * direction_flag * expression
    (* for i = E1 to E2 do E3 done      (flag = Upto)
       for i = E1 downto E2 do E3 done  (flag = Downto)
    *)
    | Pexp_constraint of expression * core_type
    (* (E : T) *)
    | Pexp_coerce of expression * core_type option * core_type
    (* (E :> T)        (None, T)
       (E : T0 :> T)   (Some T0, T)
    *)
    | Pexp_send of expression * label loc
    (*  E # m *)
    | Pexp_new of Longident.t loc
    (* new M.c *)
    | Pexp_setinstvar of label loc * expression
    (* x <- 2 *)
    | Pexp_override of (label loc * expression) list
    (* {< x1 = E1; ...; Xn = En >} *)
    | Pexp_letmodule of string option loc * module_expr * expression
    (* let module M = ME in E *)
    | Pexp_letexception of extension_constructor * expression
    (* let exception C in E *)
    | Pexp_assert of expression
    (* assert E
       Note: "assert false" is treated in a special way by the
       type-checker. *)
    | Pexp_lazy of expression
    (* lazy E *)
    | Pexp_poly of expression * core_type option
    (* Used for method bodies.

       Can only be used as the expression under Cfk_concrete
       for methods (not values). *)
    | Pexp_object of class_structure
    (* object ... end *)
    | Pexp_newtype of string loc * expression
    (* fun (type t) -> E *)
    | Pexp_pack of module_expr
    (* (module ME)

       (module ME : S) is represented as
       Pexp_constraint(Pexp_pack, Ptyp_package S) *)
    | Pexp_open of open_declaration * expression
    (* M.(E)
       let open M in E
       let! open M in E *)
    | Pexp_letop of letop
    (* let* P = E in E
       let* P = E and* P = E in E *)
    | Pexp_extension of extension
    (* [%id] *)
    | Pexp_unreachable
    (* . *)

  and case (*IF_CURRENT = Parsetree.case *) =   (* (P -> E) or (P when E0 -> E) *)
    {
      pc_lhs: pattern;
      pc_guard: expression option;
      pc_rhs: expression;
    }

  and letop (*IF_CURRENT = Parsetree.letop *) =
    {
      let_ : binding_op;
      ands : binding_op list;
      body : expression;
    }

  and binding_op (*IF_CURRENT = Parsetree.binding_op *) =
    {
      pbop_op : string loc;
      pbop_pat : pattern;
      pbop_exp : expression;
      pbop_loc : Location.t;
    }

  (* Value descriptions *)

  and value_description (*IF_CURRENT = Parsetree.value_description *) =
    {
      pval_name: string loc;
      pval_type: core_type;
      pval_prim: string list;
      pval_attributes: attributes;  (* ... [@@id1] [@@id2] *)
      pval_loc: Location.t;
    }

(*
  val x: T                            (prim = [])
  external x: T = "s1" ... "sn"       (prim = ["s1";..."sn"])
*)

  (* Type declarations *)

  and type_declaration (*IF_CURRENT = Parsetree.type_declaration *) =
    {
      ptype_name: string loc;
      ptype_params: (core_type * variance) list;
      (* ('a1,...'an) t; None represents  _*)
      ptype_cstrs: (core_type * core_type * Location.t) list;
      (* ... constraint T1=T1'  ... constraint Tn=Tn' *)
      ptype_kind: type_kind;
      ptype_private: private_flag;   (* = private ... *)
      ptype_manifest: core_type option;  (* = T *)
      ptype_attributes: attributes;   (* ... [@@id1] [@@id2] *)
      ptype_loc: Location.t;
    }

(*
  type t                     (abstract, no manifest)
  type t = T0                (abstract, manifest=T0)
  type t = C of T | ...      (variant,  no manifest)
  type t = T0 = C of T | ... (variant,  manifest=T0)
  type t = {l: T; ...}       (record,   no manifest)
  type t = T0 = {l : T; ...} (record,   manifest=T0)
  type t = ..                (open,     no manifest)
*)

  and type_kind (*IF_CURRENT = Parsetree.type_kind *) =
    | Ptype_abstract
    | Ptype_variant of constructor_declaration list
    | Ptype_record of label_declaration list
    (* Invariant: non-empty list *)
    | Ptype_open

  and label_declaration (*IF_CURRENT = Parsetree.label_declaration *) =
    {
      pld_name: string loc;
      pld_mutable: mutable_flag;
      pld_type: core_type;
      pld_loc: Location.t;
      pld_attributes: attributes; (* l : T [@id1] [@id2] *)
    }

  (*  { ...; l: T; ... }            (mutable=Immutable)
      { ...; mutable l: T; ... }    (mutable=Mutable)

      Note: T can be a Ptyp_poly.
  *)

  and constructor_declaration (*IF_CURRENT = Parsetree.constructor_declaration *) =
    {
      pcd_name: string loc;
      pcd_args: constructor_arguments;
      pcd_res: core_type option;
      pcd_loc: Location.t;
      pcd_attributes: attributes; (* C of ... [@id1] [@id2] *)
    }

  and constructor_arguments (*IF_CURRENT = Parsetree.constructor_arguments *) =
    | Pcstr_tuple of core_type list
    | Pcstr_record of label_declaration list

(*
  | C of T1 * ... * Tn     (res = None,    args = Pcstr_tuple [])
  | C: T0                  (res = Some T0, args = [])
  | C: T1 * ... * Tn -> T0 (res = Some T0, args = Pcstr_tuple)
  | C of {...}             (res = None,    args = Pcstr_record)
  | C: {...} -> T0         (res = Some T0, args = Pcstr_record)
  | C of {...} as t        (res = None,    args = Pcstr_record)
*)

  and type_extension (*IF_CURRENT = Parsetree.type_extension *) =
    {
      ptyext_path: Longident.t loc;
      ptyext_params: (core_type * variance) list;
      ptyext_constructors: extension_constructor list;
      ptyext_private: private_flag;
      ptyext_loc: Location.t;
      ptyext_attributes: attributes;   (* ... [@@id1] [@@id2] *)
    }
(*
  type t += ...
*)

  and extension_constructor (*IF_CURRENT = Parsetree.extension_constructor *) =
    {
      pext_name: string loc;
      pext_kind : extension_constructor_kind;
      pext_loc : Location.t;
      pext_attributes: attributes; (* C of ... [@id1] [@id2] *)
    }

  (* exception E *)
  and type_exception (*IF_CURRENT = Parsetree.type_exception *) =
    {
      ptyexn_constructor: extension_constructor;
      ptyexn_loc: Location.t;
      ptyexn_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and extension_constructor_kind (*IF_CURRENT = Parsetree.extension_constructor_kind *) =
      Pext_decl of constructor_arguments * core_type option
      (*
         | C of T1 * ... * Tn     ([T1; ...; Tn], None)
         | C: T0                  ([], Some T0)
         | C: T1 * ... * Tn -> T0 ([T1; ...; Tn], Some T0)
       *)
    | Pext_rebind of Longident.t loc
      (*
         | C = D
       *)

  (** {1 Class language} *)

  (* Type expressions for the class language *)

  and class_type (*IF_CURRENT = Parsetree.class_type *) =
    {
      pcty_desc: class_type_desc;
      pcty_loc: Location.t;
      pcty_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and class_type_desc (*IF_CURRENT = Parsetree.class_type_desc *) =
    | Pcty_constr of Longident.t loc * core_type list
    (* c
       ['a1, ..., 'an] c *)
    | Pcty_signature of class_signature
    (* object ... end *)
    | Pcty_arrow of arg_label * core_type * class_type
    (* T -> CT       Simple
       ~l:T -> CT    Labelled l
       ?l:T -> CT    Optional l
    *)
    | Pcty_extension of extension
    (* [%id] *)
    | Pcty_open of open_description * class_type
    (* let open M in CT *)

  and class_signature (*IF_CURRENT = Parsetree.class_signature *) =
    {
      pcsig_self: core_type;
      pcsig_fields: class_type_field list;
    }
  (* object('selfpat) ... end
     object ... end             (self = Ptyp_any)
  *)

  and class_type_field (*IF_CURRENT = Parsetree.class_type_field *) =
    {
      pctf_desc: class_type_field_desc;
      pctf_loc: Location.t;
      pctf_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and class_type_field_desc (*IF_CURRENT = Parsetree.class_type_field_desc *) =
    | Pctf_inherit of class_type
    (* inherit CT *)
    | Pctf_val of (label loc * mutable_flag * virtual_flag * core_type)
    (* val x: T *)
    | Pctf_method  of (label loc * private_flag * virtual_flag * core_type)
    (* method x: T

       Note: T can be a Ptyp_poly.
    *)
    | Pctf_constraint  of (core_type * core_type)
    (* constraint T1 = T2 *)
    | Pctf_attribute of attribute
    (* [@@@id] *)
    | Pctf_extension of extension
    (* [%%id] *)

  and 'a class_infos (*IF_CURRENT = 'a Parsetree.class_infos *) =
    {
      pci_virt: virtual_flag;
      pci_params: (core_type * variance) list;
      pci_name: string loc;
      pci_expr: 'a;
      pci_loc: Location.t;
      pci_attributes: attributes;  (* ... [@@id1] [@@id2] *)
    }
  (* class c = ...
     class ['a1,...,'an] c = ...
     class virtual c = ...

     Also used for "class type" declaration.
  *)

  and class_description = class_type class_infos

  and class_type_declaration = class_type class_infos

  (* Value expressions for the class language *)

  and class_expr (*IF_CURRENT = Parsetree.class_expr *) =
    {
      pcl_desc: class_expr_desc;
      pcl_loc: Location.t;
      pcl_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and class_expr_desc (*IF_CURRENT = Parsetree.class_expr_desc *) =
    | Pcl_constr of Longident.t loc * core_type list
    (* c
       ['a1, ..., 'an] c *)
    | Pcl_structure of class_structure
    (* object ... end *)
    | Pcl_fun of arg_label * expression option * pattern * class_expr
    (* fun P -> CE                          (Simple, None)
       fun ~l:P -> CE                       (Labelled l, None)
       fun ?l:P -> CE                       (Optional l, None)
       fun ?l:(P = E0) -> CE                (Optional l, Some E0)
    *)
    | Pcl_apply of class_expr * (arg_label * expression) list
    (* CE ~l1:E1 ... ~ln:En
       li can be empty (non labeled argument) or start with '?'
       (optional argument).

       Invariant: n > 0
    *)
    | Pcl_let of rec_flag * value_binding list * class_expr
    (* let P1 = E1 and ... and Pn = EN in CE      (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN in CE  (flag = Recursive)
    *)
    | Pcl_constraint of class_expr * class_type
    (* (CE : CT) *)
    | Pcl_extension of extension
    (* [%id] *)
    | Pcl_open of open_description * class_expr
    (* let open M in CE *)


  and class_structure (*IF_CURRENT = Parsetree.class_structure *) =
    {
      pcstr_self: pattern;
      pcstr_fields: class_field list;
    }
  (* object(selfpat) ... end
     object ... end           (self = Ppat_any)
  *)

  and class_field (*IF_CURRENT = Parsetree.class_field *) =
    {
      pcf_desc: class_field_desc;
      pcf_loc: Location.t;
      pcf_attributes: attributes; (* ... [@@id1] [@@id2] *)
    }

  and class_field_desc (*IF_CURRENT = Parsetree.class_field_desc *) =
    | Pcf_inherit of override_flag * class_expr * string loc option
    (* inherit CE
       inherit CE as x
       inherit! CE
       inherit! CE as x
    *)
    | Pcf_val of (label loc * mutable_flag * class_field_kind)
    (* val x = E
       val virtual x: T
    *)
    | Pcf_method of (label loc * private_flag * class_field_kind)
    (* method x = E            (E can be a Pexp_poly)
       method virtual x: T     (T can be a Ptyp_poly)
    *)
    | Pcf_constraint of (core_type * core_type)
    (* constraint T1 = T2 *)
    | Pcf_initializer of expression
    (* initializer E *)
    | Pcf_attribute of attribute
    (* [@@@id] *)
    | Pcf_extension of extension
    (* [%%id] *)

  and class_field_kind (*IF_CURRENT = Parsetree.class_field_kind *) =
    | Cfk_virtual of core_type
    | Cfk_concrete of override_flag * expression

  and class_declaration = class_expr class_infos

  (** {1 Module language} *)

  (* Type expressions for the module language *)

  and module_type (*IF_CURRENT = Parsetree.module_type *) =
    {
      pmty_desc: module_type_desc;
      pmty_loc: Location.t;
      pmty_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and module_type_desc (*IF_CURRENT = Parsetree.module_type_desc *) =
    | Pmty_ident of Longident.t loc
    (* S *)
    | Pmty_signature of signature
    (* sig ... end *)
    | Pmty_functor of functor_parameter * module_type
    (* functor(X : MT1) -> MT2 *)
    | Pmty_with of module_type * with_constraint list
    (* MT with ... *)
    | Pmty_typeof of module_expr
    (* module type of ME *)
    | Pmty_extension of extension
    (* [%id] *)
    | Pmty_alias of Longident.t loc
    (* (module M) *)

  and functor_parameter (*IF_CURRENT = Parsetree.functor_parameter *) =
    | Unit
    (* () *)
    | Named of string option loc * module_type
    (* (X : MT)          Some X, MT
       (_ : MT)          None, MT *)

  and signature = signature_item list

  and signature_item (*IF_CURRENT = Parsetree.signature_item *) =
    {
      psig_desc: signature_item_desc;
      psig_loc: Location.t;
    }

  and signature_item_desc (*IF_CURRENT = Parsetree.signature_item_desc *) =
    | Psig_value of value_description
        (*
          val x: T
          external x: T = "s1" ... "sn"
         *)
    | Psig_type of rec_flag * type_declaration list
    (* type t1 = ... and ... and tn  = ... *)
    | Psig_typesubst of type_declaration list
    (* type t1 := ... and ... and tn := ...  *)
    | Psig_typext of type_extension
    (* type t1 += ... *)
    | Psig_exception of type_exception
    (* exception C of T *)
    | Psig_module of module_declaration
    (* module X = M
       module X : MT *)
    | Psig_modsubst of module_substitution
    (* module X := M *)
    | Psig_recmodule of module_declaration list
    (* module rec X1 : MT1 and ... and Xn : MTn *)
    | Psig_modtype of module_type_declaration
    (* module type S = MT
       module type S *)
    | Psig_open of open_description
    (* open X *)
    | Psig_include of include_description
    (* include MT *)
    | Psig_class of class_description list
    (* class c1 : ... and ... and cn : ... *)
    | Psig_class_type of class_type_declaration list
    (* class type ct1 = ... and ... and ctn = ... *)
    | Psig_attribute of attribute
    (* [@@@id] *)
    | Psig_extension of extension * attributes
    (* [%%id] *)

  and module_declaration (*IF_CURRENT = Parsetree.module_declaration *) =
    {
      pmd_name: string option loc;
      pmd_type: module_type;
      pmd_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pmd_loc: Location.t;
    }
  (* S : MT *)

  and module_substitution (*IF_CURRENT = Parsetree.module_substitution *) =
    {
      pms_name: string loc;
      pms_manifest: Longident.t loc;
      pms_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pms_loc: Location.t;
    }

  and module_type_declaration (*IF_CURRENT = Parsetree.module_type_declaration *) =
    {
      pmtd_name: string loc;
      pmtd_type: module_type option;
      pmtd_attributes: attributes; (* ... [@@id1] [@@id2] *)
      pmtd_loc: Location.t;
    }
  (* S = MT
     S       (abstract module type declaration, pmtd_type = None)
  *)

  and 'a open_infos (*IF_CURRENT = 'a Parsetree.open_infos *) =
    {
      popen_expr: 'a;
      popen_override: override_flag;
      popen_loc: Location.t;
      popen_attributes: attributes;
    }
  (* open! X - popen_override = Override (silences the 'used identifier
                                shadowing' warning)
     open  X - popen_override = Fresh
  *)

  and open_description = Longident.t loc open_infos
  (* open M.N
     open M(N).O *)

  and open_declaration = module_expr open_infos
  (* open M.N
     open M(N).O
     open struct ... end *)

  and 'a include_infos (*IF_CURRENT = 'a Parsetree.include_infos *) =
    {
      pincl_mod: 'a;
      pincl_loc: Location.t;
      pincl_attributes: attributes;
    }

  and include_description = module_type include_infos
  (* include MT *)

  and include_declaration = module_expr include_infos
  (* include ME *)

  and with_constraint (*IF_CURRENT = Parsetree.with_constraint *) =
    | Pwith_type of Longident.t loc * type_declaration
    (* with type X.t = ...

       Note: the last component of the longident must match
       the name of the type_declaration. *)
    | Pwith_module of Longident.t loc * Longident.t loc
    (* with module X.Y = Z *)
    | Pwith_typesubst of Longident.t loc * type_declaration
    (* with type X.t := ..., same format as [Pwith_type] *)
    | Pwith_modsubst of Longident.t loc * Longident.t loc
    (* with module X.Y := Z *)

  (* Value expressions for the module language *)

  and module_expr (*IF_CURRENT = Parsetree.module_expr *) =
    {
      pmod_desc: module_expr_desc;
      pmod_loc: Location.t;
      pmod_attributes: attributes; (* ... [@id1] [@id2] *)
    }

  and module_expr_desc (*IF_CURRENT = Parsetree.module_expr_desc *) =
    | Pmod_ident of Longident.t loc
    (* X *)
    | Pmod_structure of structure
    (* struct ... end *)
    | Pmod_functor of functor_parameter * module_expr
    (* functor(X : MT1) -> ME *)
    | Pmod_apply of module_expr * module_expr
    (* ME1(ME2) *)
    | Pmod_constraint of module_expr * module_type
    (* (ME : MT) *)
    | Pmod_unpack of expression
    (* (val E) *)
    | Pmod_extension of extension
    (* [%id] *)

  and structure = structure_item list

  and structure_item (*IF_CURRENT = Parsetree.structure_item *) =
    {
      pstr_desc: structure_item_desc;
      pstr_loc: Location.t;
    }

  and structure_item_desc (*IF_CURRENT = Parsetree.structure_item_desc *) =
    | Pstr_eval of expression * attributes
    (* E *)
    | Pstr_value of rec_flag * value_binding list
    (* let P1 = E1 and ... and Pn = EN       (flag = Nonrecursive)
       let rec P1 = E1 and ... and Pn = EN   (flag = Recursive)
    *)
    | Pstr_primitive of value_description
    (*  val x: T
        external x: T = "s1" ... "sn" *)
    | Pstr_type of rec_flag * type_declaration list
    (* type t1 = ... and ... and tn = ... *)
    | Pstr_typext of type_extension
    (* type t1 += ... *)
    | Pstr_exception of type_exception
    (* exception C of T
       exception C = M.X *)
    | Pstr_module of module_binding
    (* module X = ME *)
    | Pstr_recmodule of module_binding list
    (* module rec X1 = ME1 and ... and Xn = MEn *)
    | Pstr_modtype of module_type_declaration
    (* module type S = MT *)
    | Pstr_open of open_declaration
    (* open X *)
    | Pstr_class of class_declaration list
    (* class c1 = ... and ... and cn = ... *)
    | Pstr_class_type of class_type_declaration list
    (* class type ct1 = ... and ... and ctn = ... *)
    | Pstr_include of include_declaration
    (* include ME *)
    | Pstr_attribute of attribute
    (* [@@@id] *)
    | Pstr_extension of extension * attributes
    (* [%%id] *)

  and value_binding (*IF_CURRENT = Parsetree.value_binding *) =
    {
      pvb_pat: pattern;
      pvb_expr: expression;
      pvb_attributes: attributes;
      pvb_loc: Location.t;
    }

  and module_binding (*IF_CURRENT = Parsetree.module_binding *) =
    {
      pmb_name: string option loc;
      pmb_expr: module_expr;
      pmb_attributes: attributes;
      pmb_loc: Location.t;
    }
  (* X = ME *)

  (** {1 Toplevel} *)

  (* Toplevel phrases *)

  type toplevel_phrase (*IF_CURRENT = Parsetree.toplevel_phrase *) =
    | Ptop_def of structure
    | Ptop_dir of toplevel_directive
    (* #use, #load ... *)

  and toplevel_directive (*IF_CURRENT = Parsetree.toplevel_directive *) =
    {
      pdir_name : string loc;
      pdir_arg : directive_argument option;
      pdir_loc : Location.t;
    }

  and directive_argument (*IF_CURRENT = Parsetree.directive_argument *) =
    {
      pdira_desc : directive_argument_desc;
      pdira_loc : Location.t;
    }

  and directive_argument_desc (*IF_CURRENT = Parsetree.directive_argument_desc *) =
    | Pdir_string of string
    | Pdir_int of string * char option
    | Pdir_ident of Longident.t
    | Pdir_bool of bool

end

module Docstrings : sig
  (** (Re)Initialise all docstring state *)
  val init : unit -> unit

  (** Emit warnings for unattached and ambiguous docstrings *)
  val warn_bad_docstrings : unit -> unit

  (** {2 Docstrings} *)

  (** Documentation comments *)
  type docstring

  (** Create a docstring *)
  val docstring : string -> Location.t -> docstring

  (** Register a docstring *)
  val register : docstring -> unit

  (** Get the text of a docstring *)
  val docstring_body : docstring -> string

  (** Get the location of a docstring *)
  val docstring_loc : docstring -> Location.t

  (** {2 Set functions}

      These functions are used by the lexer to associate docstrings to
      the locations of tokens. *)

  (** Docstrings immediately preceding a token *)
  val set_pre_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately following a token *)
  val set_post_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings not immediately adjacent to a token *)
  val set_floating_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately following the token which precedes this one *)
  val set_pre_extra_docstrings : Lexing.position -> docstring list -> unit

  (** Docstrings immediately preceding the token which follows this one *)
  val set_post_extra_docstrings : Lexing.position -> docstring list -> unit

  (** {2 Items}

      The {!docs} type represents documentation attached to an item. *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  val empty_docs : docs

  val docs_attr : docstring -> Parsetree.attribute

  (** Convert item documentation to attributes and add them to an
      attribute list *)
  val add_docs_attrs : docs -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the item documentation for the current symbol. This also
      marks this documentation (for ambiguity warnings). *)
  val symbol_docs : unit -> docs
  val symbol_docs_lazy : unit -> docs Lazy.t

  (** Fetch the item documentation for the symbols between two
      positions. This also marks this documentation (for ambiguity
      warnings). *)
  val rhs_docs : int -> int -> docs
  val rhs_docs_lazy : int -> int -> docs Lazy.t

  (** Mark the item documentation for the current symbol (for ambiguity
      warnings). *)
  val mark_symbol_docs : unit -> unit

  (** Mark as associated the item documentation for the symbols between
      two positions (for ambiguity warnings) *)
  val mark_rhs_docs : int -> int -> unit

  (** {2 Fields and constructors}

      The {!info} type represents documentation attached to a field or
      constructor. *)

  type info = docstring option

  val empty_info : info

  val info_attr : docstring -> Parsetree.attribute

  (** Convert field info to attributes and add them to an
      attribute list *)
  val add_info_attrs : info -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the field info for the current symbol. *)
  val symbol_info : unit -> info

  (** Fetch the field info following the symbol at a given position. *)
  val rhs_info : int -> info

  (** {2 Unattached comments}

      The {!text} type represents documentation which is not attached to
      anything. *)

  type text = docstring list

  val empty_text : text
  val empty_text_lazy : text Lazy.t

  val text_attr : docstring -> Parsetree.attribute

  (** Convert text to attributes and add them to an attribute list *)
  val add_text_attrs : text -> Parsetree.attributes -> Parsetree.attributes

  (** Fetch the text preceding the current symbol. *)
  val symbol_text : unit -> text
  val symbol_text_lazy : unit -> text Lazy.t

  (** Fetch the text preceding the symbol at the given position. *)
  val rhs_text : int -> text
  val rhs_text_lazy : int -> text Lazy.t

  (** {2 Extra text}

      There may be additional text attached to the delimiters of a block
      (e.g. [struct] and [end]). This is fetched by the following
      functions, which are applied to the contents of the block rather
      than the delimiters. *)

  (** Fetch additional text preceding the current symbol *)
  val symbol_pre_extra_text : unit -> text

  (** Fetch additional text following the current symbol *)
  val symbol_post_extra_text : unit -> text

  (** Fetch additional text preceding the symbol at the given position *)
  val rhs_pre_extra_text : int -> text

  (** Fetch additional text following the symbol at the given position *)
  val rhs_post_extra_text : int -> text

  (** Fetch text following the symbol at the given position *)
  val rhs_post_text : int -> text

  module WithMenhir: sig
    (** Fetch the item documentation for the current symbol. This also
        marks this documentation (for ambiguity warnings). *)
    val symbol_docs : Lexing.position * Lexing.position -> docs
    val symbol_docs_lazy : Lexing.position * Lexing.position -> docs Lazy.t

    (** Fetch the item documentation for the symbols between two
        positions. This also marks this documentation (for ambiguity
        warnings). *)
    val rhs_docs : Lexing.position -> Lexing.position -> docs
    val rhs_docs_lazy : Lexing.position -> Lexing.position -> docs Lazy.t

    (** Mark the item documentation for the current symbol (for ambiguity
        warnings). *)
    val mark_symbol_docs : Lexing.position * Lexing.position -> unit

    (** Mark as associated the item documentation for the symbols between
        two positions (for ambiguity warnings) *)
    val mark_rhs_docs : Lexing.position -> Lexing.position -> unit

    (** Fetch the field info for the current symbol. *)
    val symbol_info : Lexing.position -> info

    (** Fetch the field info following the symbol at a given position. *)
    val rhs_info : Lexing.position -> info

    (** Fetch the text preceding the current symbol. *)
    val symbol_text : Lexing.position -> text
    val symbol_text_lazy : Lexing.position -> text Lazy.t

    (** Fetch the text preceding the symbol at the given position. *)
    val rhs_text : Lexing.position -> text
    val rhs_text_lazy : Lexing.position -> text Lazy.t

    (** {3 Extra text}

        There may be additional text attached to the delimiters of a block
        (e.g. [struct] and [end]). This is fetched by the following
        functions, which are applied to the contents of the block rather
        than the delimiters. *)

    (** Fetch additional text preceding the current symbol *)
    val symbol_pre_extra_text : Lexing.position -> text

    (** Fetch additional text following the current symbol *)
    val symbol_post_extra_text : Lexing.position -> text

    (** Fetch additional text preceding the symbol at the given position *)
    val rhs_pre_extra_text : Lexing.position -> text

    (** Fetch additional text following the symbol at the given position *)
    val rhs_post_extra_text : Lexing.position -> text

    (** Fetch text following the symbol at the given position *)
    val rhs_post_text : Lexing.position -> text

  end
end = struct
  open Location

  (* Docstrings *)

  (* A docstring is "attached" if it has been inserted in the AST. This
     is used for generating unexpected docstring warnings. *)
  type ds_attached =
    | Unattached   (* Not yet attached anything.*)
    | Info         (* Attached to a field or constructor. *)
    | Docs         (* Attached to an item or as floating text. *)

  (* A docstring is "associated" with an item if there are no blank lines between
     them. This is used for generating docstring ambiguity warnings. *)
  type ds_associated =
    | Zero             (* Not associated with an item *)
    | One              (* Associated with one item *)
    | Many             (* Associated with multiple items (ambiguity) *)

  type docstring =
    { ds_body: string;
      ds_loc: Location.t;
      mutable ds_attached: ds_attached;
      mutable ds_associated: ds_associated; }

  (* List of docstrings *)

  let docstrings : docstring list ref = ref []

  (* Warn for unused and ambiguous docstrings *)

  let warn_bad_docstrings () =
    if Warnings.is_active (Warnings.Bad_docstring true) then begin
      List.iter
        (fun ds ->
           match ds.ds_attached with
           | Info -> ()
           | Unattached ->
               prerr_warning ds.ds_loc (Warnings.Bad_docstring true)
           | Docs ->
               match ds.ds_associated with
               | Zero | One -> ()
               | Many ->
                   prerr_warning ds.ds_loc (Warnings.Bad_docstring false))
        (List.rev !docstrings)
    end

  (* Docstring constructors and destructors *)

  let docstring body loc =
    let ds =
      { ds_body = body;
        ds_loc = loc;
        ds_attached = Unattached;
        ds_associated = Zero; }
    in
    ds

  let register ds =
    docstrings := ds :: !docstrings

  let docstring_body ds = ds.ds_body

  let docstring_loc ds = ds.ds_loc

  (* Docstrings attached to items *)

  type docs =
    { docs_pre: docstring option;
      docs_post: docstring option; }

  let empty_docs = { docs_pre = None; docs_post = None }

  let doc_loc = {txt = "ocaml.doc"; loc = Location.none}

  let docs_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_loc_stack = [];
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
    { attr_name = doc_loc;
      attr_payload = PStr [item];
      attr_loc = Location.none }

  let add_docs_attrs docs attrs =
    let attrs =
      match docs.docs_pre with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> docs_attr ds :: attrs
    in
    let attrs =
      match docs.docs_post with
      | None | Some { ds_body=""; _ } -> attrs
      | Some ds -> attrs @ [docs_attr ds]
    in
    attrs

  (* Docstrings attached to constructors or fields *)

  type info = docstring option

  let empty_info = None

  let info_attr = docs_attr

  let add_info_attrs info attrs =
    match info with
    | None | Some {ds_body=""; _} -> attrs
    | Some ds -> attrs @ [info_attr ds]

  (* Docstrings not attached to a specific item *)

  type text = docstring list

  let empty_text = []
  let empty_text_lazy = lazy []

  let text_loc = {txt = "ocaml.text"; loc = Location.none}

  let text_attr ds =
    let open Parsetree in
    let exp =
      { pexp_desc = Pexp_constant (Pconst_string(ds.ds_body, None));
        pexp_loc = ds.ds_loc;
        pexp_loc_stack = [];
        pexp_attributes = []; }
    in
    let item =
      { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
    in
    { attr_name = text_loc;
      attr_payload = PStr [item];
      attr_loc = Location.none }

  let add_text_attrs dsl attrs =
    let fdsl = List.filter (function {ds_body=""} -> false| _ ->true) dsl in
    (List.map text_attr fdsl) @ attrs

  (* Find the first non-info docstring in a list, attach it and return it *)
  let get_docstring ~info dsl =
    let rec loop = function
      | [] -> None
      | {ds_attached = Info; _} :: rest -> loop rest
      | ds :: _ ->
          ds.ds_attached <- if info then Info else Docs;
          Some ds
    in
    loop dsl

  (* Find all the non-info docstrings in a list, attach them and return them *)
  let get_docstrings dsl =
    let rec loop acc = function
      | [] -> List.rev acc
      | {ds_attached = Info; _} :: rest -> loop acc rest
      | ds :: rest ->
          ds.ds_attached <- Docs;
          loop (ds :: acc) rest
    in
    loop [] dsl

  (* "Associate" all the docstrings in a list *)
  let associate_docstrings dsl =
    List.iter
      (fun ds ->
         match ds.ds_associated with
         | Zero -> ds.ds_associated <- One
         | (One | Many) -> ds.ds_associated <- Many)
      dsl

  (* Map from positions to pre docstrings *)

  let pre_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_pre_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add pre_table pos dsl

  let get_pre_docs pos =
    try
      let dsl = Hashtbl.find pre_table pos in
      associate_docstrings dsl;
      get_docstring ~info:false dsl
    with Not_found -> None

  let mark_pre_docs pos =
    try
      let dsl = Hashtbl.find pre_table pos in
      associate_docstrings dsl
    with Not_found -> ()

  (* Map from positions to post docstrings *)

  let post_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_post_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add post_table pos dsl

  let get_post_docs pos =
    try
      let dsl = Hashtbl.find post_table pos in
      associate_docstrings dsl;
      get_docstring ~info:false dsl
    with Not_found -> None

  let mark_post_docs pos =
    try
      let dsl = Hashtbl.find post_table pos in
      associate_docstrings dsl
    with Not_found -> ()

  let get_info pos =
    try
      let dsl = Hashtbl.find post_table pos in
      get_docstring ~info:true dsl
    with Not_found -> None

  (* Map from positions to floating docstrings *)

  let floating_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_floating_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add floating_table pos dsl

  let get_text pos =
    try
      let dsl = Hashtbl.find floating_table pos in
      get_docstrings dsl
    with Not_found -> []

  let get_post_text pos =
    try
      let dsl = Hashtbl.find post_table pos in
      get_docstrings dsl
    with Not_found -> []

  (* Maps from positions to extra docstrings *)

  let pre_extra_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_pre_extra_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add pre_extra_table pos dsl

  let get_pre_extra_text pos =
    try
      let dsl = Hashtbl.find pre_extra_table pos in
      get_docstrings dsl
    with Not_found -> []

  let post_extra_table : (Lexing.position, docstring list) Hashtbl.t =
    Hashtbl.create 50

  let set_post_extra_docstrings pos dsl =
    if dsl <> [] then Hashtbl.add post_extra_table pos dsl

  let get_post_extra_text pos =
    try
      let dsl = Hashtbl.find post_extra_table pos in
      get_docstrings dsl
    with Not_found -> []

  (* Docstrings from parser actions *)
  module WithParsing = struct
    let symbol_docs () =
      { docs_pre = get_pre_docs (Parsing.symbol_start_pos ());
        docs_post = get_post_docs (Parsing.symbol_end_pos ()); }

    let symbol_docs_lazy () =
      let p1 = Parsing.symbol_start_pos () in
      let p2 = Parsing.symbol_end_pos () in
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let rhs_docs pos1 pos2 =
      { docs_pre = get_pre_docs (Parsing.rhs_start_pos pos1);
        docs_post = get_post_docs (Parsing.rhs_end_pos pos2); }

    let rhs_docs_lazy pos1 pos2 =
      let p1 = Parsing.rhs_start_pos pos1 in
      let p2 = Parsing.rhs_end_pos pos2 in
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let mark_symbol_docs () =
      mark_pre_docs (Parsing.symbol_start_pos ());
      mark_post_docs (Parsing.symbol_end_pos ())

    let mark_rhs_docs pos1 pos2 =
      mark_pre_docs (Parsing.rhs_start_pos pos1);
      mark_post_docs (Parsing.rhs_end_pos pos2)

    let symbol_info () =
      get_info (Parsing.symbol_end_pos ())

    let rhs_info pos =
      get_info (Parsing.rhs_end_pos pos)

    let symbol_text () =
      get_text (Parsing.symbol_start_pos ())

    let symbol_text_lazy () =
      let pos = Parsing.symbol_start_pos () in
      lazy (get_text pos)

    let rhs_text pos =
      get_text (Parsing.rhs_start_pos pos)

    let rhs_post_text pos =
      get_post_text (Parsing.rhs_end_pos pos)

    let rhs_text_lazy pos =
      let pos = Parsing.rhs_start_pos pos in
      lazy (get_text pos)

    let symbol_pre_extra_text () =
      get_pre_extra_text (Parsing.symbol_start_pos ())

    let symbol_post_extra_text () =
      get_post_extra_text (Parsing.symbol_end_pos ())

    let rhs_pre_extra_text pos =
      get_pre_extra_text (Parsing.rhs_start_pos pos)

    let rhs_post_extra_text pos =
      get_post_extra_text (Parsing.rhs_end_pos pos)
  end

  include WithParsing

  module WithMenhir = struct
    let symbol_docs (startpos, endpos) =
      { docs_pre = get_pre_docs startpos;
        docs_post = get_post_docs endpos; }

    let symbol_docs_lazy (p1, p2) =
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let rhs_docs pos1 pos2 =
      { docs_pre = get_pre_docs pos1;
        docs_post = get_post_docs pos2; }

    let rhs_docs_lazy p1 p2 =
      lazy { docs_pre = get_pre_docs p1;
             docs_post = get_post_docs p2; }

    let mark_symbol_docs (startpos, endpos) =
      mark_pre_docs startpos;
      mark_post_docs endpos;
      ()

    let mark_rhs_docs pos1 pos2 =
      mark_pre_docs pos1;
      mark_post_docs pos2;
      ()

    let symbol_info endpos =
      get_info endpos

    let rhs_info endpos =
      get_info endpos

    let symbol_text startpos =
      get_text startpos

    let symbol_text_lazy startpos =
      lazy (get_text startpos)

    let rhs_text pos =
      get_text pos

    let rhs_post_text pos =
      get_post_text pos

    let rhs_text_lazy pos =
      lazy (get_text pos)

    let symbol_pre_extra_text startpos =
      get_pre_extra_text startpos

    let symbol_post_extra_text endpos =
      get_post_extra_text endpos

    let rhs_pre_extra_text pos =
      get_pre_extra_text pos

    let rhs_post_extra_text pos =
      get_post_extra_text pos
  end

  (* (Re)Initialise all comment state *)

  let init () =
    docstrings := [];
    Hashtbl.reset pre_table;
    Hashtbl.reset post_table;
    Hashtbl.reset floating_table;
    Hashtbl.reset pre_extra_table;
    Hashtbl.reset post_extra_table
end

module Ast_helper : sig
  open Asttypes
  open Docstrings
  open Parsetree

  type 'a with_loc = 'a Location.loc
  type loc = Location.t

  type lid = Longident.t with_loc
  type str = string with_loc
  type str_opt = string option with_loc
  type attrs = attribute list

  (** {1 Default locations} *)

  val default_loc: loc ref
  (** Default value for all optional location arguments. *)

  val with_default_loc: loc -> (unit -> 'a) -> 'a
  (** Set the [default_loc] within the scope of the execution
      of the provided function. *)

  (** {1 Constants} *)

  module Const : sig
    val char : char -> constant
    val string : ?quotation_delimiter:string -> string -> constant
    val integer : ?suffix:char -> string -> constant
    val int : ?suffix:char -> int -> constant
    val int32 : ?suffix:char -> int32 -> constant
    val int64 : ?suffix:char -> int64 -> constant
    val nativeint : ?suffix:char -> nativeint -> constant
    val float : ?suffix:char -> string -> constant
  end

  (** {1 Attributes} *)
  module Attr : sig
    val mk: ?loc:loc -> str -> payload -> attribute
  end

  (** {1 Core language} *)

  (** Type expressions *)
  module Typ :
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
    val attr: core_type -> attribute -> core_type

    val any: ?loc:loc -> ?attrs:attrs -> unit -> core_type
    val var: ?loc:loc -> ?attrs:attrs -> string -> core_type
    val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type -> core_type
      -> core_type
    val tuple: ?loc:loc -> ?attrs:attrs -> core_type list -> core_type
    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
    val object_: ?loc:loc -> ?attrs:attrs -> object_field list
      -> closed_flag -> core_type
    val class_: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> core_type
    val alias: ?loc:loc -> ?attrs:attrs -> core_type -> string -> core_type
    val variant: ?loc:loc -> ?attrs:attrs -> row_field list -> closed_flag
      -> label list option -> core_type
    val poly: ?loc:loc -> ?attrs:attrs -> str list -> core_type -> core_type
    val package: ?loc:loc -> ?attrs:attrs -> lid -> (lid * core_type) list
      -> core_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> core_type

    val force_poly: core_type -> core_type

    val varify_constructors: str list -> core_type -> core_type
    (** [varify_constructors newtypes te] is type expression [te], of which
        any of nullary type constructor [tc] is replaced by type variable of
        the same name, if [tc]'s name appears in [newtypes].
        Raise [Syntaxerr.Variable_in_scope] if any type variable inside [te]
        appears in [newtypes].
        @since 4.05
    *)
  end

  (** Patterns *)
  module Pat:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> pattern_desc -> pattern
    val attr:pattern -> attribute -> pattern

    val any: ?loc:loc -> ?attrs:attrs -> unit -> pattern
    val var: ?loc:loc -> ?attrs:attrs -> str -> pattern
    val alias: ?loc:loc -> ?attrs:attrs -> pattern -> str -> pattern
    val constant: ?loc:loc -> ?attrs:attrs -> constant -> pattern
    val interval: ?loc:loc -> ?attrs:attrs -> constant -> constant -> pattern
    val tuple: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
    val construct: ?loc:loc -> ?attrs:attrs -> lid -> pattern option -> pattern
    val variant: ?loc:loc -> ?attrs:attrs -> label -> pattern option -> pattern
    val record: ?loc:loc -> ?attrs:attrs -> (lid * pattern) list -> closed_flag
      -> pattern
    val array: ?loc:loc -> ?attrs:attrs -> pattern list -> pattern
    val or_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern -> pattern
    val constraint_: ?loc:loc -> ?attrs:attrs -> pattern -> core_type -> pattern
    val type_: ?loc:loc -> ?attrs:attrs -> lid -> pattern
    val lazy_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
    val unpack: ?loc:loc -> ?attrs:attrs -> str_opt -> pattern
    val open_: ?loc:loc -> ?attrs:attrs  -> lid -> pattern -> pattern
    val exception_: ?loc:loc -> ?attrs:attrs -> pattern -> pattern
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> pattern
  end

  (** Expressions *)
  module Exp:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> expression_desc -> expression
    val attr: expression -> attribute -> expression

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> expression
    val constant: ?loc:loc -> ?attrs:attrs -> constant -> expression
    val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list
      -> expression -> expression
    val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option
      -> pattern -> expression -> expression
    val function_: ?loc:loc -> ?attrs:attrs -> case list -> expression
    val apply: ?loc:loc -> ?attrs:attrs -> expression
      -> (arg_label * expression) list -> expression
    val match_: ?loc:loc -> ?attrs:attrs -> expression -> case list
      -> expression
    val try_: ?loc:loc -> ?attrs:attrs -> expression -> case list -> expression
    val tuple: ?loc:loc -> ?attrs:attrs -> expression list -> expression
    val construct: ?loc:loc -> ?attrs:attrs -> lid -> expression option
      -> expression
    val variant: ?loc:loc -> ?attrs:attrs -> label -> expression option
      -> expression
    val record: ?loc:loc -> ?attrs:attrs -> (lid * expression) list
      -> expression option -> expression
    val field: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
    val setfield: ?loc:loc -> ?attrs:attrs -> expression -> lid -> expression
      -> expression
    val array: ?loc:loc -> ?attrs:attrs -> expression list -> expression
    val ifthenelse: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression option -> expression
    val sequence: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression
    val while_: ?loc:loc -> ?attrs:attrs -> expression -> expression
      -> expression
    val for_: ?loc:loc -> ?attrs:attrs -> pattern -> expression -> expression
      -> direction_flag -> expression -> expression
    val coerce: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
      -> core_type -> expression
    val constraint_: ?loc:loc -> ?attrs:attrs -> expression -> core_type
      -> expression
    val send: ?loc:loc -> ?attrs:attrs -> expression -> str -> expression
    val new_: ?loc:loc -> ?attrs:attrs -> lid -> expression
    val setinstvar: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
    val override: ?loc:loc -> ?attrs:attrs -> (str * expression) list
      -> expression
    val letmodule: ?loc:loc -> ?attrs:attrs -> str_opt -> module_expr
      -> expression -> expression
    val letexception:
      ?loc:loc -> ?attrs:attrs -> extension_constructor -> expression
      -> expression
    val assert_: ?loc:loc -> ?attrs:attrs -> expression -> expression
    val lazy_: ?loc:loc -> ?attrs:attrs -> expression -> expression
    val poly: ?loc:loc -> ?attrs:attrs -> expression -> core_type option
      -> expression
    val object_: ?loc:loc -> ?attrs:attrs -> class_structure -> expression
    val newtype: ?loc:loc -> ?attrs:attrs -> str -> expression -> expression
    val pack: ?loc:loc -> ?attrs:attrs -> module_expr -> expression
    val open_: ?loc:loc -> ?attrs:attrs -> open_declaration -> expression
      -> expression
    val letop: ?loc:loc -> ?attrs:attrs -> binding_op
      -> binding_op list -> expression -> expression
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> expression
    val unreachable: ?loc:loc -> ?attrs:attrs -> unit -> expression

    val case: pattern -> ?guard:expression -> expression -> case
    val binding_op: str -> pattern -> expression -> loc -> binding_op
  end

  (** Value declarations *)
  module Val:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      ?prim:string list -> str -> core_type -> value_description
  end

  (** Type declarations *)
  module Type:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?params:(core_type * variance) list ->
      ?cstrs:(core_type * core_type * loc) list ->
      ?kind:type_kind -> ?priv:private_flag -> ?manifest:core_type -> str ->
      type_declaration

    val constructor: ?loc:loc -> ?attrs:attrs -> ?info:info ->
      ?args:constructor_arguments -> ?res:core_type -> str ->
      constructor_declaration
    val field: ?loc:loc -> ?attrs:attrs -> ?info:info ->
      ?mut:mutable_flag -> str -> core_type -> label_declaration
  end

  (** Type extensions *)
  module Te:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      ?params:(core_type * variance) list -> ?priv:private_flag ->
      lid -> extension_constructor list -> type_extension

    val mk_exception: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      extension_constructor -> type_exception

    val constructor: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      str -> extension_constructor_kind -> extension_constructor

    val decl: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      ?args:constructor_arguments -> ?res:core_type -> str ->
      extension_constructor
    val rebind: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?info:info ->
      str -> lid -> extension_constructor
  end

  (** {1 Module language} *)

  (** Module type expressions *)
  module Mty:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> module_type_desc -> module_type
    val attr: module_type -> attribute -> module_type

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_type
    val alias: ?loc:loc -> ?attrs:attrs -> lid -> module_type
    val signature: ?loc:loc -> ?attrs:attrs -> signature -> module_type
    val functor_: ?loc:loc -> ?attrs:attrs ->
      functor_parameter -> module_type -> module_type
    val with_: ?loc:loc -> ?attrs:attrs -> module_type ->
      with_constraint list -> module_type
    val typeof_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_type
  end

  (** Module expressions *)
  module Mod:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> module_expr_desc -> module_expr
    val attr: module_expr -> attribute -> module_expr

    val ident: ?loc:loc -> ?attrs:attrs -> lid -> module_expr
    val structure: ?loc:loc -> ?attrs:attrs -> structure -> module_expr
    val functor_: ?loc:loc -> ?attrs:attrs ->
      functor_parameter -> module_expr -> module_expr
    val apply: ?loc:loc -> ?attrs:attrs -> module_expr -> module_expr ->
      module_expr
    val constraint_: ?loc:loc -> ?attrs:attrs -> module_expr -> module_type ->
      module_expr
    val unpack: ?loc:loc -> ?attrs:attrs -> expression -> module_expr
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> module_expr
  end

  (** Signature items *)
  module Sig:
  sig
    val mk: ?loc:loc -> signature_item_desc -> signature_item

    val value: ?loc:loc -> value_description -> signature_item
    val type_: ?loc:loc -> rec_flag -> type_declaration list -> signature_item
    val type_subst: ?loc:loc -> type_declaration list -> signature_item
    val type_extension: ?loc:loc -> type_extension -> signature_item
    val exception_: ?loc:loc -> type_exception -> signature_item
    val module_: ?loc:loc -> module_declaration -> signature_item
    val mod_subst: ?loc:loc -> module_substitution -> signature_item
    val rec_module: ?loc:loc -> module_declaration list -> signature_item
    val modtype: ?loc:loc -> module_type_declaration -> signature_item
    val open_: ?loc:loc -> open_description -> signature_item
    val include_: ?loc:loc -> include_description -> signature_item
    val class_: ?loc:loc -> class_description list -> signature_item
    val class_type: ?loc:loc -> class_type_declaration list -> signature_item
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> signature_item
    val attribute: ?loc:loc -> attribute -> signature_item
    val text: text -> signature_item list
  end

  (** Structure items *)
  module Str:
  sig
    val mk: ?loc:loc -> structure_item_desc -> structure_item

    val eval: ?loc:loc -> ?attrs:attributes -> expression -> structure_item
    val value: ?loc:loc -> rec_flag -> value_binding list -> structure_item
    val primitive: ?loc:loc -> value_description -> structure_item
    val type_: ?loc:loc -> rec_flag -> type_declaration list -> structure_item
    val type_extension: ?loc:loc -> type_extension -> structure_item
    val exception_: ?loc:loc -> type_exception -> structure_item
    val module_: ?loc:loc -> module_binding -> structure_item
    val rec_module: ?loc:loc -> module_binding list -> structure_item
    val modtype: ?loc:loc -> module_type_declaration -> structure_item
    val open_: ?loc:loc -> open_declaration -> structure_item
    val class_: ?loc:loc -> class_declaration list -> structure_item
    val class_type: ?loc:loc -> class_type_declaration list -> structure_item
    val include_: ?loc:loc -> include_declaration -> structure_item
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> structure_item
    val attribute: ?loc:loc -> attribute -> structure_item
    val text: text -> structure_item list
  end

  (** Module declarations *)
  module Md:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str_opt -> module_type -> module_declaration
  end

  (** Module substitutions *)
  module Ms:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str -> lid -> module_substitution
  end

  (** Module type declarations *)
  module Mtd:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?typ:module_type -> str -> module_type_declaration
  end

  (** Module bindings *)
  module Mb:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      str_opt -> module_expr -> module_binding
  end

  (** Opens *)
  module Opn:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs ->
      ?override:override_flag -> 'a -> 'a open_infos
  end

  (** Includes *)
  module Incl:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> 'a -> 'a include_infos
  end

  (** Value bindings *)
  module Vb:
  sig
    val mk: ?loc: loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      pattern -> expression -> value_binding
  end


  (** {1 Class language} *)

  (** Class type expressions *)
  module Cty:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> class_type_desc -> class_type
    val attr: class_type -> attribute -> class_type

    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_type
    val signature: ?loc:loc -> ?attrs:attrs -> class_signature -> class_type
    val arrow: ?loc:loc -> ?attrs:attrs -> arg_label -> core_type ->
      class_type -> class_type
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type
    val open_: ?loc:loc -> ?attrs:attrs -> open_description -> class_type
      -> class_type
  end

  (** Class type fields *)
  module Ctf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs ->
      class_type_field_desc -> class_type_field
    val attr: class_type_field -> attribute -> class_type_field

    val inherit_: ?loc:loc -> ?attrs:attrs -> class_type -> class_type_field
    val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
      virtual_flag -> core_type -> class_type_field
    val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
      virtual_flag -> core_type -> class_type_field
    val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
      class_type_field
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_type_field
    val attribute: ?loc:loc -> attribute -> class_type_field
    val text: text -> class_type_field list
  end

  (** Class expressions *)
  module Cl:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> class_expr_desc -> class_expr
    val attr: class_expr -> attribute -> class_expr

    val constr: ?loc:loc -> ?attrs:attrs -> lid -> core_type list -> class_expr
    val structure: ?loc:loc -> ?attrs:attrs -> class_structure -> class_expr
    val fun_: ?loc:loc -> ?attrs:attrs -> arg_label -> expression option ->
      pattern -> class_expr -> class_expr
    val apply: ?loc:loc -> ?attrs:attrs -> class_expr ->
      (arg_label * expression) list -> class_expr
    val let_: ?loc:loc -> ?attrs:attrs -> rec_flag -> value_binding list ->
      class_expr -> class_expr
    val constraint_: ?loc:loc -> ?attrs:attrs -> class_expr -> class_type ->
      class_expr
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_expr
    val open_: ?loc:loc -> ?attrs:attrs -> open_description -> class_expr
      -> class_expr
  end

  (** Class fields *)
  module Cf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> class_field_desc ->
      class_field
    val attr: class_field -> attribute -> class_field

    val inherit_: ?loc:loc -> ?attrs:attrs -> override_flag -> class_expr ->
      str option -> class_field
    val val_: ?loc:loc -> ?attrs:attrs -> str -> mutable_flag ->
      class_field_kind -> class_field
    val method_: ?loc:loc -> ?attrs:attrs -> str -> private_flag ->
      class_field_kind -> class_field
    val constraint_: ?loc:loc -> ?attrs:attrs -> core_type -> core_type ->
      class_field
    val initializer_: ?loc:loc -> ?attrs:attrs -> expression -> class_field
    val extension: ?loc:loc -> ?attrs:attrs -> extension -> class_field
    val attribute: ?loc:loc -> attribute -> class_field
    val text: text -> class_field list

    val virtual_: core_type -> class_field_kind
    val concrete: override_flag -> expression -> class_field_kind

  end

  (** Classes *)
  module Ci:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> ?docs:docs -> ?text:text ->
      ?virt:virtual_flag -> ?params:(core_type * variance) list ->
      str -> 'a -> 'a class_infos
  end

  (** Class signatures *)
  module Csig:
  sig
    val mk: core_type -> class_type_field list -> class_signature
  end

  (** Class structures *)
  module Cstr:
  sig
    val mk: pattern -> class_field list -> class_structure
  end

  (** Row fields *)
  module Rf:
  sig
    val mk: ?loc:loc -> ?attrs:attrs -> row_field_desc -> row_field
    val tag: ?loc:loc -> ?attrs:attrs ->
      label with_loc -> bool -> core_type list -> row_field
    val inherit_: ?loc:loc -> core_type -> row_field
  end

  (** Object fields *)
  module Of:
  sig
    val mk: ?loc:loc -> ?attrs:attrs ->
      object_field_desc -> object_field
    val tag: ?loc:loc -> ?attrs:attrs ->
      label with_loc -> core_type -> object_field
    val inherit_: ?loc:loc -> core_type -> object_field
  end

end = struct
  open Asttypes
  open Parsetree
  open Docstrings

  type 'a with_loc = 'a Location.loc
  type loc = Location.t

  type lid = Longident.t with_loc
  type str = string with_loc
  type str_opt = string option with_loc
  type attrs = attribute list

  let default_loc = ref Location.none

  let with_default_loc l f =
    Misc.protect_refs [Misc.R (default_loc, l)] f

  module Const = struct
    let integer ?suffix i = Pconst_integer (i, suffix)
    let int ?suffix i = integer ?suffix (Int.to_string i)
    let int32 ?(suffix='l') i = integer ~suffix (Int32.to_string i)
    let int64 ?(suffix='L') i = integer ~suffix (Int64.to_string i)
    let nativeint ?(suffix='n') i = integer ~suffix (Nativeint.to_string i)
    let float ?suffix f = Pconst_float (f, suffix)
    let char c = Pconst_char c
    let string ?quotation_delimiter s = Pconst_string (s, quotation_delimiter)
  end

  module Attr = struct
    let mk ?(loc= !default_loc) name payload =
      { attr_name = name;
        attr_payload = payload;
        attr_loc = loc }
  end

  module Typ = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ptyp_desc = d;
       ptyp_loc = loc;
       ptyp_loc_stack = [];
       ptyp_attributes = attrs}

    let attr d a = {d with ptyp_attributes = d.ptyp_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ptyp_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ptyp_var a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_arrow (a, b, c))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ptyp_tuple a)
    let constr ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_constr (a, b))
    let object_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_object (a, b))
    let class_ ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_class (a, b))
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_alias (a, b))
    let variant ?loc ?attrs a b c = mk ?loc ?attrs (Ptyp_variant (a, b, c))
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_poly (a, b))
    let package ?loc ?attrs a b = mk ?loc ?attrs (Ptyp_package (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ptyp_extension a)

    let force_poly t =
      match t.ptyp_desc with
      | Ptyp_poly _ -> t
      | _ -> poly ~loc:t.ptyp_loc [] t (* -> ghost? *)

    let varify_constructors var_names t =
      let check_variable vl loc v =
        if List.mem v vl then
          raise Syntaxerr.(Error(Variable_in_scope(loc,v))) in
      let var_names = List.map (fun v -> v.txt) var_names in
      let rec loop t =
        let desc =
          match t.ptyp_desc with
          | Ptyp_any -> Ptyp_any
          | Ptyp_var x ->
              check_variable var_names t.ptyp_loc x;
              Ptyp_var x
          | Ptyp_arrow (label,core_type,core_type') ->
              Ptyp_arrow(label, loop core_type, loop core_type')
          | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
          | Ptyp_constr( { txt = Longident.Lident s }, [])
            when List.mem s var_names ->
              Ptyp_var s
          | Ptyp_constr(longident, lst) ->
              Ptyp_constr(longident, List.map loop lst)
          | Ptyp_object (lst, o) ->
              Ptyp_object (List.map loop_object_field lst, o)
          | Ptyp_class (longident, lst) ->
              Ptyp_class (longident, List.map loop lst)
          | Ptyp_alias(core_type, string) ->
              check_variable var_names t.ptyp_loc string;
              Ptyp_alias(loop core_type, string)
          | Ptyp_variant(row_field_list, flag, lbl_lst_option) ->
              Ptyp_variant(List.map loop_row_field row_field_list,
                           flag, lbl_lst_option)
          | Ptyp_poly(string_lst, core_type) ->
              List.iter (fun v ->
                  check_variable var_names t.ptyp_loc v.txt) string_lst;
              Ptyp_poly(string_lst, loop core_type)
          | Ptyp_package(longident,lst) ->
              Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
          | Ptyp_extension (s, arg) ->
              Ptyp_extension (s, arg)
        in
        {t with ptyp_desc = desc}
      and loop_row_field field =
        let prf_desc = match field.prf_desc with
          | Rtag(label,flag,lst) ->
              Rtag(label,flag,List.map loop lst)
          | Rinherit t ->
              Rinherit (loop t)
        in
        { field with prf_desc; }
      and loop_object_field field =
        let pof_desc = match field.pof_desc with
          | Otag(label, t) ->
              Otag(label, loop t)
          | Oinherit t ->
              Oinherit (loop t)
        in
        { field with pof_desc; }
      in
      loop t

  end

  module Pat = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {ppat_desc = d;
       ppat_loc = loc;
       ppat_loc_stack = [];
       ppat_attributes = attrs}
    let attr d a = {d with ppat_attributes = d.ppat_attributes @ [a]}

    let any ?loc ?attrs () = mk ?loc ?attrs Ppat_any
    let var ?loc ?attrs a = mk ?loc ?attrs (Ppat_var a)
    let alias ?loc ?attrs a b = mk ?loc ?attrs (Ppat_alias (a, b))
    let constant ?loc ?attrs a = mk ?loc ?attrs (Ppat_constant a)
    let interval ?loc ?attrs a b = mk ?loc ?attrs (Ppat_interval (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Ppat_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Ppat_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Ppat_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Ppat_record (a, b))
    let array ?loc ?attrs a = mk ?loc ?attrs (Ppat_array a)
    let or_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_or (a, b))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_constraint (a, b))
    let type_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_type a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_lazy a)
    let unpack ?loc ?attrs a = mk ?loc ?attrs (Ppat_unpack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Ppat_open (a, b))
    let exception_ ?loc ?attrs a = mk ?loc ?attrs (Ppat_exception a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Ppat_extension a)
  end

  module Exp = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pexp_desc = d;
       pexp_loc = loc;
       pexp_loc_stack = [];
       pexp_attributes = attrs}
    let attr d a = {d with pexp_attributes = d.pexp_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pexp_ident a)
    let constant ?loc ?attrs a = mk ?loc ?attrs (Pexp_constant a)
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_let (a, b, c))
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pexp_fun (a, b, c, d))
    let function_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_function a)
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pexp_apply (a, b))
    let match_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_match (a, b))
    let try_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_try (a, b))
    let tuple ?loc ?attrs a = mk ?loc ?attrs (Pexp_tuple a)
    let construct ?loc ?attrs a b = mk ?loc ?attrs (Pexp_construct (a, b))
    let variant ?loc ?attrs a b = mk ?loc ?attrs (Pexp_variant (a, b))
    let record ?loc ?attrs a b = mk ?loc ?attrs (Pexp_record (a, b))
    let field ?loc ?attrs a b = mk ?loc ?attrs (Pexp_field (a, b))
    let setfield ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_setfield (a, b, c))
    let array ?loc ?attrs a = mk ?loc ?attrs (Pexp_array a)
    let ifthenelse ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_ifthenelse (a, b, c))
    let sequence ?loc ?attrs a b = mk ?loc ?attrs (Pexp_sequence (a, b))
    let while_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_while (a, b))
    let for_ ?loc ?attrs a b c d e = mk ?loc ?attrs (Pexp_for (a, b, c, d, e))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_constraint (a, b))
    let coerce ?loc ?attrs a b c = mk ?loc ?attrs (Pexp_coerce (a, b, c))
    let send ?loc ?attrs a b = mk ?loc ?attrs (Pexp_send (a, b))
    let new_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_new a)
    let setinstvar ?loc ?attrs a b = mk ?loc ?attrs (Pexp_setinstvar (a, b))
    let override ?loc ?attrs a = mk ?loc ?attrs (Pexp_override a)
    let letmodule ?loc ?attrs a b c= mk ?loc ?attrs (Pexp_letmodule (a, b, c))
    let letexception ?loc ?attrs a b = mk ?loc ?attrs (Pexp_letexception (a, b))
    let assert_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_assert a)
    let lazy_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_lazy a)
    let poly ?loc ?attrs a b = mk ?loc ?attrs (Pexp_poly (a, b))
    let object_ ?loc ?attrs a = mk ?loc ?attrs (Pexp_object a)
    let newtype ?loc ?attrs a b = mk ?loc ?attrs (Pexp_newtype (a, b))
    let pack ?loc ?attrs a = mk ?loc ?attrs (Pexp_pack a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pexp_open (a, b))
    let letop ?loc ?attrs let_ ands body =
      mk ?loc ?attrs (Pexp_letop {let_; ands; body})
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pexp_extension a)
    let unreachable ?loc ?attrs () = mk ?loc ?attrs Pexp_unreachable

    let case lhs ?guard rhs =
      {
        pc_lhs = lhs;
        pc_guard = guard;
        pc_rhs = rhs;
      }

    let binding_op op pat exp loc =
      {
        pbop_op = op;
        pbop_pat = pat;
        pbop_exp = exp;
        pbop_loc = loc;
      }
  end

  module Mty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmty_desc = d; pmty_loc = loc; pmty_attributes = attrs}
    let attr d a = {d with pmty_attributes = d.pmty_attributes @ [a]}

    let ident ?loc ?attrs a = mk ?loc ?attrs (Pmty_ident a)
    let alias ?loc ?attrs a = mk ?loc ?attrs (Pmty_alias a)
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pmty_signature a)
    let functor_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_functor (a, b))
    let with_ ?loc ?attrs a b = mk ?loc ?attrs (Pmty_with (a, b))
    let typeof_ ?loc ?attrs a = mk ?loc ?attrs (Pmty_typeof a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmty_extension a)
  end

  module Mod = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {pmod_desc = d; pmod_loc = loc; pmod_attributes = attrs}
    let attr d a = {d with pmod_attributes = d.pmod_attributes @ [a]}

    let ident ?loc ?attrs x = mk ?loc ?attrs (Pmod_ident x)
    let structure ?loc ?attrs x = mk ?loc ?attrs (Pmod_structure x)
    let functor_ ?loc ?attrs arg body =
      mk ?loc ?attrs (Pmod_functor (arg, body))
    let apply ?loc ?attrs m1 m2 = mk ?loc ?attrs (Pmod_apply (m1, m2))
    let constraint_ ?loc ?attrs m mty = mk ?loc ?attrs (Pmod_constraint (m, mty))
    let unpack ?loc ?attrs e = mk ?loc ?attrs (Pmod_unpack e)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pmod_extension a)
  end

  module Sig = struct
    let mk ?(loc = !default_loc) d = {psig_desc = d; psig_loc = loc}

    let value ?loc a = mk ?loc (Psig_value a)
    let type_ ?loc rec_flag a = mk ?loc (Psig_type (rec_flag, a))
    let type_subst ?loc a = mk ?loc (Psig_typesubst a)
    let type_extension ?loc a = mk ?loc (Psig_typext a)
    let exception_ ?loc a = mk ?loc (Psig_exception a)
    let module_ ?loc a = mk ?loc (Psig_module a)
    let mod_subst ?loc a = mk ?loc (Psig_modsubst a)
    let rec_module ?loc a = mk ?loc (Psig_recmodule a)
    let modtype ?loc a = mk ?loc (Psig_modtype a)
    let open_ ?loc a = mk ?loc (Psig_open a)
    let include_ ?loc a = mk ?loc (Psig_include a)
    let class_ ?loc a = mk ?loc (Psig_class a)
    let class_type ?loc a = mk ?loc (Psig_class_type a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Psig_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Psig_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Str = struct
    let mk ?(loc = !default_loc) d = {pstr_desc = d; pstr_loc = loc}

    let eval ?loc ?(attrs = []) a = mk ?loc (Pstr_eval (a, attrs))
    let value ?loc a b = mk ?loc (Pstr_value (a, b))
    let primitive ?loc a = mk ?loc (Pstr_primitive a)
    let type_ ?loc rec_flag a = mk ?loc (Pstr_type (rec_flag, a))
    let type_extension ?loc a = mk ?loc (Pstr_typext a)
    let exception_ ?loc a = mk ?loc (Pstr_exception a)
    let module_ ?loc a = mk ?loc (Pstr_module a)
    let rec_module ?loc a = mk ?loc (Pstr_recmodule a)
    let modtype ?loc a = mk ?loc (Pstr_modtype a)
    let open_ ?loc a = mk ?loc (Pstr_open a)
    let class_ ?loc a = mk ?loc (Pstr_class a)
    let class_type ?loc a = mk ?loc (Pstr_class_type a)
    let include_ ?loc a = mk ?loc (Pstr_include a)
    let extension ?loc ?(attrs = []) a = mk ?loc (Pstr_extension (a, attrs))
    let attribute ?loc a = mk ?loc (Pstr_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt
  end

  module Cl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
        pcl_desc = d;
        pcl_loc = loc;
        pcl_attributes = attrs;
      }
    let attr d a = {d with pcl_attributes = d.pcl_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constr (a, b))
    let structure ?loc ?attrs a = mk ?loc ?attrs (Pcl_structure a)
    let fun_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pcl_fun (a, b, c, d))
    let apply ?loc ?attrs a b = mk ?loc ?attrs (Pcl_apply (a, b))
    let let_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcl_let (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcl_extension a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pcl_open (a, b))
  end

  module Cty = struct
    let mk ?(loc = !default_loc) ?(attrs = []) d =
      {
        pcty_desc = d;
        pcty_loc = loc;
        pcty_attributes = attrs;
      }
    let attr d a = {d with pcty_attributes = d.pcty_attributes @ [a]}

    let constr ?loc ?attrs a b = mk ?loc ?attrs (Pcty_constr (a, b))
    let signature ?loc ?attrs a = mk ?loc ?attrs (Pcty_signature a)
    let arrow ?loc ?attrs a b c = mk ?loc ?attrs (Pcty_arrow (a, b, c))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcty_extension a)
    let open_ ?loc ?attrs a b = mk ?loc ?attrs (Pcty_open (a, b))
  end

  module Ctf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) d =
      {
        pctf_desc = d;
        pctf_loc = loc;
        pctf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a = mk ?loc ?attrs (Pctf_inherit a)
    let val_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_val (a, b, c, d))
    let method_ ?loc ?attrs a b c d = mk ?loc ?attrs (Pctf_method (a, b, c, d))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pctf_constraint (a, b))
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pctf_extension a)
    let attribute ?loc a = mk ?loc (Pctf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let attr d a = {d with pctf_attributes = d.pctf_attributes @ [a]}

  end

  module Cf = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) d =
      {
        pcf_desc = d;
        pcf_loc = loc;
        pcf_attributes = add_docs_attrs docs attrs;
      }

    let inherit_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_inherit (a, b, c))
    let val_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_val (a, b, c))
    let method_ ?loc ?attrs a b c = mk ?loc ?attrs (Pcf_method (a, b, c))
    let constraint_ ?loc ?attrs a b = mk ?loc ?attrs (Pcf_constraint (a, b))
    let initializer_ ?loc ?attrs a = mk ?loc ?attrs (Pcf_initializer a)
    let extension ?loc ?attrs a = mk ?loc ?attrs (Pcf_extension a)
    let attribute ?loc a = mk ?loc (Pcf_attribute a)
    let text txt =
      let f_txt = List.filter (fun ds -> docstring_body ds <> "") txt in
      List.map
        (fun ds -> attribute ~loc:(docstring_loc ds) (text_attr ds))
        f_txt

    let virtual_ ct = Cfk_virtual ct
    let concrete o e = Cfk_concrete (o, e)

    let attr d a = {d with pcf_attributes = d.pcf_attributes @ [a]}

  end

  module Val = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        ?(prim = []) name typ =
      {
        pval_name = name;
        pval_type = typ;
        pval_attributes = add_docs_attrs docs attrs;
        pval_loc = loc;
        pval_prim = prim;
      }
  end

  module Md = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = []) name typ =
      {
        pmd_name = name;
        pmd_type = typ;
        pmd_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmd_loc = loc;
      }
  end

  module Ms = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = []) name syn =
      {
        pms_name = name;
        pms_manifest = syn;
        pms_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pms_loc = loc;
      }
  end

  module Mtd = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = []) ?typ name =
      {
        pmtd_name = name;
        pmtd_type = typ;
        pmtd_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmtd_loc = loc;
      }
  end

  module Mb = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = []) name expr =
      {
        pmb_name = name;
        pmb_expr = expr;
        pmb_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pmb_loc = loc;
      }
  end

  module Opn = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        ?(override = Fresh) expr =
      {
        popen_expr = expr;
        popen_override = override;
        popen_loc = loc;
        popen_attributes = add_docs_attrs docs attrs;
      }
  end

  module Incl = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs) mexpr =
      {
        pincl_mod = mexpr;
        pincl_loc = loc;
        pincl_attributes = add_docs_attrs docs attrs;
      }

  end

  module Vb = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        ?(text = []) pat expr =
      {
        pvb_pat = pat;
        pvb_expr = expr;
        pvb_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pvb_loc = loc;
      }
  end

  module Ci = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = [])
        ?(virt = Concrete) ?(params = []) name expr =
      {
        pci_virt = virt;
        pci_params = params;
        pci_name = name;
        pci_expr = expr;
        pci_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        pci_loc = loc;
      }
  end

  module Type = struct
    let mk ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(text = [])
        ?(params = [])
        ?(cstrs = [])
        ?(kind = Ptype_abstract)
        ?(priv = Public)
        ?manifest
        name =
      {
        ptype_name = name;
        ptype_params = params;
        ptype_cstrs = cstrs;
        ptype_kind = kind;
        ptype_private = priv;
        ptype_manifest = manifest;
        ptype_attributes =
          add_text_attrs text (add_docs_attrs docs attrs);
        ptype_loc = loc;
      }

    let constructor ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
        ?(args = Pcstr_tuple []) ?res name =
      {
        pcd_name = name;
        pcd_args = args;
        pcd_res = res;
        pcd_loc = loc;
        pcd_attributes = add_info_attrs info attrs;
      }

    let field ?(loc = !default_loc) ?(attrs = []) ?(info = empty_info)
        ?(mut = Immutable) name typ =
      {
        pld_name = name;
        pld_mutable = mut;
        pld_type = typ;
        pld_loc = loc;
        pld_attributes = add_info_attrs info attrs;
      }

  end

  (** Type extensions *)
  module Te = struct
    let mk ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        ?(params = []) ?(priv = Public) path constructors =
      {
        ptyext_path = path;
        ptyext_params = params;
        ptyext_constructors = constructors;
        ptyext_private = priv;
        ptyext_loc = loc;
        ptyext_attributes = add_docs_attrs docs attrs;
      }

    let mk_exception ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        constructor =
      {
        ptyexn_constructor = constructor;
        ptyexn_loc = loc;
        ptyexn_attributes = add_docs_attrs docs attrs;
      }

    let constructor ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(info = empty_info) name kind =
      {
        pext_name = name;
        pext_kind = kind;
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let decl ?(loc = !default_loc) ?(attrs = []) ?(docs = empty_docs)
        ?(info = empty_info) ?(args = Pcstr_tuple []) ?res name =
      {
        pext_name = name;
        pext_kind = Pext_decl(args, res);
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

    let rebind ?(loc = !default_loc) ?(attrs = [])
        ?(docs = empty_docs) ?(info = empty_info) name lid =
      {
        pext_name = name;
        pext_kind = Pext_rebind lid;
        pext_loc = loc;
        pext_attributes = add_docs_attrs docs (add_info_attrs info attrs);
      }

  end

  module Csig = struct
    let mk self fields =
      {
        pcsig_self = self;
        pcsig_fields = fields;
      }
  end

  module Cstr = struct
    let mk self fields =
      {
        pcstr_self = self;
        pcstr_fields = fields;
      }
  end

  (** Row fields *)
  module Rf = struct
    let mk ?(loc = !default_loc) ?(attrs = []) desc = {
      prf_desc = desc;
      prf_loc = loc;
      prf_attributes = attrs;
    }
    let tag ?loc ?attrs label const tys =
      mk ?loc ?attrs (Rtag (label, const, tys))
    let inherit_?loc ty =
      mk ?loc (Rinherit ty)
  end

  (** Object fields *)
  module Of = struct
    let mk ?(loc = !default_loc) ?(attrs=[]) desc = {
      pof_desc = desc;
      pof_loc = loc;
      pof_attributes = attrs;
    }
    let tag ?loc ?attrs label ty =
      mk ?loc ?attrs (Otag (label, ty))
    let inherit_ ?loc ty =
      mk ?loc (Oinherit ty)
  end
end

module Ast_mapper : sig
  open Parsetree

  (** {1 A generic Parsetree mapper} *)

  type mapper (*IF_CURRENT = Ast_mapper.mapper *) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    binding_op: mapper -> binding_op -> binding_op;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
      -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
      -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
      -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_substitution: mapper -> module_substitution -> module_substitution;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
      -> module_type_declaration;
    open_declaration: mapper -> open_declaration -> open_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_exception: mapper -> type_exception -> type_exception;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }
  (** A mapper record implements one "method" per syntactic category,
      using an open recursion style: each method takes as its first
      argument the mapper to be applied to children in the syntax
      tree. *)

  val default_mapper: mapper
  (** A default mapper, which implements a "deep identity" mapping. *)

  (** {1 Apply mappers to compilation units} *)

  val tool_name: unit -> string
  (** Can be used within a ppx preprocessor to know which tool is
      calling it ["ocamlc"], ["ocamlopt"], ["ocamldoc"], ["ocamldep"],
      ["ocaml"], ...  Some global variables that reflect command-line
      options are automatically synchronized between the calling tool
      and the ppx preprocessor: {!Clflags.include_dirs},
      {!Load_path}, {!Clflags.open_modules}, {!Clflags.for_package},
      {!Clflags.debug}. *)


  val apply: source:string -> target:string -> mapper -> unit
  (** Apply a mapper (parametrized by the unit name) to a dumped
      parsetree found in the [source] file and put the result in the
      [target] file. The [structure] or [signature] field of the mapper
      is applied to the implementation or interface.  *)

  val run_main: (string list -> mapper) -> unit
  (** Entry point to call to implement a standalone -ppx rewriter from a
      mapper, parametrized by the command line arguments.  The current
      unit name can be obtained from {!Location.input_name}.  This
      function implements proper error reporting for uncaught
      exceptions. *)

  (** {1 Registration API} *)

  val register_function: (string -> (string list -> mapper) -> unit) ref

  val register: string -> (string list -> mapper) -> unit
  (** Apply the [register_function].  The default behavior is to run the
      mapper immediately, taking arguments from the process command
      line.  This is to support a scenario where a mapper is linked as a
      stand-alone executable.

      It is possible to overwrite the [register_function] to define
      "-ppx drivers", which combine several mappers in a single process.
      Typically, a driver starts by defining [register_function] to a
      custom implementation, then lets ppx rewriters (linked statically
      or dynamically) register themselves, and then run all or some of
      them.  It is also possible to have -ppx drivers apply rewriters to
      only specific parts of an AST.

      The first argument to [register] is a symbolic name to be used by
      the ppx driver.  *)


  (** {1 Convenience functions to write mappers} *)

  val map_opt: ('a -> 'b) -> 'a option -> 'b option

  val extension_of_error: Locations.location_error -> extension
  (** Encode an error into an 'ocaml.error' extension node which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the error. *)

  val attribute_of_warning: Location.t -> string -> attribute
  (** Encode a warning message into an 'ocaml.ppwarning' attribute which can be
      inserted in a generated Parsetree.  The compiler will be
      responsible for reporting the warning. *)

  include Locations.Helpers_intf

  (** {1 Helper functions to call external mappers} *)

  val add_ppx_context_str:
    tool_name:string -> Parsetree.structure -> Parsetree.structure
  (** Extract information from the current environment and encode it
      into an attribute which is prepended to the list of structure
      items in order to pass the information to an external
      processor. *)

  val add_ppx_context_sig:
    tool_name:string -> Parsetree.signature -> Parsetree.signature
  (** Same as [add_ppx_context_str], but for signatures. *)

  val drop_ppx_context_str:
    restore:bool -> Parsetree.structure -> Parsetree.structure
  (** Drop the ocaml.ppx.context attribute from a structure.  If
      [restore] is true, also restore the associated data in the current
      process. *)

  val drop_ppx_context_sig:
    restore:bool -> Parsetree.signature -> Parsetree.signature
  (** Same as [drop_ppx_context_str], but for signatures. *)

  (** {1 Cookies} *)

  (** Cookies are used to pass information from a ppx processor to
      a further invocation of itself, when called from the OCaml
      toplevel (or other tools that support cookies). *)

  val set_cookie: string -> Parsetree.expression -> unit
  val get_cookie: string -> Parsetree.expression option
end = struct
  open Parsetree
  open Ast_helper
  open Location

  module String = Misc.Stdlib.String

  type mapper (*IF_CURRENT = Ast_mapper.mapper *) = {
    attribute: mapper -> attribute -> attribute;
    attributes: mapper -> attribute list -> attribute list;
    binding_op: mapper -> binding_op -> binding_op;
    case: mapper -> case -> case;
    cases: mapper -> case list -> case list;
    class_declaration: mapper -> class_declaration -> class_declaration;
    class_description: mapper -> class_description -> class_description;
    class_expr: mapper -> class_expr -> class_expr;
    class_field: mapper -> class_field -> class_field;
    class_signature: mapper -> class_signature -> class_signature;
    class_structure: mapper -> class_structure -> class_structure;
    class_type: mapper -> class_type -> class_type;
    class_type_declaration: mapper -> class_type_declaration
      -> class_type_declaration;
    class_type_field: mapper -> class_type_field -> class_type_field;
    constructor_declaration: mapper -> constructor_declaration
      -> constructor_declaration;
    expr: mapper -> expression -> expression;
    extension: mapper -> extension -> extension;
    extension_constructor: mapper -> extension_constructor
      -> extension_constructor;
    include_declaration: mapper -> include_declaration -> include_declaration;
    include_description: mapper -> include_description -> include_description;
    label_declaration: mapper -> label_declaration -> label_declaration;
    location: mapper -> Location.t -> Location.t;
    module_binding: mapper -> module_binding -> module_binding;
    module_declaration: mapper -> module_declaration -> module_declaration;
    module_substitution: mapper -> module_substitution -> module_substitution;
    module_expr: mapper -> module_expr -> module_expr;
    module_type: mapper -> module_type -> module_type;
    module_type_declaration: mapper -> module_type_declaration
      -> module_type_declaration;
    open_declaration: mapper -> open_declaration -> open_declaration;
    open_description: mapper -> open_description -> open_description;
    pat: mapper -> pattern -> pattern;
    payload: mapper -> payload -> payload;
    signature: mapper -> signature -> signature;
    signature_item: mapper -> signature_item -> signature_item;
    structure: mapper -> structure -> structure;
    structure_item: mapper -> structure_item -> structure_item;
    typ: mapper -> core_type -> core_type;
    type_declaration: mapper -> type_declaration -> type_declaration;
    type_extension: mapper -> type_extension -> type_extension;
    type_exception: mapper -> type_exception -> type_exception;
    type_kind: mapper -> type_kind -> type_kind;
    value_binding: mapper -> value_binding -> value_binding;
    value_description: mapper -> value_description -> value_description;
    with_constraint: mapper -> with_constraint -> with_constraint;
  }

  let map_fst f (x, y) = (f x, y)
  let map_snd f (x, y) = (x, f y)
  let map_tuple f1 f2 (x, y) = (f1 x, f2 y)
  let map_tuple3 f1 f2 f3 (x, y, z) = (f1 x, f2 y, f3 z)
  let map_opt f = function None -> None | Some x -> Some (f x)

  let map_loc sub {loc; txt} = {loc = sub.location sub loc; txt}

  module T = struct
    (* Type expressions for the core language *)

    let row_field sub {
        prf_desc;
        prf_loc;
        prf_attributes;
      } =
      let loc = sub.location sub prf_loc in
      let attrs = sub.attributes sub prf_attributes in
      let desc = match prf_desc with
        | Rtag (l, b, tl) -> Rtag (map_loc sub l, b, List.map (sub.typ sub) tl)
        | Rinherit t -> Rinherit (sub.typ sub t)
      in
      Rf.mk ~loc ~attrs desc

    let object_field sub {
        pof_desc;
        pof_loc;
        pof_attributes;
      } =
      let loc = sub.location sub pof_loc in
      let attrs = sub.attributes sub pof_attributes in
      let desc = match pof_desc with
        | Otag (l, t) -> Otag (map_loc sub l, sub.typ sub t)
        | Oinherit t -> Oinherit (sub.typ sub t)
      in
      Of.mk ~loc ~attrs desc

    let map sub {ptyp_desc = desc; ptyp_loc = loc; ptyp_attributes = attrs} =
      let open Typ in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ptyp_any -> any ~loc ~attrs ()
      | Ptyp_var s -> var ~loc ~attrs s
      | Ptyp_arrow (lab, t1, t2) ->
          arrow ~loc ~attrs lab (sub.typ sub t1) (sub.typ sub t2)
      | Ptyp_tuple tyl -> tuple ~loc ~attrs (List.map (sub.typ sub) tyl)
      | Ptyp_constr (lid, tl) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_object (l, o) ->
          object_ ~loc ~attrs (List.map (object_field sub) l) o
      | Ptyp_class (lid, tl) ->
          class_ ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tl)
      | Ptyp_alias (t, s) -> alias ~loc ~attrs (sub.typ sub t) s
      | Ptyp_variant (rl, b, ll) ->
          variant ~loc ~attrs (List.map (row_field sub) rl) b ll
      | Ptyp_poly (sl, t) -> poly ~loc ~attrs
                               (List.map (map_loc sub) sl) (sub.typ sub t)
      | Ptyp_package (lid, l) ->
          package ~loc ~attrs (map_loc sub lid)
            (List.map (map_tuple (map_loc sub) (sub.typ sub)) l)
      | Ptyp_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_type_declaration sub
        {ptype_name; ptype_params; ptype_cstrs;
         ptype_kind;
         ptype_private;
         ptype_manifest;
         ptype_attributes;
         ptype_loc} =
      let loc = sub.location sub ptype_loc in
      let attrs = sub.attributes sub ptype_attributes in
      Type.mk ~loc ~attrs (map_loc sub ptype_name)
        ~params:(List.map (map_fst (sub.typ sub)) ptype_params)
        ~priv:ptype_private
        ~cstrs:(List.map
                  (map_tuple3 (sub.typ sub) (sub.typ sub) (sub.location sub))
                  ptype_cstrs)
        ~kind:(sub.type_kind sub ptype_kind)
        ?manifest:(map_opt (sub.typ sub) ptype_manifest)

    let map_type_kind sub = function
      | Ptype_abstract -> Ptype_abstract
      | Ptype_variant l ->
          Ptype_variant (List.map (sub.constructor_declaration sub) l)
      | Ptype_record l -> Ptype_record (List.map (sub.label_declaration sub) l)
      | Ptype_open -> Ptype_open

    let map_constructor_arguments sub = function
      | Pcstr_tuple l -> Pcstr_tuple (List.map (sub.typ sub) l)
      | Pcstr_record l ->
          Pcstr_record (List.map (sub.label_declaration sub) l)

    let map_type_extension sub
        {ptyext_path; ptyext_params;
         ptyext_constructors;
         ptyext_private;
         ptyext_loc;
         ptyext_attributes} =
      let loc = sub.location sub ptyext_loc in
      let attrs = sub.attributes sub ptyext_attributes in
      Te.mk ~loc ~attrs
        (map_loc sub ptyext_path)
        (List.map (sub.extension_constructor sub) ptyext_constructors)
        ~params:(List.map (map_fst (sub.typ sub)) ptyext_params)
        ~priv:ptyext_private

    let map_type_exception sub
        {ptyexn_constructor; ptyexn_loc; ptyexn_attributes} =
      let loc = sub.location sub ptyexn_loc in
      let attrs = sub.attributes sub ptyexn_attributes in
      Te.mk_exception ~loc ~attrs
        (sub.extension_constructor sub ptyexn_constructor)

    let map_extension_constructor_kind sub = function
        Pext_decl(ctl, cto) ->
          Pext_decl(map_constructor_arguments sub ctl, map_opt (sub.typ sub) cto)
      | Pext_rebind li ->
          Pext_rebind (map_loc sub li)

    let map_extension_constructor sub
        {pext_name;
         pext_kind;
         pext_loc;
         pext_attributes} =
      let loc = sub.location sub pext_loc in
      let attrs = sub.attributes sub pext_attributes in
      Te.constructor ~loc ~attrs
        (map_loc sub pext_name)
        (map_extension_constructor_kind sub pext_kind)

  end

  module CT = struct
    (* Type expressions for the class language *)

    let map sub {pcty_loc = loc; pcty_desc = desc; pcty_attributes = attrs} =
      let open Cty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcty_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcty_signature x -> signature ~loc ~attrs (sub.class_signature sub x)
      | Pcty_arrow (lab, t, ct) ->
          arrow ~loc ~attrs lab (sub.typ sub t) (sub.class_type sub ct)
      | Pcty_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcty_open (o, ct) ->
          open_ ~loc ~attrs (sub.open_description sub o) (sub.class_type sub ct)

    let map_field sub {pctf_desc = desc; pctf_loc = loc; pctf_attributes = attrs}
      =
      let open Ctf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pctf_inherit ct -> inherit_ ~loc ~attrs (sub.class_type sub ct)
      | Pctf_val (s, m, v, t) ->
          val_ ~loc ~attrs (map_loc sub s) m v (sub.typ sub t)
      | Pctf_method (s, p, v, t) ->
          method_ ~loc ~attrs (map_loc sub s) p v (sub.typ sub t)
      | Pctf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pctf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pctf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_signature sub {pcsig_self; pcsig_fields} =
      Csig.mk
        (sub.typ sub pcsig_self)
        (List.map (sub.class_type_field sub) pcsig_fields)
  end

  let map_functor_param sub = function
    | Unit -> Unit
    | Named (s, mt) -> Named (map_loc sub s, sub.module_type sub mt)

  module MT = struct
    (* Type expressions for the module language *)

    let map sub {pmty_desc = desc; pmty_loc = loc; pmty_attributes = attrs} =
      let open Mty in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmty_ident s -> ident ~loc ~attrs (map_loc sub s)
      | Pmty_alias s -> alias ~loc ~attrs (map_loc sub s)
      | Pmty_signature sg -> signature ~loc ~attrs (sub.signature sub sg)
      | Pmty_functor (param, mt) ->
          functor_ ~loc ~attrs
            (map_functor_param sub param)
            (sub.module_type sub mt)
      | Pmty_with (mt, l) ->
          with_ ~loc ~attrs (sub.module_type sub mt)
            (List.map (sub.with_constraint sub) l)
      | Pmty_typeof me -> typeof_ ~loc ~attrs (sub.module_expr sub me)
      | Pmty_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_with_constraint sub = function
      | Pwith_type (lid, d) ->
          Pwith_type (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_module (lid, lid2) ->
          Pwith_module (map_loc sub lid, map_loc sub lid2)
      | Pwith_typesubst (lid, d) ->
          Pwith_typesubst (map_loc sub lid, sub.type_declaration sub d)
      | Pwith_modsubst (s, lid) ->
          Pwith_modsubst (map_loc sub s, map_loc sub lid)

    let map_signature_item sub {psig_desc = desc; psig_loc = loc} =
      let open Sig in
      let loc = sub.location sub loc in
      match desc with
      | Psig_value vd -> value ~loc (sub.value_description sub vd)
      | Psig_type (rf, l) ->
          type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Psig_typesubst l ->
          type_subst ~loc (List.map (sub.type_declaration sub) l)
      | Psig_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Psig_exception ed -> exception_ ~loc (sub.type_exception sub ed)
      | Psig_module x -> module_ ~loc (sub.module_declaration sub x)
      | Psig_modsubst x -> mod_subst ~loc (sub.module_substitution sub x)
      | Psig_recmodule l ->
          rec_module ~loc (List.map (sub.module_declaration sub) l)
      | Psig_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Psig_open x -> open_ ~loc (sub.open_description sub x)
      | Psig_include x -> include_ ~loc (sub.include_description sub x)
      | Psig_class l -> class_ ~loc (List.map (sub.class_description sub) l)
      | Psig_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Psig_extension (x, attrs) ->
          let attrs = sub.attributes sub attrs in
          extension ~loc ~attrs (sub.extension sub x)
      | Psig_attribute x -> attribute ~loc (sub.attribute sub x)
  end


  module M = struct
    (* Value expressions for the module language *)

    let map sub {pmod_loc = loc; pmod_desc = desc; pmod_attributes = attrs} =
      let open Mod in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pmod_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pmod_structure str -> structure ~loc ~attrs (sub.structure sub str)
      | Pmod_functor (param, body) ->
          functor_ ~loc ~attrs
            (map_functor_param sub param)
            (sub.module_expr sub body)
      | Pmod_apply (m1, m2) ->
          apply ~loc ~attrs (sub.module_expr sub m1) (sub.module_expr sub m2)
      | Pmod_constraint (m, mty) ->
          constraint_ ~loc ~attrs (sub.module_expr sub m)
            (sub.module_type sub mty)
      | Pmod_unpack e -> unpack ~loc ~attrs (sub.expr sub e)
      | Pmod_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure_item sub {pstr_loc = loc; pstr_desc = desc} =
      let open Str in
      let loc = sub.location sub loc in
      match desc with
      | Pstr_eval (x, attrs) ->
          let attrs = sub.attributes sub attrs in
          eval ~loc ~attrs (sub.expr sub x)
      | Pstr_value (r, vbs) -> value ~loc r (List.map (sub.value_binding sub) vbs)
      | Pstr_primitive vd -> primitive ~loc (sub.value_description sub vd)
      | Pstr_type (rf, l) -> type_ ~loc rf (List.map (sub.type_declaration sub) l)
      | Pstr_typext te -> type_extension ~loc (sub.type_extension sub te)
      | Pstr_exception ed -> exception_ ~loc (sub.type_exception sub ed)
      | Pstr_module x -> module_ ~loc (sub.module_binding sub x)
      | Pstr_recmodule l -> rec_module ~loc (List.map (sub.module_binding sub) l)
      | Pstr_modtype x -> modtype ~loc (sub.module_type_declaration sub x)
      | Pstr_open x -> open_ ~loc (sub.open_declaration sub x)
      | Pstr_class l -> class_ ~loc (List.map (sub.class_declaration sub) l)
      | Pstr_class_type l ->
          class_type ~loc (List.map (sub.class_type_declaration sub) l)
      | Pstr_include x -> include_ ~loc (sub.include_declaration sub x)
      | Pstr_extension (x, attrs) ->
          let attrs = sub.attributes sub attrs in
          extension ~loc ~attrs (sub.extension sub x)
      | Pstr_attribute x -> attribute ~loc (sub.attribute sub x)
  end

  module E = struct
    (* Value expressions for the core language *)

    let map sub {pexp_loc = loc; pexp_desc = desc; pexp_attributes = attrs} =
      let open Exp in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pexp_ident x -> ident ~loc ~attrs (map_loc sub x)
      | Pexp_constant x -> constant ~loc ~attrs x
      | Pexp_let (r, vbs, e) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.expr sub e)
      | Pexp_fun (lab, def, p, e) ->
          fun_ ~loc ~attrs lab (map_opt (sub.expr sub) def) (sub.pat sub p)
            (sub.expr sub e)
      | Pexp_function pel -> function_ ~loc ~attrs (sub.cases sub pel)
      | Pexp_apply (e, l) ->
          apply ~loc ~attrs (sub.expr sub e) (List.map (map_snd (sub.expr sub)) l)
      | Pexp_match (e, pel) ->
          match_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_try (e, pel) -> try_ ~loc ~attrs (sub.expr sub e) (sub.cases sub pel)
      | Pexp_tuple el -> tuple ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_construct (lid, arg) ->
          construct ~loc ~attrs (map_loc sub lid) (map_opt (sub.expr sub) arg)
      | Pexp_variant (lab, eo) ->
          variant ~loc ~attrs lab (map_opt (sub.expr sub) eo)
      | Pexp_record (l, eo) ->
          record ~loc ~attrs (List.map (map_tuple (map_loc sub) (sub.expr sub)) l)
            (map_opt (sub.expr sub) eo)
      | Pexp_field (e, lid) ->
          field ~loc ~attrs (sub.expr sub e) (map_loc sub lid)
      | Pexp_setfield (e1, lid, e2) ->
          setfield ~loc ~attrs (sub.expr sub e1) (map_loc sub lid)
            (sub.expr sub e2)
      | Pexp_array el -> array ~loc ~attrs (List.map (sub.expr sub) el)
      | Pexp_ifthenelse (e1, e2, e3) ->
          ifthenelse ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
            (map_opt (sub.expr sub) e3)
      | Pexp_sequence (e1, e2) ->
          sequence ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_while (e1, e2) ->
          while_ ~loc ~attrs (sub.expr sub e1) (sub.expr sub e2)
      | Pexp_for (p, e1, e2, d, e3) ->
          for_ ~loc ~attrs (sub.pat sub p) (sub.expr sub e1) (sub.expr sub e2) d
            (sub.expr sub e3)
      | Pexp_coerce (e, t1, t2) ->
          coerce ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t1)
            (sub.typ sub t2)
      | Pexp_constraint (e, t) ->
          constraint_ ~loc ~attrs (sub.expr sub e) (sub.typ sub t)
      | Pexp_send (e, s) ->
          send ~loc ~attrs (sub.expr sub e) (map_loc sub s)
      | Pexp_new lid -> new_ ~loc ~attrs (map_loc sub lid)
      | Pexp_setinstvar (s, e) ->
          setinstvar ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_override sel ->
          override ~loc ~attrs
            (List.map (map_tuple (map_loc sub) (sub.expr sub)) sel)
      | Pexp_letmodule (s, me, e) ->
          letmodule ~loc ~attrs (map_loc sub s) (sub.module_expr sub me)
            (sub.expr sub e)
      | Pexp_letexception (cd, e) ->
          letexception ~loc ~attrs
            (sub.extension_constructor sub cd)
            (sub.expr sub e)
      | Pexp_assert e -> assert_ ~loc ~attrs (sub.expr sub e)
      | Pexp_lazy e -> lazy_ ~loc ~attrs (sub.expr sub e)
      | Pexp_poly (e, t) ->
          poly ~loc ~attrs (sub.expr sub e) (map_opt (sub.typ sub) t)
      | Pexp_object cls -> object_ ~loc ~attrs (sub.class_structure sub cls)
      | Pexp_newtype (s, e) ->
          newtype ~loc ~attrs (map_loc sub s) (sub.expr sub e)
      | Pexp_pack me -> pack ~loc ~attrs (sub.module_expr sub me)
      | Pexp_open (o, e) ->
          open_ ~loc ~attrs (sub.open_declaration sub o) (sub.expr sub e)
      | Pexp_letop {let_; ands; body} ->
          letop ~loc ~attrs (sub.binding_op sub let_)
            (List.map (sub.binding_op sub) ands) (sub.expr sub body)
      | Pexp_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pexp_unreachable -> unreachable ~loc ~attrs ()

    let map_binding_op sub {pbop_op; pbop_pat; pbop_exp; pbop_loc} =
      let open Exp in
      let op = map_loc sub pbop_op in
      let pat = sub.pat sub pbop_pat in
      let exp = sub.expr sub pbop_exp in
      let loc = sub.location sub pbop_loc in
      binding_op op pat exp loc

  end

  module P = struct
    (* Patterns *)

    let map sub {ppat_desc = desc; ppat_loc = loc; ppat_attributes = attrs} =
      let open Pat in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Ppat_any -> any ~loc ~attrs ()
      | Ppat_var s -> var ~loc ~attrs (map_loc sub s)
      | Ppat_alias (p, s) -> alias ~loc ~attrs (sub.pat sub p) (map_loc sub s)
      | Ppat_constant c -> constant ~loc ~attrs c
      | Ppat_interval (c1, c2) -> interval ~loc ~attrs c1 c2
      | Ppat_tuple pl -> tuple ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_construct (l, p) ->
          construct ~loc ~attrs (map_loc sub l) (map_opt (sub.pat sub) p)
      | Ppat_variant (l, p) -> variant ~loc ~attrs l (map_opt (sub.pat sub) p)
      | Ppat_record (lpl, cf) ->
          record ~loc ~attrs
            (List.map (map_tuple (map_loc sub) (sub.pat sub)) lpl) cf
      | Ppat_array pl -> array ~loc ~attrs (List.map (sub.pat sub) pl)
      | Ppat_or (p1, p2) -> or_ ~loc ~attrs (sub.pat sub p1) (sub.pat sub p2)
      | Ppat_constraint (p, t) ->
          constraint_ ~loc ~attrs (sub.pat sub p) (sub.typ sub t)
      | Ppat_type s -> type_ ~loc ~attrs (map_loc sub s)
      | Ppat_lazy p -> lazy_ ~loc ~attrs (sub.pat sub p)
      | Ppat_unpack s -> unpack ~loc ~attrs (map_loc sub s)
      | Ppat_open (lid,p) -> open_ ~loc ~attrs (map_loc sub lid) (sub.pat sub p)
      | Ppat_exception p -> exception_ ~loc ~attrs (sub.pat sub p)
      | Ppat_extension x -> extension ~loc ~attrs (sub.extension sub x)
  end

  module CE = struct
    (* Value expressions for the class language *)

    let map sub {pcl_loc = loc; pcl_desc = desc; pcl_attributes = attrs} =
      let open Cl in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcl_constr (lid, tys) ->
          constr ~loc ~attrs (map_loc sub lid) (List.map (sub.typ sub) tys)
      | Pcl_structure s ->
          structure ~loc ~attrs (sub.class_structure sub s)
      | Pcl_fun (lab, e, p, ce) ->
          fun_ ~loc ~attrs lab
            (map_opt (sub.expr sub) e)
            (sub.pat sub p)
            (sub.class_expr sub ce)
      | Pcl_apply (ce, l) ->
          apply ~loc ~attrs (sub.class_expr sub ce)
            (List.map (map_snd (sub.expr sub)) l)
      | Pcl_let (r, vbs, ce) ->
          let_ ~loc ~attrs r (List.map (sub.value_binding sub) vbs)
            (sub.class_expr sub ce)
      | Pcl_constraint (ce, ct) ->
          constraint_ ~loc ~attrs (sub.class_expr sub ce) (sub.class_type sub ct)
      | Pcl_extension x -> extension ~loc ~attrs (sub.extension sub x)
      | Pcl_open (o, ce) ->
          open_ ~loc ~attrs (sub.open_description sub o) (sub.class_expr sub ce)

    let map_kind sub = function
      | Cfk_concrete (o, e) -> Cfk_concrete (o, sub.expr sub e)
      | Cfk_virtual t -> Cfk_virtual (sub.typ sub t)

    let map_field sub {pcf_desc = desc; pcf_loc = loc; pcf_attributes = attrs} =
      let open Cf in
      let loc = sub.location sub loc in
      let attrs = sub.attributes sub attrs in
      match desc with
      | Pcf_inherit (o, ce, s) ->
          inherit_ ~loc ~attrs o (sub.class_expr sub ce)
            (map_opt (map_loc sub) s)
      | Pcf_val (s, m, k) -> val_ ~loc ~attrs (map_loc sub s) m (map_kind sub k)
      | Pcf_method (s, p, k) ->
          method_ ~loc ~attrs (map_loc sub s) p (map_kind sub k)
      | Pcf_constraint (t1, t2) ->
          constraint_ ~loc ~attrs (sub.typ sub t1) (sub.typ sub t2)
      | Pcf_initializer e -> initializer_ ~loc ~attrs (sub.expr sub e)
      | Pcf_attribute x -> attribute ~loc (sub.attribute sub x)
      | Pcf_extension x -> extension ~loc ~attrs (sub.extension sub x)

    let map_structure sub {pcstr_self; pcstr_fields} =
      {
        pcstr_self = sub.pat sub pcstr_self;
        pcstr_fields = List.map (sub.class_field sub) pcstr_fields;
      }

    let class_infos sub f {pci_virt; pci_params = pl; pci_name; pci_expr;
                           pci_loc; pci_attributes} =
      let loc = sub.location sub pci_loc in
      let attrs = sub.attributes sub pci_attributes in
      Ci.mk ~loc ~attrs
        ~virt:pci_virt
        ~params:(List.map (map_fst (sub.typ sub)) pl)
        (map_loc sub pci_name)
        (f pci_expr)
  end

  (* Now, a generic AST mapper, to be extended to cover all kinds and
     cases of the OCaml grammar.  The default behavior of the mapper is
     the identity. *)

  let default_mapper =
    {
      structure = (fun this l -> List.map (this.structure_item this) l);
      structure_item = M.map_structure_item;
      module_expr = M.map;
      signature = (fun this l -> List.map (this.signature_item this) l);
      signature_item = MT.map_signature_item;
      module_type = MT.map;
      with_constraint = MT.map_with_constraint;
      class_declaration =
        (fun this -> CE.class_infos this (this.class_expr this));
      class_expr = CE.map;
      class_field = CE.map_field;
      class_structure = CE.map_structure;
      class_type = CT.map;
      class_type_field = CT.map_field;
      class_signature = CT.map_signature;
      class_type_declaration =
        (fun this -> CE.class_infos this (this.class_type this));
      class_description =
        (fun this -> CE.class_infos this (this.class_type this));
      type_declaration = T.map_type_declaration;
      type_kind = T.map_type_kind;
      typ = T.map;
      type_extension = T.map_type_extension;
      type_exception = T.map_type_exception;
      extension_constructor = T.map_extension_constructor;
      value_description =
        (fun this {pval_name; pval_type; pval_prim; pval_loc;
                   pval_attributes} ->
          Val.mk
            (map_loc this pval_name)
            (this.typ this pval_type)
            ~attrs:(this.attributes this pval_attributes)
            ~loc:(this.location this pval_loc)
            ~prim:pval_prim
        );

      pat = P.map;
      expr = E.map;
      binding_op = E.map_binding_op;

      module_declaration =
        (fun this {pmd_name; pmd_type; pmd_attributes; pmd_loc} ->
           Md.mk
             (map_loc this pmd_name)
             (this.module_type this pmd_type)
             ~attrs:(this.attributes this pmd_attributes)
             ~loc:(this.location this pmd_loc)
        );

      module_substitution =
        (fun this {pms_name; pms_manifest; pms_attributes; pms_loc} ->
           Ms.mk
             (map_loc this pms_name)
             (map_loc this pms_manifest)
             ~attrs:(this.attributes this pms_attributes)
             ~loc:(this.location this pms_loc)
        );

      module_type_declaration =
        (fun this {pmtd_name; pmtd_type; pmtd_attributes; pmtd_loc} ->
           Mtd.mk
             (map_loc this pmtd_name)
             ?typ:(map_opt (this.module_type this) pmtd_type)
             ~attrs:(this.attributes this pmtd_attributes)
             ~loc:(this.location this pmtd_loc)
        );

      module_binding =
        (fun this {pmb_name; pmb_expr; pmb_attributes; pmb_loc} ->
           Mb.mk (map_loc this pmb_name) (this.module_expr this pmb_expr)
             ~attrs:(this.attributes this pmb_attributes)
             ~loc:(this.location this pmb_loc)
        );


      open_declaration =
        (fun this {popen_expr; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (this.module_expr this popen_expr)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );

      open_description =
        (fun this {popen_expr; popen_override; popen_attributes; popen_loc} ->
           Opn.mk (map_loc this popen_expr)
             ~override:popen_override
             ~loc:(this.location this popen_loc)
             ~attrs:(this.attributes this popen_attributes)
        );

      include_description =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_type this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );

      include_declaration =
        (fun this {pincl_mod; pincl_attributes; pincl_loc} ->
           Incl.mk (this.module_expr this pincl_mod)
             ~loc:(this.location this pincl_loc)
             ~attrs:(this.attributes this pincl_attributes)
        );


      value_binding =
        (fun this {pvb_pat; pvb_expr; pvb_attributes; pvb_loc} ->
           Vb.mk
             (this.pat this pvb_pat)
             (this.expr this pvb_expr)
             ~loc:(this.location this pvb_loc)
             ~attrs:(this.attributes this pvb_attributes)
        );


      constructor_declaration =
        (fun this {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} ->
           Type.constructor
             (map_loc this pcd_name)
             ~args:(T.map_constructor_arguments this pcd_args)
             ?res:(map_opt (this.typ this) pcd_res)
             ~loc:(this.location this pcd_loc)
             ~attrs:(this.attributes this pcd_attributes)
        );

      label_declaration =
        (fun this {pld_name; pld_type; pld_loc; pld_mutable; pld_attributes} ->
           Type.field
             (map_loc this pld_name)
             (this.typ this pld_type)
             ~mut:pld_mutable
             ~loc:(this.location this pld_loc)
             ~attrs:(this.attributes this pld_attributes)
        );

      cases = (fun this l -> List.map (this.case this) l);
      case =
        (fun this {pc_lhs; pc_guard; pc_rhs} ->
           {
             pc_lhs = this.pat this pc_lhs;
             pc_guard = map_opt (this.expr this) pc_guard;
             pc_rhs = this.expr this pc_rhs;
           }
        );



      location = (fun _this l -> l);

      extension = (fun this (s, e) -> (map_loc this s, this.payload this e));
      attribute = (fun this a ->
          {
            attr_name = map_loc this a.attr_name;
            attr_payload = this.payload this a.attr_payload;
            attr_loc = this.location this a.attr_loc
          }
        );
      attributes = (fun this l -> List.map (this.attribute this) l);
      payload =
        (fun this -> function
           | PStr x -> PStr (this.structure this x)
           | PSig x -> PSig (this.signature this x)
           | PTyp x -> PTyp (this.typ this x)
           | PPat (x, g) -> PPat (this.pat this x, map_opt (this.expr this) g)
        );
    }

  let extension_of_error (error : Locations.location_error) : extension =
    Locations.extension_of_error
      ~mk_pstr:(fun x -> PStr x)
      ~mk_extension:(fun x -> Str.extension x)
      ~mk_string_constant:(fun x -> Str.eval (Exp.constant (Pconst_string (x, None))))
      error

  let attribute_of_warning loc s =
    Attr.mk
      {loc; txt = "ocaml.ppwarning" }
      (PStr ([Str.eval ~loc (Exp.constant (Pconst_string (s, None)))]))

  include Locations.Helpers_impl

  let cookies = ref String.Map.empty

  let get_cookie k =
    try Some (String.Map.find k !cookies)
    with Not_found -> None

  let set_cookie k v =
    cookies := String.Map.add k v !cookies

  let tool_name_ref = ref "_none_"

  let tool_name () = !tool_name_ref


  module PpxContext = struct
    open Longident
    open Asttypes
    open Ast_helper

    let lid name = { txt = Lident name; loc = Location.none }

    let make_string x = Exp.constant (Pconst_string (x, None))

    let make_bool x =
      if x
      then Exp.construct (lid "true") None
      else Exp.construct (lid "false") None

    let rec make_list f lst =
      match lst with
      | x :: rest ->
          Exp.construct (lid "::") (Some (Exp.tuple [f x; make_list f rest]))
      | [] ->
          Exp.construct (lid "[]") None

    let make_pair f1 f2 (x1, x2) =
      Exp.tuple [f1 x1; f2 x2]

    let make_option f opt =
      match opt with
      | Some x -> Exp.construct (lid "Some") (Some (f x))
      | None   -> Exp.construct (lid "None") None

    let get_cookies () =
      lid "cookies",
      make_list (make_pair make_string (fun x -> x))
        (String.Map.bindings !cookies)

    let mk fields =
      {
        attr_name = { txt = "ocaml.ppx.context"; loc = Location.none };
        attr_payload = Parsetree.PStr [Str.eval (Exp.record fields None)];
        attr_loc = Location.none
      }

    let make ~tool_name () =
      let fields =
        [
          lid "tool_name",    make_string tool_name;
          lid "include_dirs", make_list make_string !Clflags.include_dirs;
          lid "load_path",    make_list make_string (Migrate_parsetree_compiler_functions.get_load_paths ());
          lid "open_modules", make_list make_string !Clflags.open_modules;
          lid "for_package",  make_option make_string !Clflags.for_package;
          lid "debug",        make_bool !Clflags.debug;
          lid "use_threads",  make_bool !Clflags.use_threads;
          lid "use_vmthreads", make_bool false;
          lid "recursive_types", make_bool !Clflags.recursive_types;
          lid "principal", make_bool !Clflags.principal;
          lid "transparent_modules", make_bool !Clflags.transparent_modules;
          lid "unboxed_types", make_bool (Migrate_parsetree_compiler_functions.get_unboxed_types ());
          lid "unsafe_string", make_bool !Clflags.unsafe_string;
          get_cookies ()
        ]
      in
      mk fields

    let get_fields = function
      | PStr [{pstr_desc = Pstr_eval
                   ({ pexp_desc = Pexp_record (fields, None) }, [])}] ->
          fields
      | _ ->
          raise_errorf "Internal error: invalid [@@@ocaml.ppx.context] syntax"

    let restore fields =
      let field name payload =
        let rec get_string = function
          | { pexp_desc = Pexp_constant (Pconst_string (str, None)) } -> str
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] string syntax" name
        and get_bool pexp =
          match pexp with
          | {pexp_desc = Pexp_construct ({txt = Longident.Lident "true"},
                                         None)} ->
              true
          | {pexp_desc = Pexp_construct ({txt = Longident.Lident "false"},
                                         None)} ->
              false
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] bool syntax" name
        and get_list elem = function
          | {pexp_desc =
               Pexp_construct ({txt = Longident.Lident "::"},
                               Some {pexp_desc = Pexp_tuple [exp; rest]}) } ->
              elem exp :: get_list elem rest
          | {pexp_desc =
               Pexp_construct ({txt = Longident.Lident "[]"}, None)} ->
              []
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] list syntax" name
        and get_pair f1 f2 = function
          | {pexp_desc = Pexp_tuple [e1; e2]} ->
              (f1 e1, f2 e2)
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] pair syntax" name
        and get_option elem = function
          | { pexp_desc =
                Pexp_construct ({ txt = Longident.Lident "Some" }, Some exp) } ->
              Some (elem exp)
          | { pexp_desc =
                Pexp_construct ({ txt = Longident.Lident "None" }, None) } ->
              None
          | _ -> raise_errorf "Internal error: invalid [@@@ocaml.ppx.context \
                               { %s }] option syntax" name
        in
        match name with
        | "tool_name" ->
            tool_name_ref := get_string payload
        | "include_dirs" ->
            Clflags.include_dirs := get_list get_string payload
        | "load_path" ->
            Migrate_parsetree_compiler_functions.load_path_init (get_list get_string payload)
        | "open_modules" ->
            Clflags.open_modules := get_list get_string payload
        | "for_package" ->
            Clflags.for_package := get_option get_string payload
        | "debug" ->
            Clflags.debug := get_bool payload
        | "use_threads" ->
            Clflags.use_threads := get_bool payload
        | "use_vmthreads" ->
            if get_bool payload then
              raise_errorf "Internal error: vmthreads not supported after 4.09.0"
        | "recursive_types" ->
            Clflags.recursive_types := get_bool payload
        | "principal" ->
            Clflags.principal := get_bool payload
        | "transparent_modules" ->
            Clflags.transparent_modules := get_bool payload
        | "unboxed_types" ->
            Migrate_parsetree_compiler_functions.set_unboxed_types (get_bool payload)
        | "unsafe_string" ->
            Clflags.unsafe_string := get_bool payload
        | "cookies" ->
            let l = get_list (get_pair get_string (fun x -> x)) payload in
            cookies :=
              List.fold_left
                (fun s (k, v) -> String.Map.add k v s) String.Map.empty
                l
        | _ ->
            ()
      in
      List.iter (function ({txt=Lident name}, x) -> field name x | _ -> ()) fields

    let update_cookies fields =
      let fields =
        List.filter
          (function ({txt=Lident "cookies"}, _) -> false | _ -> true)
          fields
      in
      fields @ [get_cookies ()]
  end

  let ppx_context = PpxContext.make

  let extension_of_exn exn = extension_of_error (Locations.location_error_of_exn exn)

  let apply_lazy ~source ~target mapper =
    let implem ast =
      let fields, ast =
        match ast with
        | {pstr_desc = Pstr_attribute ({attr_name = {txt = "ocaml.ppx.context"};
                                        attr_payload = x})} :: l ->
            PpxContext.get_fields x, l
        | _ -> [], ast
      in
      PpxContext.restore fields;
      let ast =
        try
          let mapper = mapper () in
          mapper.structure mapper ast
        with exn ->
          [{pstr_desc = Pstr_extension (extension_of_exn exn, []);
            pstr_loc  = Location.none}]
      in
      let fields = PpxContext.update_cookies fields in
      Str.attribute (PpxContext.mk fields) :: ast
    in
    let iface ast =
      let fields, ast =
        match ast with
        | {psig_desc = Psig_attribute ({attr_name = {txt = "ocaml.ppx.context"};
                                        attr_payload = x;
                                        attr_loc = _})} :: l ->
            PpxContext.get_fields x, l
        | _ -> [], ast
      in
      PpxContext.restore fields;
      let ast =
        try
          let mapper = mapper () in
          mapper.signature mapper ast
        with exn ->
          [{psig_desc = Psig_extension (extension_of_exn exn, []);
            psig_loc  = Location.none}]
      in
      let fields = PpxContext.update_cookies fields in
      Sig.attribute (PpxContext.mk fields) :: ast
    in

    let ic = open_in_bin source in
    let magic =
      really_input_string ic (String.length Config.ast_impl_magic_number)
    in

    let rewrite transform =
      Location.input_name := input_value ic;
      let ast = input_value ic in
      close_in ic;
      let ast = transform ast in
      let oc = open_out_bin target in
      output_string oc magic;
      output_value oc !Location.input_name;
      output_value oc ast;
      close_out oc
    and fail () =
      close_in ic;
      failwith "Ast_mapper: OCaml version mismatch or malformed input";
    in

    if magic = Config.ast_impl_magic_number then
      rewrite (implem : structure -> structure)
    else if magic = Config.ast_intf_magic_number then
      rewrite (iface : signature -> signature)
    else fail ()

  let drop_ppx_context_str ~restore = function
    | {pstr_desc = Pstr_attribute
           {attr_name = {Location.txt = "ocaml.ppx.context"};
            attr_payload = a;
            attr_loc = _}}
      :: items ->
        if restore then
          PpxContext.restore (PpxContext.get_fields a);
        items
    | items -> items

  let drop_ppx_context_sig ~restore = function
    | {psig_desc = Psig_attribute
           {attr_name = {Location.txt = "ocaml.ppx.context"};
            attr_payload = a;
            attr_loc = _}}
      :: items ->
        if restore then
          PpxContext.restore (PpxContext.get_fields a);
        items
    | items -> items

  let add_ppx_context_str ~tool_name ast =
    Ast_helper.Str.attribute (ppx_context ~tool_name ()) :: ast

  let add_ppx_context_sig ~tool_name ast =
    Ast_helper.Sig.attribute (ppx_context ~tool_name ()) :: ast


  let apply ~source ~target mapper =
    apply_lazy ~source ~target (fun () -> mapper)

  let run_main mapper =
    try
      let a = Sys.argv in
      let n = Array.length a in
      if n > 2 then
        let mapper () =
          try mapper (Array.to_list (Array.sub a 1 (n - 3)))
          with exn ->
            (* PR#6463 *)
            let f _ _ = raise exn in
            {default_mapper with structure = f; signature = f}
        in
        apply_lazy ~source:a.(n - 2) ~target:a.(n - 1) mapper
      else begin
        Printf.eprintf "Usage: %s [extra_args] <infile> <outfile>\n%!"
          Sys.executable_name;
        exit 2
      end
    with exn ->
      prerr_endline (Printexc.to_string exn);
      exit 2

  let register_function = ref (fun _name f -> run_main f)
  let register name f = !register_function name f
end

module Type_immediacy = struct
  type t (*IF_CURRENT = Type_immediacy.t *) =
    | Unknown
    | Always
    | Always_on_64bits
end

module Outcometree = struct
  (* Module [Outcometree]: results displayed by the toplevel *)

  (* These types represent messages that the toplevel displays as normal
     results or errors. The real displaying is customisable using the hooks:
     [Toploop.print_out_value]
     [Toploop.print_out_type]
     [Toploop.print_out_sig_item]
     [Toploop.print_out_phrase] *)

  (** An [out_name] is a string representation of an identifier which can be
      rewritten on the fly to avoid name collisions *)
  type out_name (*IF_CURRENT = Outcometree.out_name *) = { mutable printed_name: string }

  type out_ident (*IF_CURRENT = Outcometree.out_ident *) =
    | Oide_apply of out_ident * out_ident
    | Oide_dot of out_ident * string
    | Oide_ident of out_name

  type out_string (*IF_CURRENT = Outcometree.out_string *) =
    | Ostr_string
    | Ostr_bytes

  type out_attribute (*IF_CURRENT = Outcometree.out_attribute *) =
    { oattr_name: string }

  type out_value (*IF_CURRENT = Outcometree.out_value *) =
    | Oval_array of out_value list
    | Oval_char of char
    | Oval_constr of out_ident * out_value list
    | Oval_ellipsis
    | Oval_float of float
    | Oval_int of int
    | Oval_int32 of int32
    | Oval_int64 of int64
    | Oval_nativeint of nativeint
    | Oval_list of out_value list
    | Oval_printer of (Format.formatter -> unit)
    | Oval_record of (out_ident * out_value) list
    | Oval_string of string * int * out_string (* string, size-to-print, kind *)
    | Oval_stuff of string
    | Oval_tuple of out_value list
    | Oval_variant of string * out_value option

  type out_type (*IF_CURRENT = Outcometree.out_type *) =
    | Otyp_abstract
    | Otyp_open
    | Otyp_alias of out_type * string
    | Otyp_arrow of string * out_type * out_type
    | Otyp_class of bool * out_ident * out_type list
    | Otyp_constr of out_ident * out_type list
    | Otyp_manifest of out_type * out_type
    | Otyp_object of (string * out_type) list * bool option
    | Otyp_record of (string * bool * out_type) list
    | Otyp_stuff of string
    | Otyp_sum of (string * out_type list * out_type option) list
    | Otyp_tuple of out_type list
    | Otyp_var of bool * string
    | Otyp_variant of
        bool * out_variant * bool * (string list) option
    | Otyp_poly of string list * out_type
    | Otyp_module of out_ident * string list * out_type list
    | Otyp_attribute of out_type * out_attribute

  and out_variant (*IF_CURRENT = Outcometree.out_variant *) =
    | Ovar_fields of (string * bool * out_type list) list
    | Ovar_typ of out_type

  type out_class_type (*IF_CURRENT = Outcometree.out_class_type *) =
    | Octy_constr of out_ident * out_type list
    | Octy_arrow of string * out_type * out_class_type
    | Octy_signature of out_type option * out_class_sig_item list
  and out_class_sig_item (*IF_CURRENT = Outcometree.out_class_sig_item *) =
    | Ocsg_constraint of out_type * out_type
    | Ocsg_method of string * bool * bool * out_type
    | Ocsg_value of string * bool * bool * out_type

  type out_module_type (*IF_CURRENT = Outcometree.out_module_type *) =
    | Omty_abstract
    | Omty_functor of (string option * out_module_type) option * out_module_type
    | Omty_ident of out_ident
    | Omty_signature of out_sig_item list
    | Omty_alias of out_ident
  and out_sig_item (*IF_CURRENT = Outcometree.out_sig_item *) =
    | Osig_class of
        bool * string * (string * (bool * bool)) list * out_class_type *
        out_rec_status
    | Osig_class_type of
        bool * string * (string * (bool * bool)) list * out_class_type *
        out_rec_status
    | Osig_typext of out_extension_constructor * out_ext_status
    | Osig_modtype of string * out_module_type
    | Osig_module of string * out_module_type * out_rec_status
    | Osig_type of out_type_decl * out_rec_status
    | Osig_value of out_val_decl
    | Osig_ellipsis
  and out_type_decl (*IF_CURRENT = Outcometree.out_type_decl *) =
    { otype_name: string;
      otype_params: (string * (bool * bool)) list;
      otype_type: out_type;
      otype_private: Asttypes.private_flag;
      otype_immediate: Type_immediacy.t;
      otype_unboxed: bool;
      otype_cstrs: (out_type * out_type) list }
  and out_extension_constructor (*IF_CURRENT = Outcometree.out_extension_constructor *) =
    { oext_name: string;
      oext_type_name: string;
      oext_type_params: string list;
      oext_args: out_type list;
      oext_ret_type: out_type option;
      oext_private: Asttypes.private_flag }
  and out_type_extension (*IF_CURRENT = Outcometree.out_type_extension *) =
    { otyext_name: string;
      otyext_params: string list;
      otyext_constructors: (string * out_type list * out_type option) list;
      otyext_private: Asttypes.private_flag }
  and out_val_decl (*IF_CURRENT = Outcometree.out_val_decl *) =
    { oval_name: string;
      oval_type: out_type;
      oval_prims: string list;
      oval_attributes: out_attribute list }
  and out_rec_status (*IF_CURRENT = Outcometree.out_rec_status *) =
    | Orec_not
    | Orec_first
    | Orec_next
  and out_ext_status (*IF_CURRENT = Outcometree.out_ext_status *) =
    | Oext_first
    | Oext_next
    | Oext_exception

  type out_phrase (*IF_CURRENT = Outcometree.out_phrase *) =
    | Ophr_eval of out_value * out_type
    | Ophr_signature of (out_sig_item * out_value option) list
    | Ophr_exception of (exn * out_value)
end

module Config = struct
  let ast_impl_magic_number = "Caml1999M027"
  let ast_intf_magic_number = "Caml1999N027"
end

let map_signature mapper = mapper.Ast_mapper.signature mapper
let map_structure mapper = mapper.Ast_mapper.structure mapper

let shallow_identity =
  let id _ x = x in
  {
    Ast_mapper.
    structure               = id;
    structure_item          = id;
    module_expr             = id;
    signature               = id;
    signature_item          = id;
    module_type             = id;
    with_constraint         = id;
    class_declaration       = id;
    class_expr              = id;
    class_field             = id;
    class_structure         = id;
    class_type              = id;
    class_type_field        = id;
    class_signature         = id;
    class_type_declaration  = id;
    class_description       = id;
    type_declaration        = id;
    type_kind               = id;
    typ                     = id;
    type_extension          = id;
    extension_constructor   = id;
    value_description       = id;
    pat                     = id;
    expr                    = id;
    module_declaration      = id;
    module_type_declaration = id;
    module_binding          = id;
    open_description        = id;
    include_description     = id;
    include_declaration     = id;
    value_binding           = id;
    constructor_declaration = id;
    label_declaration       = id;
    cases                   = id;
    case                    = id;
    location                = id;
    extension               = id;
    attribute               = id;
    attributes              = id;
    payload                 = id;
    binding_op              = id;
    module_substitution     = id;
    open_declaration        = id;
    type_exception          = id;
  }

let failing_mapper =
  let fail _ _ =
    invalid_arg "failing_mapper: this mapper function should never get called"
  in
  {
    Ast_mapper.
    structure               = fail;
    structure_item          = fail;
    module_expr             = fail;
    signature               = fail;
    signature_item          = fail;
    module_type             = fail;
    with_constraint         = fail;
    class_declaration       = fail;
    class_expr              = fail;
    class_field             = fail;
    class_structure         = fail;
    class_type              = fail;
    class_type_field        = fail;
    class_signature         = fail;
    class_type_declaration  = fail;
    class_description       = fail;
    type_declaration        = fail;
    type_kind               = fail;
    typ                     = fail;
    type_extension          = fail;
    extension_constructor   = fail;
    value_description       = fail;
    pat                     = fail;
    expr                    = fail;
    module_declaration      = fail;
    module_type_declaration = fail;
    module_binding          = fail;
    open_description        = fail;
    include_description     = fail;
    include_declaration     = fail;
    value_binding           = fail;
    constructor_declaration = fail;
    label_declaration       = fail;
    cases                   = fail;
    case                    = fail;
    location                = fail;
    extension               = fail;
    attribute               = fail;
    attributes              = fail;
    payload                 = fail;
    binding_op              = fail;
    module_substitution     = fail;
    open_declaration        = fail;
    type_exception          = fail;
  }

let make_top_mapper ~signature ~structure =
  {failing_mapper with Ast_mapper.
                    signature = (fun _ x -> signature x);
                    structure = (fun _ x -> structure x) }

end
module Migrate_parsetree_402_403_migrate
= struct
#1 "migrate_parsetree_402_403_migrate.ml"
# 1 "src/migrate_parsetree_402_403_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module From = Ast_402
module To = Ast_403

let extract_predef_option label typ =
  let open From in
  let open Longident in
  match label, typ.Parsetree.ptyp_desc with
  | To.Asttypes.Optional _,
    From.Parsetree.Ptyp_constr (
      {Location.txt = Ldot (Lident "*predef*", "option"); _}, [d]) ->
      d
  | _ -> typ

let rec copy_expression :
  From.Parsetree.expression ->
    To.Parsetree.expression
  =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc =
        (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc =
        (copy_location pexp_loc);
      To.Parsetree.pexp_attributes =
        (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc ->
    To.Parsetree.expression_desc
  =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant
        (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc
            copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc
                   copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc
             copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc
             copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), x1)
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert
        (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy
        (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        (x0, (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack
        (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc
             copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension
        (copy_extension x0)

and copy_direction_flag :
  From.Asttypes.direction_flag ->
    To.Asttypes.direction_flag
  =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs =
        (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs =
        (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding ->
    To.Parsetree.value_binding
  =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat =
        (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc =
        (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc =
        (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc ->
    To.Parsetree.pattern_desc
  =
  function
  | From.Parsetree.Ppat_any  ->
      To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant
        (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc
            copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc
                   copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy
        (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception
        (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension
        (copy_extension x0)

and copy_core_type :
  From.Parsetree.core_type ->
    To.Parsetree.core_type
  =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc =
        (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc ->
    To.Parsetree.core_type_desc
  =
  function
  | From.Parsetree.Ptyp_any  ->
      To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 ->
      To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      let label = copy_arg_label x0 in
      To.Parsetree.Ptyp_arrow
        (label,
         copy_core_type (extract_predef_option label x1),
         copy_core_type x2)
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map
            (fun x  ->
               let (x0,x1,x2) = x  in
               (x0, (copy_attributes x1),
                 (copy_core_type x2))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option
             (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> x) x0),
          (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package
        (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension
        (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type ->
    To.Parsetree.package_type
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc
                copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field ->
    To.Parsetree.row_field
  =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        ((copy_label x0),
          (copy_attributes x1), (copy_bool x2),
          (List.map copy_core_type x3))
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit
        (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes ->
    To.Parsetree.attributes
  = fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute ->
    To.Parsetree.attribute
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr
        (copy_structure x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp
        (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure ->
    To.Parsetree.structure
  = fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item ->
    To.Parsetree.structure_item
  =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc =
        (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type x0 ->
      let recflag, types = type_declarations x0 in
      To.Parsetree.Pstr_type (recflag, types)
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute
        (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos
      copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration ->
    To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos
      copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr ->
    To.Parsetree.class_expr
  =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc =
        (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc ->
    To.Parsetree.class_expr_desc
  =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension
        (copy_extension x0)

and copy_class_structure :
  From.Parsetree.class_structure ->
    To.Parsetree.class_structure
  =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field ->
    To.Parsetree.class_field
  =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc =
        (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc ->
    To.Parsetree.class_field_desc
  =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (fun x  -> x) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute
        (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension
        (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind ->
    To.Parsetree.class_field_kind
  =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual
        (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding ->
    To.Parsetree.module_binding
  =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc =
        (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr ->
    To.Parsetree.module_expr
  =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc =
        (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc ->
    To.Parsetree.module_expr_desc
  =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure
        (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack
        (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension
        (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type ->
    To.Parsetree.module_type
  =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc =
        (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc ->
    To.Parsetree.module_type_desc
  =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature
        (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof
        (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension
        (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident
           x0)

and copy_with_constraint :
  From.Parsetree.with_constraint ->
    To.Parsetree.with_constraint
  =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc
            copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc
            copy_longident x0),
          (copy_loc
             copy_longident x1))
  | From.Parsetree.Pwith_typesubst x0 ->
      To.Parsetree.Pwith_typesubst
        (copy_type_declaration x0)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        ((copy_loc (fun x  -> x) x0),
          (copy_loc
             copy_longident x1))

and copy_signature :
  From.Parsetree.signature ->
    To.Parsetree.signature
  = fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item ->
    To.Parsetree.signature_item
  =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc =
        (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type x0 ->
      let recflag, types = type_declarations x0 in
      To.Parsetree.Psig_type (recflag, types)
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute
        (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos
      copy_class_type x

and copy_class_description :
  From.Parsetree.class_description ->
    To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos
      copy_class_type x

and copy_class_type :
  From.Parsetree.class_type ->
    To.Parsetree.class_type
  =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc =
        (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc ->
    To.Parsetree.class_type_desc
  =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      let label = copy_arg_label x0 in
      To.Parsetree.Pcty_arrow
        (label,
         copy_core_type (extract_predef_option label x1),
         copy_class_type x2)
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension
        (copy_extension x0)

and copy_class_signature :
  From.Parsetree.class_signature ->
    To.Parsetree.class_signature
  =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field
           pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field ->
    To.Parsetree.class_type_field
  =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc =
        (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit
        (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute
        (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension
        (copy_extension x0)

and copy_extension :
  From.Parsetree.extension ->
    To.Parsetree.extension
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos ->
        'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc =
          (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag ->
    To.Asttypes.virtual_flag
  =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos
      copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc =
          (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description ->
    To.Parsetree.open_description
  =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident
           popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc =
        (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag ->
    To.Asttypes.override_flag
  =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc =
        (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc =
        (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension ->
    To.Parsetree.type_extension
  =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident
           ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc =
        (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        (To.Parsetree.Pcstr_tuple (List.map copy_core_type x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident
           x0)

and copy_type_declaration :
  From.Parsetree.type_declaration ->
    To.Parsetree.type_declaration
  =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc =
        (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag ->
    To.Asttypes.private_flag
  =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind ->
    To.Parsetree.type_kind
  =
  function
  | From.Parsetree.Ptype_abstract  ->
      To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  ->
      To.Parsetree.Ptype_open

and copy_label_declaration :
  From.Parsetree.label_declaration ->
    To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc =
        (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag ->
    To.Asttypes.mutable_flag
  =
  function
  | From.Asttypes.Immutable  ->
      To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        To.Parsetree.Pcstr_tuple (List.map copy_core_type pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc =
        (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  ->
      To.Asttypes.Covariant
  | From.Asttypes.Contravariant  ->
      To.Asttypes.Contravariant
  | From.Asttypes.Invariant  ->
      To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description ->
    To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim =
        (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc =
        (copy_location pval_loc)
    }

and copy_closed_flag :
  From.Asttypes.closed_flag ->
    To.Asttypes.closed_flag
  =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label =
  fun x ->
    x

and copy_arg_label :
  From.Asttypes.label -> To.Asttypes.arg_label =
  fun x ->
    if x <> "" then
      if x.[0] = '?' then To.Asttypes.Optional (String.sub x 1 (String.length x - 1))
      else To.Asttypes.Labelled x
    else
      To.Asttypes.Nolabel



and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  ->
      To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  ->
      To.Asttypes.Recursive

and copy_constant :
  From.Asttypes.constant -> To.Parsetree.constant =
  function
  | From.Asttypes.Const_int x0 ->
      To.Parsetree.Pconst_integer (string_of_int x0, None)
  | From.Asttypes.Const_char x0 ->
      To.Parsetree.Pconst_char x0
  | From.Asttypes.Const_string (x0,x1) ->
      To.Parsetree.Pconst_string
        (x0, (copy_option (fun x  -> x) x1))
  | From.Asttypes.Const_float x0 ->
      To.Parsetree.Pconst_float (x0, None)
  | From.Asttypes.Const_int32 x0 ->
      To.Parsetree.Pconst_integer (Int32.to_string x0, Some 'l')
  | From.Asttypes.Const_int64 x0 ->
      To.Parsetree.Pconst_integer (Int64.to_string x0, Some 'L')
  | From.Asttypes.Const_nativeint x0 ->
      To.Parsetree.Pconst_integer (Nativeint.to_string x0, Some 'n')

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident :
  From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 ->
      To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun
      { From.Asttypes.txt = txt;
        From.Asttypes.loc = loc }
       ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location :
  From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

and type_declarations types =
  let is_nonrec (attr,_) = attr.To.Location.txt = "nonrec" in
  match List.map copy_type_declaration types with
  | (x :: xs)
    when List.exists is_nonrec x.To.Parsetree.ptype_attributes ->
      let ptype_attributes =
        List.filter (fun x -> not (is_nonrec x)) x.To.Parsetree.ptype_attributes
      in
      (To.Asttypes.Nonrecursive,
       {x with To.Parsetree.ptype_attributes} :: xs)
  | types -> (To.Asttypes.Recursive, types)

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value (x0,x1,x2) ->
      To.Outcometree.Osig_value { To.Outcometree.
                                  oval_name = x0;
                                  oval_type = copy_out_type x1;
                                  oval_prims = List.map (fun x -> x) x2;
                                  oval_attributes = [] }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_private_flag otype_private);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
               (copy_out_type x1))) otype_cstrs);
      To.Outcometree.otype_immediate = false;
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_private_flag oext_private)
    }

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_name (x0,x1) ->
      To.Outcometree.Ovar_name
        ((copy_out_ident x0),
          (List.map copy_out_type x1))

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string x0 -> To.Outcometree.Oval_string x0
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int x0 -> To.Parsetree.Pdir_int (string_of_int x0, None)
  | From.Parsetree.Pdir_ident x0 -> To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 -> To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_def : sig 
#1 "migrate_parsetree_def.mli"
# 1 "src/migrate_parsetree_def.mli"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(** Features which are not available in all versions of the frontend *)
type missing_feature =
    Pexp_letexception
  | Ppat_open
  | Pexp_unreachable
  | PSig
  | Pcstr_record
  | Pconst_integer
  | Pconst_float
  | Pcl_open
  | Pcty_open
  | Oinherit
  | Pwith_typesubst_longident
  | Pwith_modsubst_longident
  | Pexp_open
  | Pexp_letop
  | Psig_typesubst
  | Psig_modsubst
  | Otyp_module
  | Immediate64
  | Anonymous_let_module
  | Anonymous_unpack
  | Anonymous_module_binding
  | Anonymous_module_declaration

(** Exception thrown by migration functions when a feature is not supported. *)
exception Migration_error of missing_feature * Location.t

(** [missing_feature_description x] is a text describing the feature [x]. *)
val missing_feature_description : missing_feature -> string

(** [missing_feature_minimal_version x] is the OCaml version where x was
    introduced. *)
val missing_feature_minimal_version : missing_feature -> string

(** Turn a missing feature into a reasonable error message. *)
val migration_error_message : missing_feature -> string

end = struct
#1 "migrate_parsetree_def.ml"
# 1 "src/migrate_parsetree_def.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(** Errors that can happen when converting constructions that doesn't exist in
    older version of the AST. *)
type missing_feature =
  | Pexp_letexception
    (** 4.04 -> 4.03: local exception, let exception _ in ... *)
  | Ppat_open
    (** 4.04 -> 4.03: module open in pattern match x with M.(_) -> ... *)
  | Pexp_unreachable
    (** 4.04 -> 4.03: unreachable pattern -> . *)
  | PSig
    (** 4.03 -> 4.02: signature in attribute, [@: val x : int] *)
  | Pcstr_record
    (** 4.03 -> 4.02: inline record *)
  | Pconst_integer
    (** 4.03 -> 4.02: integer literal with invalid suffix, 1234d *)
  | Pconst_float
    (** 4.03 -> 4.02: float literal with invalid suffix, 1234.0g *)
  | Pcl_open
    (** 4.06 -> 4.05: let open M in <class-expression> *)
  | Pcty_open
    (** 4.06 -> 4.05: let open M in <class-type> *)
  | Oinherit
    (** 4.06 -> 4.05: type t = < m : int; u > *)
  | Pwith_typesubst_longident
    (** 4.06 -> 4.05: T with type X.t := ... *)
  | Pwith_modsubst_longident
    (** 4.06 -> 4.05: T with module X.Y := ... *)
  | Pexp_open
    (** 4.08 -> 4.07: open M(N).O *)
  | Pexp_letop
    (** 4.08 -> 4.07: let* x = ... *)
  | Psig_typesubst
    (** 4.08 -> 4.07: type t := ... *)
  | Psig_modsubst
    (** 4.08 -> 4.07: module M := ... *)
  | Otyp_module
    (** 4.08 -> 4.07: M(N) *)
  | Immediate64
  (** 4.10 -> 4.09: [@@immediate64] *)
  | Anonymous_let_module
  (** 4.10 -> 4.09: let module _ = ... in ... *)
  | Anonymous_unpack
  (** 4.10 -> 4.09: (module _) *)
  | Anonymous_module_binding
  (** 4.10 -> 4.09: module _ = ... *)
  | Anonymous_module_declaration
  (** 4.10 -> 4.09: module _ = struct ... end *)

exception Migration_error of missing_feature * Location.t

(** [missing_feature_description x] is a text describing the feature [x]. *)
let missing_feature_description = function
  | Pexp_letexception -> "local exceptions"
  | Ppat_open         -> "module open in patterns"
  | Pexp_unreachable  -> "unreachable patterns"
  | PSig              -> "signatures in attribute"
  | Pcstr_record      -> "inline records"
  | Pconst_integer    -> "custom integer literals"
  | Pconst_float      -> "custom float literals"
  | Pcl_open          -> "module open in class expression"
  | Pcty_open         -> "module open in class type"
  | Oinherit          -> "inheritance in object type"
  | Pwith_typesubst_longident -> "type substitution inside a submodule"
  | Pwith_modsubst_longident  -> "module substitution inside a submodule"
  | Pexp_open -> "complex open"
  | Pexp_letop -> "let operators"
  | Psig_typesubst -> "type substitution in signatures"
  | Psig_modsubst -> "module substitution in signatures"
  | Otyp_module -> "complex outcome module"
  | Immediate64 -> "[@@immediate64] attribute"
  | Anonymous_let_module -> "anonymous let module"
  | Anonymous_unpack -> "anynymous unpack"
  | Anonymous_module_binding -> "anonymous module binding"
  | Anonymous_module_declaration -> "anonymous module declaration"

(** [missing_feature_minimal_version x] is the OCaml version where x was
    introduced. *)
let missing_feature_minimal_version = function
  | Pexp_letexception -> "OCaml 4.04"
  | Ppat_open         -> "OCaml 4.04"
  | Pexp_unreachable  -> "OCaml 4.03"
  | PSig              -> "OCaml 4.03"
  | Pcstr_record      -> "OCaml 4.03"
  | Pconst_integer    -> "OCaml 4.03"
  | Pconst_float      -> "OCaml 4.03"
  | Pcl_open          -> "OCaml 4.06"
  | Pcty_open         -> "OCaml 4.06"
  | Oinherit          -> "OCaml 4.06"
  | Pwith_typesubst_longident -> "OCaml 4.06"
  | Pwith_modsubst_longident  -> "OCaml 4.06"
  | Pexp_open -> "OCaml 4.08"
  | Pexp_letop -> "OCaml 4.08"
  | Psig_typesubst -> "OCaml 4.08"
  | Psig_modsubst -> "OCaml 4.08"
  | Otyp_module -> "OCaml 4.08"
  | Immediate64 -> "OCaml 4.10"
  | Anonymous_let_module -> "OCaml 4.10"
  | Anonymous_unpack -> "OCaml 4.10"
  | Anonymous_module_binding -> "OCaml 4.10"
  | Anonymous_module_declaration -> "OCaml 4.10"

(** Turn a missing feature into a reasonable error message. *)
let migration_error_message x =
  let feature = missing_feature_description x in
  let version = missing_feature_minimal_version x in
  feature ^ " are not supported before " ^ version

let () =
  let location_prefix l =
    if l = Location.none then "" else
      let {Location.loc_start; loc_end; _} = l in
      let bol = loc_start.Lexing.pos_bol in
      Printf.sprintf "File %S, line %d, characters %d-%d: "
        loc_start.Lexing.pos_fname
        loc_start.Lexing.pos_lnum
        (loc_start.Lexing.pos_cnum - bol)
        (loc_end.Lexing.pos_cnum - bol)
  in
  Printexc.register_printer (function
      | Migration_error (err, loc) ->
          Some (location_prefix loc ^ migration_error_message err)
      | _ -> None
    )

end
module Migrate_parsetree_403_402_migrate
= struct
#1 "migrate_parsetree_403_402_migrate.ml"
# 1 "src/migrate_parsetree_403_402_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module Def = Migrate_parsetree_def
module From = Ast_403
module To = Ast_402

let inject_predef_option label d =
  let open To in
  let open Parsetree in
  match label with
  | From.Asttypes.Optional _ ->
    let loc = {d.ptyp_loc with Location.loc_ghost = true} in
    let txt = Longident.Ldot (Longident.Lident "*predef*", "option") in
    let ident = {Location. txt; loc} in
    { ptyp_desc = Ptyp_constr(ident,[d]); ptyp_loc = loc; ptyp_attributes = []}
  | _ -> d

let from_loc {From.Location. txt = _; loc} = loc

let migration_error location feature =
  raise (Def.Migration_error (feature, location))

let rec copy_expression :
  From.Parsetree.expression ->
    To.Parsetree.expression
  =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc =
        (copy_expression_desc pexp_loc pexp_desc);
      To.Parsetree.pexp_loc =
        (copy_location pexp_loc);
      To.Parsetree.pexp_attributes =
        (copy_attributes pexp_attributes)
    }

and copy_expression_desc loc :
  From.Parsetree.expression_desc ->
    To.Parsetree.expression_desc
  =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant
        (copy_constant loc x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc
            copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc
                   copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc
             copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc
             copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), x1)
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert
        (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy
        (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        (x0, (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack
        (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc
             copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension
        (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  ->
      migration_error loc Def.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag ->
    To.Asttypes.direction_flag
  =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs =
        (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs =
        (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding ->
    To.Parsetree.value_binding
  =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat =
        (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc =
        (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_loc ppat_desc);
      To.Parsetree.ppat_loc =
        (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc loc :
  From.Parsetree.pattern_desc ->
    To.Parsetree.pattern_desc
  =
  function
  | From.Parsetree.Ppat_any  ->
      To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant
        (copy_constant loc x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant loc x0),
          (copy_constant loc x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc
            copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc
                   copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy
        (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception
        (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension
        (copy_extension x0)

and copy_core_type :
  From.Parsetree.core_type ->
    To.Parsetree.core_type
  =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc =
        (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc ->
    To.Parsetree.core_type_desc
  =
  function
  | From.Parsetree.Ptyp_any  ->
      To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 ->
      To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          inject_predef_option x0 (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map
            (fun x  ->
               let (x0,x1,x2) = x  in
               (x0, (copy_attributes x1),
                 (copy_core_type x2))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option
             (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> x) x0),
          (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package
        (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension
        (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type ->
    To.Parsetree.package_type
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc
                copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field ->
    To.Parsetree.row_field
  =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        ((copy_label x0),
          (copy_attributes x1), (copy_bool x2),
          (List.map copy_core_type x3))
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit
        (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes ->
    To.Parsetree.attributes
  = fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute ->
    To.Parsetree.attribute
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload (from_loc x0) x1))

and copy_payload loc :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr
        (copy_structure x0)
  | From.Parsetree.PSig _x0 ->
      migration_error loc Def.PSig
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp
        (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure ->
    To.Parsetree.structure
  = fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item ->
    To.Parsetree.structure_item
  =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc =
        (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type (type_declarations x0 x1)
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute
        (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos
      copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration ->
    To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos
      copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr ->
    To.Parsetree.class_expr
  =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc =
        (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc ->
    To.Parsetree.class_expr_desc
  =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension
        (copy_extension x0)

and copy_class_structure :
  From.Parsetree.class_structure ->
    To.Parsetree.class_structure
  =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field ->
    To.Parsetree.class_field
  =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc =
        (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc ->
    To.Parsetree.class_field_desc
  =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (fun x  -> x) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute
        (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension
        (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind ->
    To.Parsetree.class_field_kind
  =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual
        (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding ->
    To.Parsetree.module_binding
  =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc =
        (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr ->
    To.Parsetree.module_expr
  =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc =
        (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc ->
    To.Parsetree.module_expr_desc
  =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure
        (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack
        (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension
        (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type ->
    To.Parsetree.module_type
  =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc =
        (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc ->
    To.Parsetree.module_type_desc
  =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature
        (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof
        (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension
        (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident
           x0)

and copy_with_constraint :
  From.Parsetree.with_constraint ->
    To.Parsetree.with_constraint
  =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc
            copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc
            copy_longident x0),
          (copy_loc
             copy_longident x1))
  | From.Parsetree.Pwith_typesubst x0 ->
      To.Parsetree.Pwith_typesubst
        (copy_type_declaration x0)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        ((copy_loc (fun x  -> x) x0),
          (copy_loc
             copy_longident x1))

and copy_signature :
  From.Parsetree.signature ->
    To.Parsetree.signature
  = fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item ->
    To.Parsetree.signature_item
  =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc =
        (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type (type_declarations x0 x1)
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute
        (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos
      copy_class_type x

and copy_class_description :
  From.Parsetree.class_description ->
    To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos
      copy_class_type x

and copy_class_type :
  From.Parsetree.class_type ->
    To.Parsetree.class_type
  =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc =
        (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc ->
    To.Parsetree.class_type_desc
  =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          inject_predef_option x0 (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension
        (copy_extension x0)

and copy_class_signature :
  From.Parsetree.class_signature ->
    To.Parsetree.class_signature
  =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field
           pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field ->
    To.Parsetree.class_type_field
  =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc =
        (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit
        (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute
        (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension
        (copy_extension x0)

and copy_extension :
  From.Parsetree.extension ->
    To.Parsetree.extension
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload (from_loc x0) x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos ->
        'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc =
          (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag ->
    To.Asttypes.virtual_flag
  =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos
      copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc =
          (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description ->
    To.Parsetree.open_description
  =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident
           popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc =
        (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag ->
    To.Asttypes.override_flag
  =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc =
        (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc =
        (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension ->
    To.Parsetree.type_extension
  =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident
           ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind (from_loc pext_name) pext_kind);
      To.Parsetree.pext_loc =
        (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind loc :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments loc x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident
           x0)

and copy_type_declaration :
  From.Parsetree.type_declaration ->
    To.Parsetree.type_declaration
  =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc =
        (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag ->
    To.Asttypes.private_flag
  =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind ->
    To.Parsetree.type_kind
  =
  function
  | From.Parsetree.Ptype_abstract  ->
      To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  ->
      To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments (from_loc pcd_name) pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc =
        (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments loc :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.core_type list
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      List.map copy_core_type x0
  | From.Parsetree.Pcstr_record _x0 ->
      migration_error loc Def.Pcstr_record

and copy_label_declaration :
  From.Parsetree.label_declaration ->
    To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc =
        (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag ->
    To.Asttypes.mutable_flag
  =
  function
  | From.Asttypes.Immutable  ->
      To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  ->
      To.Asttypes.Covariant
  | From.Asttypes.Contravariant  ->
      To.Asttypes.Contravariant
  | From.Asttypes.Invariant  ->
      To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description ->
    To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim =
        (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc =
        (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> string
  =
  function
  | From.Asttypes.Nolabel  -> ""
  | From.Asttypes.Labelled x0 -> x0
  | From.Asttypes.Optional x0 -> "?" ^ x0

and copy_closed_flag :
  From.Asttypes.closed_flag ->
    To.Asttypes.closed_flag
  =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label =
  fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  ->
      To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  ->
      To.Asttypes.Recursive

and copy_constant loc :
  From.Parsetree.constant -> To.Asttypes.constant
  =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
     begin match x1 with
     | None -> To.Asttypes.Const_int (int_of_string x0)
     | Some 'l' ->
         To.Asttypes.Const_int32 (Int32.of_string x0)
     | Some 'L' ->
         To.Asttypes.Const_int64 (Int64.of_string x0)
     | Some 'n' ->
         To.Asttypes.Const_nativeint (Nativeint.of_string x0)
     | Some _ -> migration_error loc Def.Pconst_integer
     end
  | From.Parsetree.Pconst_char x0 ->
      To.Asttypes.Const_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Asttypes.Const_string (x0,x1)
  | From.Parsetree.Pconst_float (x0,x1) ->
      begin match x1 with
      | None -> To.Asttypes.Const_float x0
      | Some _ -> migration_error loc Def.Pconst_float
      end

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t = function
  | From.Longident.Lident x0 ->
      To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot
        ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun
      { From.Asttypes.txt = txt;
        From.Asttypes.loc = loc }
       ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = copy_location loc
      }

and copy_location :
  From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

and type_declarations recflag types =
  match
    (recflag, List.map copy_type_declaration types)
  with
  | From.Asttypes.Recursive, types -> types
  | From.Asttypes.Nonrecursive, [] -> []
  | From.Asttypes.Nonrecursive, (x :: xs) ->
      let pos = {Lexing. pos_fname = "_none_"; pos_lnum = 1;
                 pos_bol = 0; pos_cnum = -1} in
      let loc = {To.Location. loc_start = pos; loc_end = pos;
                 loc_ghost = true} in
      let ptype_attributes =
        ({To.Asttypes.txt = "nonrec"; loc}, To.Parsetree.PStr []) ::
        x.To.Parsetree.ptype_attributes
      in
      {x with To.Parsetree.ptype_attributes} :: xs

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 -> copy_out_val_decl x0
  | From.Outcometree.Osig_ellipsis ->
      To.Outcometree.Osig_value ("...", To.Outcometree.Otyp_abstract, [])

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_sig_item =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = _ }
     ->
       To.Outcometree.Osig_value (
         oval_name,
         copy_out_type oval_type,
         List.map (fun x  -> x) oval_prims
       )

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = _;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      (*To.Outcometree.otype_immediate = (copy_bool otype_immediate);*)
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (_x0,_x1) ->
      To.Outcometree.Otyp_abstract
      (*To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))*)

(*and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }*)

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_name (x0,x1) ->
      To.Outcometree.Ovar_name
        ((copy_out_ident x0),
          (List.map copy_out_type x1))

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string x0 -> To.Outcometree.Oval_string x0
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument ->
    To.Parsetree.directive_argument
  =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,_x1) ->
      To.Parsetree.Pdir_int (int_of_string x0)
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_402_403
= struct
#1 "migrate_parsetree_402_403.ml"
# 1 "src/migrate_parsetree_402_403.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_402_403_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     (*$*)
     payload
   } as mapper) ->
  let module R = Migrate_parsetree_403_402_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    (*$*)
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload Location.none x)))
  }

end
module Migrate_parsetree_403_402
= struct
#1 "migrate_parsetree_403_402.ml"
# 1 "src/migrate_parsetree_403_402.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_403_402_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     (*$*)
     payload
   } as mapper) ->
  let module R = Migrate_parsetree_402_403_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    (*$*)
    payload = (fun _ x -> copy_payload Location.none (payload mapper (R.copy_payload x)))
  }

end
module Migrate_parsetree_403_404_migrate
= struct
#1 "migrate_parsetree_403_404_migrate.ml"
# 1 "src/migrate_parsetree_403_404_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module From = Ast_403
module To = Ast_404

let rec copy_expression :
  From.Parsetree.expression ->
    To.Parsetree.expression
  =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc =
        (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc =
        (copy_location pexp_loc);
      To.Parsetree.pexp_attributes =
        (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc ->
    To.Parsetree.expression_desc
  =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant
        (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc
            copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc
                   copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc
             copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc
             copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), x1)
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert
        (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy
        (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        (x0, (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack
        (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc
             copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension
        (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  ->
      To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag ->
    To.Asttypes.direction_flag
  =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs =
        (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs =
        (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding ->
    To.Parsetree.value_binding
  =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat =
        (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc =
        (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc =
        (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc ->
    To.Parsetree.pattern_desc
  =
  function
  | From.Parsetree.Ppat_any  ->
      To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant
        (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc
            copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc
                   copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy
        (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception
        (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension
        (copy_extension x0)

and copy_core_type :
  From.Parsetree.core_type ->
    To.Parsetree.core_type
  =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc =
        (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc ->
    To.Parsetree.core_type_desc
  =
  function
  | From.Parsetree.Ptyp_any  ->
      To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 ->
      To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map
            (fun x  ->
               let (x0,x1,x2) = x  in
               (x0, (copy_attributes x1),
                 (copy_core_type x2))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option
             (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> x) x0),
          (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package
        (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension
        (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type ->
    To.Parsetree.package_type
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc
                copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field ->
    To.Parsetree.row_field
  =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        ((copy_label x0),
          (copy_attributes x1), (copy_bool x2),
          (List.map copy_core_type x3))
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit
        (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes ->
    To.Parsetree.attributes
  = fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute ->
    To.Parsetree.attribute
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr
        (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig
        (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp
        (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure ->
    To.Parsetree.structure
  = fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item ->
    To.Parsetree.structure_item
  =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc =
        (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute
        (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos
      copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration ->
    To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos
      copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr ->
    To.Parsetree.class_expr
  =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc =
        (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc ->
    To.Parsetree.class_expr_desc
  =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension
        (copy_extension x0)

and copy_class_structure :
  From.Parsetree.class_structure ->
    To.Parsetree.class_structure
  =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field ->
    To.Parsetree.class_field
  =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc =
        (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc ->
    To.Parsetree.class_field_desc
  =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (fun x  -> x) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute
        (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension
        (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind ->
    To.Parsetree.class_field_kind
  =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual
        (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding ->
    To.Parsetree.module_binding
  =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc =
        (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr ->
    To.Parsetree.module_expr
  =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc =
        (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc ->
    To.Parsetree.module_expr_desc
  =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure
        (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack
        (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension
        (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type ->
    To.Parsetree.module_type
  =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc =
        (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc ->
    To.Parsetree.module_type_desc
  =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature
        (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof
        (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension
        (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident
           x0)

and copy_with_constraint :
  From.Parsetree.with_constraint ->
    To.Parsetree.with_constraint
  =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc
            copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc
            copy_longident x0),
          (copy_loc
             copy_longident x1))
  | From.Parsetree.Pwith_typesubst x0 ->
      To.Parsetree.Pwith_typesubst
        (copy_type_declaration x0)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        ((copy_loc (fun x  -> x) x0),
          (copy_loc
             copy_longident x1))

and copy_signature :
  From.Parsetree.signature ->
    To.Parsetree.signature
  = fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item ->
    To.Parsetree.signature_item
  =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc =
        (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute
        (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos
      copy_class_type x

and copy_class_description :
  From.Parsetree.class_description ->
    To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos
      copy_class_type x

and copy_class_type :
  From.Parsetree.class_type ->
    To.Parsetree.class_type
  =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc =
        (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc ->
    To.Parsetree.class_type_desc
  =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension
        (copy_extension x0)

and copy_class_signature :
  From.Parsetree.class_signature ->
    To.Parsetree.class_signature
  =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field
           pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field ->
    To.Parsetree.class_type_field
  =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc =
        (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit
        (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute
        (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension
        (copy_extension x0)

and copy_extension :
  From.Parsetree.extension ->
    To.Parsetree.extension
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos ->
        'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc =
          (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag ->
    To.Asttypes.virtual_flag
  =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos
      copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc =
          (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description ->
    To.Parsetree.open_description
  =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident
           popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc =
        (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag ->
    To.Asttypes.override_flag
  =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc =
        (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc =
        (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension ->
    To.Parsetree.type_extension
  =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident
           ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc =
        (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident
           x0)

and copy_type_declaration :
  From.Parsetree.type_declaration ->
    To.Parsetree.type_declaration
  =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc =
        (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag ->
    To.Asttypes.private_flag
  =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind ->
    To.Parsetree.type_kind
  =
  function
  | From.Parsetree.Ptype_abstract  ->
      To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  ->
      To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc =
        (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration ->
    To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc =
        (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag ->
    To.Asttypes.mutable_flag
  =
  function
  | From.Asttypes.Immutable  ->
      To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  ->
      To.Asttypes.Covariant
  | From.Asttypes.Contravariant  ->
      To.Asttypes.Contravariant
  | From.Asttypes.Invariant  ->
      To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description ->
    To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim =
        (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc =
        (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label
  =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 ->
      To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 ->
      To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag ->
    To.Asttypes.closed_flag
  =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label =
  fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  ->
      To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  ->
      To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant
  =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer
        (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 ->
      To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string
        (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float
        (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident :
  From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 ->
      To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot
        ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun
      { From.Asttypes.txt = txt;
        From.Asttypes.loc = loc }
       ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location :
  From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = false;
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_name (x0,x1) ->
      To.Outcometree.Ovar_name
        ((copy_out_ident x0),
          (List.map copy_out_type x1))

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string x0 -> To.Outcometree.Oval_string x0
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply ((copy_out_ident x0), (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir (x0, copy_directive_argument x1)

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, copy_option (fun x  -> x) x1)
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_404_403_migrate
= struct
#1 "migrate_parsetree_404_403_migrate.ml"
# 1 "src/migrate_parsetree_404_403_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module Def = Migrate_parsetree_def
module From = Ast_404
module To = Ast_403

let from_loc {From.Location. txt = _; loc} = loc

let migration_error location feature =
  raise (Def.Migration_error (feature, location))

let rec copy_expression :
  From.Parsetree.expression ->
    To.Parsetree.expression
  =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc =
        (copy_expression_desc pexp_loc pexp_desc);
      To.Parsetree.pexp_loc =
        (copy_location pexp_loc);
      To.Parsetree.pexp_attributes =
        (copy_attributes pexp_attributes)
    }

and copy_expression_desc loc :
  From.Parsetree.expression_desc ->
    To.Parsetree.expression_desc
  =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant
        (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc
            copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc
                   copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc
             copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc
             copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), x1)
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception _ ->
      migration_error loc Def.Pexp_letexception
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert
        (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy
        (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        (x0, (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack
        (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc
             copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension
        (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  ->
      To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag ->
    To.Asttypes.direction_flag
  =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs =
        (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs =
        (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding ->
    To.Parsetree.value_binding
  =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat =
        (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc =
        (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_loc ppat_desc);
      To.Parsetree.ppat_loc =
        (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc loc :
  From.Parsetree.pattern_desc ->
    To.Parsetree.pattern_desc
  =
  function
  | From.Parsetree.Ppat_any  ->
      To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant
        (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc
            copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc
                   copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy
        (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception
        (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension
        (copy_extension x0)
  | From.Parsetree.Ppat_open _ ->
      migration_error loc Def.Ppat_open
and copy_core_type :
  From.Parsetree.core_type ->
    To.Parsetree.core_type
  =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc =
        (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc ->
    To.Parsetree.core_type_desc
  =
  function
  | From.Parsetree.Ptyp_any  ->
      To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 ->
      To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map
            (fun x  ->
               let (x0,x1,x2) = x  in
               (x0, (copy_attributes x1),
                 (copy_core_type x2))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option
             (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> x) x0),
          (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package
        (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension
        (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type ->
    To.Parsetree.package_type
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc
                copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field ->
    To.Parsetree.row_field
  =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        ((copy_label x0),
          (copy_attributes x1), (copy_bool x2),
          (List.map copy_core_type x3))
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit
        (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes ->
    To.Parsetree.attributes
  = fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute ->
    To.Parsetree.attribute
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr
        (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig
        (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp
        (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure ->
    To.Parsetree.structure
  = fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item ->
    To.Parsetree.structure_item
  =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc =
        (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute
        (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos
      copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration ->
    To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos
      copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr ->
    To.Parsetree.class_expr
  =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc =
        (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc ->
    To.Parsetree.class_expr_desc
  =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension
        (copy_extension x0)

and copy_class_structure :
  From.Parsetree.class_structure ->
    To.Parsetree.class_structure
  =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field ->
    To.Parsetree.class_field
  =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc =
        (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc ->
    To.Parsetree.class_field_desc
  =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (fun x  -> x) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute
        (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension
        (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind ->
    To.Parsetree.class_field_kind
  =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual
        (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding ->
    To.Parsetree.module_binding
  =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc =
        (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr ->
    To.Parsetree.module_expr
  =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc =
        (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc ->
    To.Parsetree.module_expr_desc
  =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure
        (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack
        (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension
        (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type ->
    To.Parsetree.module_type
  =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc =
        (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc ->
    To.Parsetree.module_type_desc
  =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident
           x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature
        (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof
        (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension
        (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident
           x0)

and copy_with_constraint :
  From.Parsetree.with_constraint ->
    To.Parsetree.with_constraint
  =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc
            copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc
            copy_longident x0),
          (copy_loc
             copy_longident x1))
  | From.Parsetree.Pwith_typesubst x0 ->
      To.Parsetree.Pwith_typesubst
        (copy_type_declaration x0)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        ((copy_loc (fun x  -> x) x0),
          (copy_loc
             copy_longident x1))

and copy_signature :
  From.Parsetree.signature ->
    To.Parsetree.signature
  = fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item ->
    To.Parsetree.signature_item
  =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc =
        (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute
        (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos
      copy_class_type x

and copy_class_description :
  From.Parsetree.class_description ->
    To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos
      copy_class_type x

and copy_class_type :
  From.Parsetree.class_type ->
    To.Parsetree.class_type
  =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc =
        (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc ->
    To.Parsetree.class_type_desc
  =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc
            copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension
        (copy_extension x0)

and copy_class_signature :
  From.Parsetree.class_signature ->
    To.Parsetree.class_signature
  =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field
           pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field ->
    To.Parsetree.class_type_field
  =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc =
        (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit
        (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute
        (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension
        (copy_extension x0)

and copy_extension :
  From.Parsetree.extension ->
    To.Parsetree.extension
  =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos ->
        'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc =
          (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag ->
    To.Asttypes.virtual_flag
  =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos
      copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc =
          (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description ->
    To.Parsetree.open_description
  =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident
           popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc =
        (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag ->
    To.Asttypes.override_flag
  =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc =
        (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc =
        (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension ->
    To.Parsetree.type_extension
  =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident
           ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc =
        (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident
           x0)

and copy_type_declaration :
  From.Parsetree.type_declaration ->
    To.Parsetree.type_declaration
  =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc =
        (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag ->
    To.Asttypes.private_flag
  =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind ->
    To.Parsetree.type_kind
  =
  function
  | From.Parsetree.Ptype_abstract  ->
      To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  ->
      To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc =
        (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration ->
    To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc =
        (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag ->
    To.Asttypes.mutable_flag
  =
  function
  | From.Asttypes.Immutable  ->
      To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  ->
      To.Asttypes.Covariant
  | From.Asttypes.Contravariant  ->
      To.Asttypes.Contravariant
  | From.Asttypes.Invariant  ->
      To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description ->
    To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim =
        (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc =
        (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label
  =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 ->
      To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 ->
      To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag ->
    To.Asttypes.closed_flag
  =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label =
  fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  ->
      To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  ->
      To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant
  =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer
        (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 ->
      To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string
        (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float
        (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident :
  From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 ->
      To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot
        ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun
      { From.Asttypes.txt = txt;
        From.Asttypes.loc = loc }
       ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location :
  From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = _otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_name (x0,x1) ->
      To.Outcometree.Ovar_name
        ((copy_out_ident x0),
          (List.map copy_out_type x1))

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string x0 -> To.Outcometree.Oval_string x0
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply ((copy_out_ident x0), (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_403_404
= struct
#1 "migrate_parsetree_403_404.ml"
# 1 "src/migrate_parsetree_403_404.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_403_404_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module R = Migrate_parsetree_404_403_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_404_403
= struct
#1 "migrate_parsetree_404_403.ml"
# 1 "src/migrate_parsetree_404_403.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_404_403_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module R = Migrate_parsetree_403_404_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_404_405_migrate
= struct
#1 "migrate_parsetree_404_405_migrate.ml"
# 1 "src/migrate_parsetree_404_405_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module From = Ast_404
module To = Ast_405

let noloc x = { Location. txt = x; loc = Location.none }

let rec copy_expression :
  From.Parsetree.expression -> To.Parsetree.expression =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc = (copy_location pexp_loc);
      To.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc -> To.Parsetree.expression_desc =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), noloc x1)
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception (x0,x1) ->
      To.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        (noloc x0, (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  -> To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag -> To.Asttypes.direction_flag =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding -> To.Parsetree.value_binding =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc = (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc = (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc -> To.Parsetree.pattern_desc =
  function
  | From.Parsetree.Ppat_any  -> To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension (copy_extension x0)
  | From.Parsetree.Ppat_open (x0,x1) ->
      To.Parsetree.Ppat_open
        ((copy_loc copy_longident x0),
          (copy_pattern x1))

and copy_core_type :
  From.Parsetree.core_type -> To.Parsetree.core_type =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc -> To.Parsetree.core_type_desc =
  function
  | From.Parsetree.Ptyp_any  -> To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 -> To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map
            (fun x  ->
               let (x0,x1,x2) = x  in
               (noloc x0, (copy_attributes x1),
                 (copy_core_type x2))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> noloc x) x0), (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type -> To.Parsetree.package_type =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field -> To.Parsetree.row_field =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        ((copy_label x0),
          (copy_attributes x1), (copy_bool x2),
          (List.map copy_core_type x3))
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes -> To.Parsetree.attributes =
  fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute -> To.Parsetree.attribute =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure -> To.Parsetree.structure =
  fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item -> To.Parsetree.structure_item =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc = (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration -> To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr -> To.Parsetree.class_expr =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc = (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc -> To.Parsetree.class_expr_desc =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension (copy_extension x0)

and copy_class_structure :
  From.Parsetree.class_structure -> To.Parsetree.class_structure =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field -> To.Parsetree.class_field =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc = (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc -> To.Parsetree.class_field_desc =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (fun x  -> noloc x) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind -> To.Parsetree.class_field_kind =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding -> To.Parsetree.module_binding =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc = (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr -> To.Parsetree.module_expr =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc = (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc -> To.Parsetree.module_expr_desc =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type -> To.Parsetree.module_type =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc = (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc -> To.Parsetree.module_type_desc =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident x0)

and copy_with_constraint :
  From.Parsetree.with_constraint -> To.Parsetree.with_constraint =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst x0 ->
      To.Parsetree.Pwith_typesubst
        (copy_type_declaration x0)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        ((copy_loc (fun x  -> x) x0),
          (copy_loc copy_longident x1))

and copy_signature :
  From.Parsetree.signature -> To.Parsetree.signature =
  fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item -> To.Parsetree.signature_item =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc = (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_description :
  From.Parsetree.class_description -> To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_type :
  From.Parsetree.class_type -> To.Parsetree.class_type =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc = (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc -> To.Parsetree.class_type_desc =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension (copy_extension x0)

and copy_class_signature :
  From.Parsetree.class_signature -> To.Parsetree.class_signature =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field -> To.Parsetree.class_type_field =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc = (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (noloc x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (noloc x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension (copy_extension x0)

and copy_extension :
  From.Parsetree.extension -> To.Parsetree.extension =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos -> 'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc = (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag -> To.Asttypes.virtual_flag =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc = (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description -> To.Parsetree.open_description =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc = (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag -> To.Asttypes.override_flag =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc = (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension -> To.Parsetree.type_extension =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc = (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident x0)

and copy_type_declaration :
  From.Parsetree.type_declaration -> To.Parsetree.type_declaration =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc = (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind -> To.Parsetree.type_kind =
  function
  | From.Parsetree.Ptype_abstract  -> To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  -> To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc = (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration -> To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc = (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag -> To.Asttypes.mutable_flag =
  function
  | From.Asttypes.Immutable  -> To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  -> To.Asttypes.Covariant
  | From.Asttypes.Contravariant  -> To.Asttypes.Contravariant
  | From.Asttypes.Invariant  -> To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description -> To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim = (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc = (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 -> To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 -> To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag -> To.Asttypes.closed_flag =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label = fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  -> To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  -> To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 -> To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 -> To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun { From.Asttypes.txt = txt; From.Asttypes.loc = loc }  ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location : From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = (copy_bool otype_unboxed);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_name (x0,x1) ->
      To.Outcometree.Ovar_typ
        (To.Outcometree.Otyp_constr
           ((copy_out_ident x0),
            (List.map copy_out_type x1)))

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string x0 -> To.Outcometree.Oval_string x0
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_405_404_migrate
= struct
#1 "migrate_parsetree_405_404_migrate.ml"
# 1 "src/migrate_parsetree_405_404_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module From = Ast_405
module To = Ast_404

let rec copy_expression :
  From.Parsetree.expression -> To.Parsetree.expression =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc =
        (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc = (copy_location pexp_loc);
      To.Parsetree.pexp_attributes =
        (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc -> To.Parsetree.expression_desc =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), x1.From.Asttypes.txt)
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception (x0,x1) ->
      To.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        (x0.From.Asttypes.txt, (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  -> To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag -> To.Asttypes.direction_flag =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding -> To.Parsetree.value_binding =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc = (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc = (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc -> To.Parsetree.pattern_desc =
  function
  | From.Parsetree.Ppat_any  -> To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension (copy_extension x0)
  | From.Parsetree.Ppat_open (x0,x1) ->
      To.Parsetree.Ppat_open
        ((copy_loc copy_longident x0),
          (copy_pattern x1))

and copy_core_type :
  From.Parsetree.core_type -> To.Parsetree.core_type =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc -> To.Parsetree.core_type_desc =
  function
  | From.Parsetree.Ptyp_any  -> To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 -> To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map
            (fun x  ->
               let (x0,x1,x2) = x  in
               (x0.From.Asttypes.txt, (copy_attributes x1),
                 (copy_core_type x2))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> x.From.Asttypes.txt) x0), (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type -> To.Parsetree.package_type =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field -> To.Parsetree.row_field =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        ((copy_label x0),
          (copy_attributes x1), (copy_bool x2),
          (List.map copy_core_type x3))
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes -> To.Parsetree.attributes =
  fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute -> To.Parsetree.attribute =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure -> To.Parsetree.structure =
  fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item -> To.Parsetree.structure_item =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc = (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration -> To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr -> To.Parsetree.class_expr =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc = (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc -> To.Parsetree.class_expr_desc =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension (copy_extension x0)

and copy_class_structure :
  From.Parsetree.class_structure -> To.Parsetree.class_structure =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field -> To.Parsetree.class_field =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc = (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc -> To.Parsetree.class_field_desc =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (fun x  -> x.From.Asttypes.txt) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind -> To.Parsetree.class_field_kind =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding -> To.Parsetree.module_binding =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc = (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr -> To.Parsetree.module_expr =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc = (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc -> To.Parsetree.module_expr_desc =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type -> To.Parsetree.module_type =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc = (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc -> To.Parsetree.module_type_desc =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident x0)

and copy_with_constraint :
  From.Parsetree.with_constraint -> To.Parsetree.with_constraint =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst x0 ->
      To.Parsetree.Pwith_typesubst
        (copy_type_declaration x0)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        ((copy_loc (fun x  -> x) x0),
          (copy_loc copy_longident x1))

and copy_signature :
  From.Parsetree.signature -> To.Parsetree.signature =
  fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item -> To.Parsetree.signature_item =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc = (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_description :
  From.Parsetree.class_description -> To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_type :
  From.Parsetree.class_type -> To.Parsetree.class_type =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc = (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc -> To.Parsetree.class_type_desc =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension (copy_extension x0)

and copy_class_signature :
  From.Parsetree.class_signature -> To.Parsetree.class_signature =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field -> To.Parsetree.class_type_field =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc = (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (x0.From.Asttypes.txt, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (x0.From.Asttypes.txt, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension (copy_extension x0)

and copy_extension :
  From.Parsetree.extension -> To.Parsetree.extension =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos -> 'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc = (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag -> To.Asttypes.virtual_flag =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc = (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description -> To.Parsetree.open_description =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc = (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag -> To.Asttypes.override_flag =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc = (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension -> To.Parsetree.type_extension =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc = (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident x0)

and copy_type_declaration :
  From.Parsetree.type_declaration -> To.Parsetree.type_declaration =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc = (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind -> To.Parsetree.type_kind =
  function
  | From.Parsetree.Ptype_abstract  -> To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  -> To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc = (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration -> To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc = (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag -> To.Asttypes.mutable_flag =
  function
  | From.Asttypes.Immutable  -> To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  -> To.Asttypes.Covariant
  | From.Asttypes.Contravariant  -> To.Asttypes.Contravariant
  | From.Asttypes.Invariant  -> To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description -> To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim = (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc = (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 -> To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 -> To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag -> To.Asttypes.closed_flag =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label = fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  -> To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  -> To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 -> To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 -> To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun { From.Asttypes.txt = txt; From.Asttypes.loc = loc }  ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location : From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = (copy_bool otype_unboxed);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_typ (From.Outcometree.Otyp_constr (id,tyl)) ->
      To.Outcometree.Ovar_name (copy_out_ident id, List.map copy_out_type tyl)
  | From.Outcometree.Ovar_typ x0 ->
      To.Outcometree.Ovar_name
        (To.Outcometree.Oide_ident "", [copy_out_type x0])

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string x0 -> To.Outcometree.Oval_string x0
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_404_405
= struct
#1 "migrate_parsetree_404_405.ml"
# 1 "src/migrate_parsetree_404_405.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_404_405_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module R = Migrate_parsetree_405_404_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_405_404
= struct
#1 "migrate_parsetree_405_404.ml"
# 1 "src/migrate_parsetree_405_404.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_405_404_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module R = Migrate_parsetree_404_405_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_405_406_migrate
= struct
#1 "migrate_parsetree_405_406_migrate.ml"
# 1 "src/migrate_parsetree_405_406_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module From = Ast_405
module To = Ast_406

let rec copy_expression :
  From.Parsetree.expression -> To.Parsetree.expression =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc = (copy_location pexp_loc);
      To.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc -> To.Parsetree.expression_desc =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception (x0,x1) ->
      To.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        ((copy_loc (fun x  -> x) x0), (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  -> To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag -> To.Asttypes.direction_flag =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding -> To.Parsetree.value_binding =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc = (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc = (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc -> To.Parsetree.pattern_desc =
  function
  | From.Parsetree.Ppat_any  -> To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension (copy_extension x0)
  | From.Parsetree.Ppat_open (x0,x1) ->
      To.Parsetree.Ppat_open
        ((copy_loc copy_longident x0),
          (copy_pattern x1))

and copy_core_type :
  From.Parsetree.core_type -> To.Parsetree.core_type =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc -> To.Parsetree.core_type_desc =
  function
  | From.Parsetree.Ptyp_any  -> To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 -> To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map
            (fun x  ->
               let (x0,x1,x2) = x  in
               To.Parsetree.Otag
                 (copy_loc (fun x  -> x) x0, (copy_attributes x1),
                  (copy_core_type x2))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> copy_loc (fun x  -> x) x) x0), (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type -> To.Parsetree.package_type =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field -> To.Parsetree.row_field =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        (({ txt = copy_label x0; loc = Location.none; }),
          (copy_attributes x1), (copy_bool x2),
          (List.map copy_core_type x3))
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes -> To.Parsetree.attributes =
  fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute -> To.Parsetree.attribute =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure -> To.Parsetree.structure =
  fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item -> To.Parsetree.structure_item =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc = (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration -> To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr -> To.Parsetree.class_expr =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc = (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc -> To.Parsetree.class_expr_desc =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension (copy_extension x0)

and copy_class_structure :
  From.Parsetree.class_structure -> To.Parsetree.class_structure =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field -> To.Parsetree.class_field =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc = (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc -> To.Parsetree.class_field_desc =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (copy_loc (fun x  -> x)) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind -> To.Parsetree.class_field_kind =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding -> To.Parsetree.module_binding =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc = (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr -> To.Parsetree.module_expr =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc = (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc -> To.Parsetree.module_expr_desc =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type -> To.Parsetree.module_type =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc = (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc -> To.Parsetree.module_type_desc =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident x0)

and copy_with_constraint :
  From.Parsetree.with_constraint -> To.Parsetree.with_constraint =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst x0 ->
      To.Parsetree.Pwith_typesubst
        (copy_loc (fun x -> Longident.Lident x) x0.From.Parsetree.ptype_name,
         copy_type_declaration x0)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        (copy_loc (fun x -> Longident.Lident x) x0,
         copy_loc copy_longident x1)

and copy_signature :
  From.Parsetree.signature -> To.Parsetree.signature =
  fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item -> To.Parsetree.signature_item =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc = (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_description :
  From.Parsetree.class_description -> To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_type :
  From.Parsetree.class_type -> To.Parsetree.class_type =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc = (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc -> To.Parsetree.class_type_desc =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension (copy_extension x0)

and copy_class_signature :
  From.Parsetree.class_signature -> To.Parsetree.class_signature =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field -> To.Parsetree.class_type_field =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc = (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (copy_loc (fun x  -> x) x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (copy_loc (fun x  -> x) x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension (copy_extension x0)

and copy_extension :
  From.Parsetree.extension -> To.Parsetree.extension =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos -> 'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc = (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag -> To.Asttypes.virtual_flag =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc = (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description -> To.Parsetree.open_description =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc = (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag -> To.Asttypes.override_flag =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc = (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension -> To.Parsetree.type_extension =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc = (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident x0)

and copy_type_declaration :
  From.Parsetree.type_declaration -> To.Parsetree.type_declaration =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc = (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind -> To.Parsetree.type_kind =
  function
  | From.Parsetree.Ptype_abstract  -> To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  -> To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc = (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration -> To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc = (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag -> To.Asttypes.mutable_flag =
  function
  | From.Asttypes.Immutable  -> To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  -> To.Asttypes.Covariant
  | From.Asttypes.Contravariant  -> To.Asttypes.Contravariant
  | From.Asttypes.Invariant  -> To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description -> To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim = (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc = (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 -> To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 -> To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag -> To.Asttypes.closed_flag =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label = fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  -> To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  -> To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 -> To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 -> To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun { From.Asttypes.txt = txt; From.Asttypes.loc = loc }  ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location : From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = (copy_bool otype_unboxed);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_typ x0 ->
      To.Outcometree.Ovar_typ (copy_out_type x0)

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string x0 ->
      To.Outcometree.Oval_string (x0, max_int, Ostr_string)
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_406_405_migrate
= struct
#1 "migrate_parsetree_406_405_migrate.ml"
# 1 "src/migrate_parsetree_406_405_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module Def = Migrate_parsetree_def
module From = Ast_406
module To = Ast_405

let migration_error location feature =
  raise (Def.Migration_error (feature, location))

let rec copy_expression :
  From.Parsetree.expression -> To.Parsetree.expression =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc = (copy_location pexp_loc);
      To.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc -> To.Parsetree.expression_desc =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception (x0,x1) ->
      To.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        ((copy_loc (fun x  -> x) x0), (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  -> To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag -> To.Asttypes.direction_flag =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding -> To.Parsetree.value_binding =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc = (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc = (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc -> To.Parsetree.pattern_desc =
  function
  | From.Parsetree.Ppat_any  -> To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension (copy_extension x0)
  | From.Parsetree.Ppat_open (x0,x1) ->
      To.Parsetree.Ppat_open
        ((copy_loc copy_longident x0),
          (copy_pattern x1))

and copy_core_type :
  From.Parsetree.core_type -> To.Parsetree.core_type =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc -> To.Parsetree.core_type_desc =
  function
  | From.Parsetree.Ptyp_any  -> To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 -> To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map
            (function
              | From.Parsetree.Otag (x0,x1,x2) ->
               (copy_loc (fun x  -> x) x0, (copy_attributes x1),
                (copy_core_type x2))
              | From.Parsetree.Oinherit _ ->
                migration_error Location.none Def.Oinherit) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> copy_loc (fun x  -> x) x) x0), (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type -> To.Parsetree.package_type =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field -> To.Parsetree.row_field =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        ((copy_label x0.txt),
          (copy_attributes x1), (copy_bool x2),
          (List.map copy_core_type x3))
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes -> To.Parsetree.attributes =
  fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute -> To.Parsetree.attribute =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure -> To.Parsetree.structure =
  fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item -> To.Parsetree.structure_item =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc = (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration -> To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr -> To.Parsetree.class_expr =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc = (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc -> To.Parsetree.class_expr_desc =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension (copy_extension x0)
  | From.Parsetree.Pcl_open (_, loc, _) ->
      migration_error loc.From.Location.loc Def.Pcl_open

and copy_class_structure :
  From.Parsetree.class_structure -> To.Parsetree.class_structure =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field -> To.Parsetree.class_field =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc = (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc -> To.Parsetree.class_field_desc =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (copy_loc (fun x  -> x)) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind -> To.Parsetree.class_field_kind =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding -> To.Parsetree.module_binding =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc = (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr -> To.Parsetree.module_expr =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc = (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc -> To.Parsetree.module_expr_desc =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type -> To.Parsetree.module_type =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc = (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc -> To.Parsetree.module_type_desc =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident x0)

and copy_with_constraint :
  From.Parsetree.with_constraint -> To.Parsetree.with_constraint =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst ({ txt = Longident.Lident _; _ }, x0) ->
      To.Parsetree.Pwith_typesubst
        (copy_type_declaration x0)
  | From.Parsetree.Pwith_modsubst ({ txt = Longident.Lident x0; loc },x1) ->
      To.Parsetree.Pwith_modsubst
        ({ txt = x0; loc }, (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst ({ loc; _ }, _x0) ->
      migration_error loc Pwith_typesubst_longident
  | From.Parsetree.Pwith_modsubst ({ loc; _ },_x1) ->
      migration_error loc Pwith_modsubst_longident

and copy_signature :
  From.Parsetree.signature -> To.Parsetree.signature =
  fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item -> To.Parsetree.signature_item =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc = (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_description :
  From.Parsetree.class_description -> To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_type :
  From.Parsetree.class_type -> To.Parsetree.class_type =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc = (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc -> To.Parsetree.class_type_desc =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension (copy_extension x0)
  | From.Parsetree.Pcty_open (_, loc, _) ->
      migration_error loc.From.Location.loc Def.Pcty_open

and copy_class_signature :
  From.Parsetree.class_signature -> To.Parsetree.class_signature =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field -> To.Parsetree.class_type_field =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc = (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (copy_loc (fun x  -> x) x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (copy_loc (fun x  -> x) x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension (copy_extension x0)

and copy_extension :
  From.Parsetree.extension -> To.Parsetree.extension =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos -> 'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc = (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag -> To.Asttypes.virtual_flag =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc = (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description -> To.Parsetree.open_description =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc = (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag -> To.Asttypes.override_flag =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc = (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension -> To.Parsetree.type_extension =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc = (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident x0)

and copy_type_declaration :
  From.Parsetree.type_declaration -> To.Parsetree.type_declaration =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc = (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind -> To.Parsetree.type_kind =
  function
  | From.Parsetree.Ptype_abstract  -> To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  -> To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc = (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration -> To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc = (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag -> To.Asttypes.mutable_flag =
  function
  | From.Asttypes.Immutable  -> To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  -> To.Asttypes.Covariant
  | From.Asttypes.Contravariant  -> To.Asttypes.Contravariant
  | From.Asttypes.Invariant  -> To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description -> To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim = (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc = (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 -> To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 -> To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag -> To.Asttypes.closed_flag =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label = fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  -> To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  -> To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 -> To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 -> To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun { From.Asttypes.txt = txt; From.Asttypes.loc = loc }  ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location : From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = (copy_bool otype_unboxed);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_typ x0 ->
      To.Outcometree.Ovar_typ (copy_out_type x0)

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string (x0, _, _) -> To.Outcometree.Oval_string x0
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_405_406
= struct
#1 "migrate_parsetree_405_406.ml"
# 1 "src/migrate_parsetree_405_406.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_405_406_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module R = Migrate_parsetree_406_405_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_406_405
= struct
#1 "migrate_parsetree_406_405.ml"
# 1 "src/migrate_parsetree_406_405.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_406_405_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module R = Migrate_parsetree_405_406_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_406_407_migrate
= struct
#1 "migrate_parsetree_406_407_migrate.ml"
# 1 "src/migrate_parsetree_406_407_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module Def = Migrate_parsetree_def
module From = Ast_406
module To = Ast_407

let migration_error location feature =
  raise (Def.Migration_error (feature, location))

let rec copy_expression :
  From.Parsetree.expression -> To.Parsetree.expression =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc = (copy_location pexp_loc);
      To.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc -> To.Parsetree.expression_desc =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception (x0,x1) ->
      To.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        ((copy_loc (fun x  -> x) x0), (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  -> To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag -> To.Asttypes.direction_flag =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding -> To.Parsetree.value_binding =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc = (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc = (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc -> To.Parsetree.pattern_desc =
  function
  | From.Parsetree.Ppat_any  -> To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension (copy_extension x0)
  | From.Parsetree.Ppat_open (x0,x1) ->
      To.Parsetree.Ppat_open
        ((copy_loc copy_longident x0),
          (copy_pattern x1))

and copy_core_type :
  From.Parsetree.core_type -> To.Parsetree.core_type =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc -> To.Parsetree.core_type_desc =
  function
  | From.Parsetree.Ptyp_any  -> To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 -> To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        (List.map copy_object_field x0,
         copy_closed_flag x1)
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> copy_loc (fun x  -> x) x) x0), (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type -> To.Parsetree.package_type =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field -> To.Parsetree.row_field =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        (copy_loc copy_label x0,
         copy_attributes x1, copy_bool x2,
         List.map copy_core_type x3)
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit (copy_core_type x0)

and copy_object_field :
  From.Parsetree.object_field -> To.Parsetree.object_field =
  function
  | From.Parsetree.Otag (x0,x1,x2) ->
      To.Parsetree.Otag (copy_loc (fun x -> x) x0,
                         copy_attributes x1,
                         copy_core_type x2)
  | From.Parsetree.Oinherit x -> To.Parsetree.Oinherit (copy_core_type x)

and copy_attributes :
  From.Parsetree.attributes -> To.Parsetree.attributes =
  fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute -> To.Parsetree.attribute =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure -> To.Parsetree.structure =
  fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item -> To.Parsetree.structure_item =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc = (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration -> To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr -> To.Parsetree.class_expr =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc = (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc -> To.Parsetree.class_expr_desc =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension (copy_extension x0)
  | From.Parsetree.Pcl_open (ovf, loc, ce) ->
      To.Parsetree.Pcl_open (copy_override_flag ovf,
                             copy_loc copy_longident loc,
                              copy_class_expr ce)

and copy_class_structure :
  From.Parsetree.class_structure -> To.Parsetree.class_structure =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field -> To.Parsetree.class_field =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc = (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc -> To.Parsetree.class_field_desc =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (copy_loc (fun x  -> x)) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind -> To.Parsetree.class_field_kind =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding -> To.Parsetree.module_binding =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc = (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr -> To.Parsetree.module_expr =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc = (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc -> To.Parsetree.module_expr_desc =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type -> To.Parsetree.module_type =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc = (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc -> To.Parsetree.module_type_desc =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident x0)

and copy_with_constraint :
  From.Parsetree.with_constraint -> To.Parsetree.with_constraint =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst (x0, x1) ->
      To.Parsetree.Pwith_typesubst
        (copy_loc copy_longident x0, copy_type_declaration x1)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        (copy_loc copy_longident x0, copy_loc copy_longident x1)

and copy_signature :
  From.Parsetree.signature -> To.Parsetree.signature =
  fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item -> To.Parsetree.signature_item =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc = (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_description :
  From.Parsetree.class_description -> To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_type :
  From.Parsetree.class_type -> To.Parsetree.class_type =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc = (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc -> To.Parsetree.class_type_desc =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension (copy_extension x0)
  | From.Parsetree.Pcty_open (ovf, loc, cty) ->
      To.Parsetree.Pcty_open (copy_override_flag ovf,
                              copy_loc copy_longident loc,
                              copy_class_type cty)

and copy_class_signature :
  From.Parsetree.class_signature -> To.Parsetree.class_signature =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field -> To.Parsetree.class_type_field =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc = (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (copy_loc (fun x  -> x) x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (copy_loc (fun x  -> x) x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension (copy_extension x0)

and copy_extension :
  From.Parsetree.extension -> To.Parsetree.extension =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos -> 'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc = (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag -> To.Asttypes.virtual_flag =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc = (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description -> To.Parsetree.open_description =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc = (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag -> To.Asttypes.override_flag =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc = (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension -> To.Parsetree.type_extension =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc = (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident x0)

and copy_type_declaration :
  From.Parsetree.type_declaration -> To.Parsetree.type_declaration =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc = (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind -> To.Parsetree.type_kind =
  function
  | From.Parsetree.Ptype_abstract  -> To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  -> To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc = (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration -> To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc = (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag -> To.Asttypes.mutable_flag =
  function
  | From.Asttypes.Immutable  -> To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  -> To.Asttypes.Covariant
  | From.Asttypes.Contravariant  -> To.Asttypes.Contravariant
  | From.Asttypes.Invariant  -> To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description -> To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim = (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc = (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 -> To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 -> To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag -> To.Asttypes.closed_flag =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label = fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  -> To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  -> To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 -> To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 -> To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun { From.Asttypes.txt = txt; From.Asttypes.loc = loc }  ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location : From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = (copy_bool otype_unboxed);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_string :
  From.Outcometree.out_string -> To.Outcometree.out_string =
  function
  | From.Outcometree.Ostr_string -> To.Outcometree.Ostr_string
  | From.Outcometree.Ostr_bytes -> To.Outcometree.Ostr_bytes 

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_typ x0 ->
      To.Outcometree.Ovar_typ (copy_out_type x0)

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string (x0, x1, x2) -> 
      To.Outcometree.Oval_string (x0, x1, copy_out_string x2)
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_407_406_migrate
= struct
#1 "migrate_parsetree_407_406_migrate.ml"
# 1 "src/migrate_parsetree_407_406_migrate.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                         Alain Frisch, LexiFi                           *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

module From = Ast_407
module To = Ast_406

let rec copy_expression :
  From.Parsetree.expression -> To.Parsetree.expression =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc = (copy_location pexp_loc);
      To.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc -> To.Parsetree.expression_desc =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0), (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc (fun x  -> x) x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception (x0,x1) ->
      To.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        ((copy_loc (fun x  -> x) x0), (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ((copy_override_flag x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  -> To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag -> To.Asttypes.direction_flag =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding -> To.Parsetree.value_binding =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc = (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc = (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc -> To.Parsetree.pattern_desc =
  function
  | From.Parsetree.Ppat_any  -> To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension (copy_extension x0)
  | From.Parsetree.Ppat_open (x0,x1) ->
      To.Parsetree.Ppat_open
        ((copy_loc copy_longident x0),
          (copy_pattern x1))

and copy_core_type :
  From.Parsetree.core_type -> To.Parsetree.core_type =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc -> To.Parsetree.core_type_desc =
  function
  | From.Parsetree.Ptyp_any  -> To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 -> To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        (List.map copy_object_field x0,
         copy_closed_flag x1)
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> copy_loc (fun x  -> x) x) x0), (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type -> To.Parsetree.package_type =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field -> To.Parsetree.row_field =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
      To.Parsetree.Rtag
        (copy_loc copy_label x0,
         copy_attributes x1, copy_bool x2,
         List.map copy_core_type x3)
  | From.Parsetree.Rinherit x0 ->
      To.Parsetree.Rinherit (copy_core_type x0)

and copy_object_field :
  From.Parsetree.object_field -> To.Parsetree.object_field =
  function
  | From.Parsetree.Otag (x0,x1,x2) ->
      To.Parsetree.Otag (copy_loc (fun x -> x) x0,
                         copy_attributes x1,
                         copy_core_type x2)
  | From.Parsetree.Oinherit x -> To.Parsetree.Oinherit (copy_core_type x)

and copy_attributes :
  From.Parsetree.attributes -> To.Parsetree.attributes =
  fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute -> To.Parsetree.attribute =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure -> To.Parsetree.structure =
  fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item -> To.Parsetree.structure_item =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc = (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
      To.Parsetree.Pstr_open
        (copy_open_description x0)
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration -> To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr -> To.Parsetree.class_expr =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc = (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc -> To.Parsetree.class_expr_desc =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension (copy_extension x0)
  | From.Parsetree.Pcl_open (ovf, loc, ce) ->
      To.Parsetree.Pcl_open (copy_override_flag ovf,
                             copy_loc copy_longident loc,
                              copy_class_expr ce)

and copy_class_structure :
  From.Parsetree.class_structure -> To.Parsetree.class_structure =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field -> To.Parsetree.class_field =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc = (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc -> To.Parsetree.class_field_desc =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (copy_loc (fun x  -> x)) x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc (fun x  -> x) x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind -> To.Parsetree.class_field_kind =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding -> To.Parsetree.module_binding =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc = (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr -> To.Parsetree.module_expr =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc = (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc -> To.Parsetree.module_expr_desc =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type -> To.Parsetree.module_type =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc = (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc -> To.Parsetree.module_type_desc =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident x0)

and copy_with_constraint :
  From.Parsetree.with_constraint -> To.Parsetree.with_constraint =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst (x0, x1) ->
      To.Parsetree.Pwith_typesubst
        (copy_loc copy_longident x0, copy_type_declaration x1)
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        (copy_loc copy_longident x0, copy_loc copy_longident x1)

and copy_signature :
  From.Parsetree.signature -> To.Parsetree.signature =
  fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item -> To.Parsetree.signature_item =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc = (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (copy_extension_constructor x0)
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_description :
  From.Parsetree.class_description -> To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_type :
  From.Parsetree.class_type -> To.Parsetree.class_type =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc = (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc -> To.Parsetree.class_type_desc =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension (copy_extension x0)
  | From.Parsetree.Pcty_open (ovf, loc, cty) ->
      To.Parsetree.Pcty_open (copy_override_flag ovf,
                              copy_loc copy_longident loc,
                              copy_class_type cty)

and copy_class_signature :
  From.Parsetree.class_signature -> To.Parsetree.class_signature =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field -> To.Parsetree.class_type_field =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc = (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         (copy_loc (fun x  -> x) x0, (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         (copy_loc (fun x  -> x) x0, (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension (copy_extension x0)

and copy_extension :
  From.Parsetree.extension -> To.Parsetree.extension =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos -> 'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc = (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag -> To.Asttypes.virtual_flag =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc = (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description -> To.Parsetree.open_description =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_lid =
        (copy_loc copy_longident popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc = (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag -> To.Asttypes.override_flag =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc = (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension -> To.Parsetree.type_extension =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc = (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident x0)

and copy_type_declaration :
  From.Parsetree.type_declaration -> To.Parsetree.type_declaration =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc = (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind -> To.Parsetree.type_kind =
  function
  | From.Parsetree.Ptype_abstract  -> To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  -> To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc = (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration -> To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc = (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag -> To.Asttypes.mutable_flag =
  function
  | From.Asttypes.Immutable  -> To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  -> To.Asttypes.Covariant
  | From.Asttypes.Contravariant  -> To.Asttypes.Contravariant
  | From.Asttypes.Invariant  -> To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description -> To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim = (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc = (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 -> To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 -> To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag -> To.Asttypes.closed_flag =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label = fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  -> To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  -> To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 -> To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 -> To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun { From.Asttypes.txt = txt; From.Asttypes.loc = loc }  ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location : From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = (copy_bool otype_unboxed);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        (x0, (List.map (fun x  -> x) x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_string :
  From.Outcometree.out_string -> To.Outcometree.out_string =
  function
  | From.Outcometree.Ostr_string -> To.Outcometree.Ostr_string
  | From.Outcometree.Ostr_bytes -> To.Outcometree.Ostr_bytes 

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_typ x0 ->
      To.Outcometree.Ovar_typ (copy_out_type x0)

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string (x0, x1, x2) -> 
      To.Outcometree.Oval_string (x0, x1, copy_out_string x2)
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        (x0, (copy_directive_argument x1))

and copy_directive_argument :
  From.Parsetree.directive_argument -> To.Parsetree.directive_argument =
  function
  | From.Parsetree.Pdir_none  -> To.Parsetree.Pdir_none
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

end
module Migrate_parsetree_406_407
= struct
#1 "migrate_parsetree_406_407.ml"
# 1 "src/migrate_parsetree_406_407.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_406_407_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module R = Migrate_parsetree_407_406_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_407_406
= struct
#1 "migrate_parsetree_407_406.ml"
# 1 "src/migrate_parsetree_407_406.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_407_406_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module R = Migrate_parsetree_406_407_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_407_408_migrate
= struct
#1 "migrate_parsetree_407_408_migrate.ml"
# 1 "src/migrate_parsetree_407_408_migrate.ml"
module From = Ast_407
module To = Ast_408

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir (x0,x1) ->
      To.Parsetree.Ptop_dir
        { To.Parsetree.pdir_name = { To.Location.txt = x0; To.Location.loc = Location.none; };
          To.Parsetree.pdir_arg = copy_directive_argument x1;
          To.Parsetree.pdir_loc = Location.none; }

and copy_directive_argument :
  From.Parsetree.directive_argument ->
    To.Parsetree.directive_argument option
  =
  let wrap pdira_desc =
     Some { To.Parsetree.pdira_desc;
            To.Parsetree.pdira_loc = Location.none; } in
  function
  | From.Parsetree.Pdir_none  -> None
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0 |> wrap
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1)) |> wrap
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0) |> wrap
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0) |> wrap

and copy_expression :
  From.Parsetree.expression -> To.Parsetree.expression =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc =
        (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc = (copy_location pexp_loc);
      To.Parsetree.pexp_loc_stack = [];
      To.Parsetree.pexp_attributes =
        (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc -> To.Parsetree.expression_desc =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0),
          (copy_loc copy_label x1))
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc copy_label x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc copy_label x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception (x0,x1) ->
      To.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1,x2) ->
      To.Parsetree.Pexp_open
        ({ To.Parsetree.popen_expr =
             { To.Parsetree.pmod_desc = To.Parsetree.Pmod_ident (copy_loc copy_longident x1);
               To.Parsetree.pmod_loc = x1.Location.loc;
               To.Parsetree.pmod_attributes = []; };
           To.Parsetree.popen_override = (copy_override_flag x0);
           To.Parsetree.popen_loc = x1.Location.loc;
           To.Parsetree.popen_attributes = []; },
          (copy_expression x2))
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  -> To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag -> To.Asttypes.direction_flag =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding -> To.Parsetree.value_binding =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc = (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc = (copy_location ppat_loc);
      To.Parsetree.ppat_loc_stack = [];
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc -> To.Parsetree.pattern_desc =
  function
  | From.Parsetree.Ppat_any  -> To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension (copy_extension x0)
  | From.Parsetree.Ppat_open (x0,x1) ->
      To.Parsetree.Ppat_open
        ((copy_loc copy_longident x0),
          (copy_pattern x1))

and copy_core_type :
  From.Parsetree.core_type -> To.Parsetree.core_type =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      To.Parsetree.ptyp_loc_stack = [];
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc -> To.Parsetree.core_type_desc =
  function
  | From.Parsetree.Ptyp_any  -> To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 -> To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map copy_object_field x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> copy_loc (fun x  -> x) x) x0),
          (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type -> To.Parsetree.package_type =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field -> To.Parsetree.row_field =
  function
  | From.Parsetree.Rtag (x0,x1,x2,x3) ->
    { To.Parsetree.prf_desc =
        (To.Parsetree.Rtag
           ((copy_loc copy_label x0),
            (copy_bool x2),
            (List.map copy_core_type x3)));
      To.Parsetree.prf_loc = x0.Location.loc;
      To.Parsetree.prf_attributes = (copy_attributes x1); }
  | From.Parsetree.Rinherit x0 ->
    { To.Parsetree.prf_desc = (To.Parsetree.Rinherit (copy_core_type x0));
      To.Parsetree.prf_loc = x0.From.Parsetree.ptyp_loc;
      To.Parsetree.prf_attributes = []; }

and copy_object_field :
  From.Parsetree.object_field -> To.Parsetree.object_field =
  function
  | From.Parsetree.Otag (x0,x1,x2) ->
    { To.Parsetree.pof_desc =
        (To.Parsetree.Otag
           ((copy_loc copy_label x0),
            (copy_core_type x2)));
      To.Parsetree.pof_loc = x0.Location.loc;
      To.Parsetree.pof_attributes = (copy_attributes x1); }
  | From.Parsetree.Oinherit x0 ->
    { To.Parsetree.pof_desc = (To.Parsetree.Oinherit (copy_core_type x0));
      To.Parsetree.pof_loc = x0.From.Parsetree.ptyp_loc;
      To.Parsetree.pof_attributes = []; }

and copy_attributes :
  From.Parsetree.attributes -> To.Parsetree.attributes =
  fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute -> To.Parsetree.attribute =
  fun x  ->
    let (x0,x1) = x  in
    { To.Parsetree.attr_name = copy_loc (fun x  -> x) x0;
      To.Parsetree.attr_payload = copy_payload x1;
      To.Parsetree.attr_loc = x0.Location.loc; }

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure -> To.Parsetree.structure =
  fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item -> To.Parsetree.structure_item =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc = (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
    let atat, at = List.partition (function
      | {Location.txt=("ocaml.deprecated"|"deprecated");_},_ -> false
      | _ -> true) x0.pext_attributes
    in
    let x0 = { x0 with pext_attributes = at } in
    To.Parsetree.Pstr_exception
      { To.Parsetree.ptyexn_constructor = (copy_extension_constructor x0);
        To.Parsetree.ptyexn_loc = x0.From.Parsetree.pext_loc;
        To.Parsetree.ptyexn_attributes = copy_attributes atat }
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open
      { From.Parsetree.popen_lid;
        From.Parsetree.popen_override;
        From.Parsetree.popen_loc;
        From.Parsetree.popen_attributes; } ->
    To.Parsetree.Pstr_open
      { To.Parsetree.popen_expr =
          { To.Parsetree.pmod_desc = To.Parsetree.Pmod_ident (copy_loc copy_longident popen_lid);
            To.Parsetree.pmod_loc = popen_loc;
            To.Parsetree.pmod_attributes = []; };
        To.Parsetree.popen_override = (copy_override_flag popen_override);
        To.Parsetree.popen_loc = (copy_location popen_loc);
        To.Parsetree.popen_attributes = (copy_attributes popen_attributes);
    }
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration -> To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr -> To.Parsetree.class_expr =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc = (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc -> To.Parsetree.class_expr_desc =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension (copy_extension x0)
  | From.Parsetree.Pcl_open (x0,x1,x2) ->
      To.Parsetree.Pcl_open
        ({ To.Parsetree.popen_expr = (copy_loc copy_longident x1);
           To.Parsetree.popen_override = (copy_override_flag x0);
           To.Parsetree.popen_loc = x1.Location.loc;
           To.Parsetree.popen_attributes = []; },
         (copy_class_expr x2))

and copy_class_structure :
  From.Parsetree.class_structure -> To.Parsetree.class_structure =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
    ->
      let fields =
        List.sort
          (fun (a : From.Parsetree.class_field) (b : From.Parsetree.class_field) ->
             compare a.pcf_loc.loc_start.pos_cnum b.pcf_loc.loc_start.pos_cnum)
          pcstr_fields
      in
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field fields)
    }

and copy_class_field :
  From.Parsetree.class_field -> To.Parsetree.class_field =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc = (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc -> To.Parsetree.class_field_desc =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (fun x  -> copy_loc (fun x  -> x) x)
             x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc copy_label x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc copy_label x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind -> To.Parsetree.class_field_kind =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding -> To.Parsetree.module_binding =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc = (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr -> To.Parsetree.module_expr =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc = (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc -> To.Parsetree.module_expr_desc =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type -> To.Parsetree.module_type =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc = (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc -> To.Parsetree.module_type_desc =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident x0)

and copy_with_constraint :
  From.Parsetree.with_constraint -> To.Parsetree.with_constraint =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst (x0,x1) ->
      To.Parsetree.Pwith_typesubst
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))

and copy_signature :
  From.Parsetree.signature -> To.Parsetree.signature =
  fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item -> To.Parsetree.signature_item =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc = (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
    let atat, at = List.partition (function
      | {Location.txt=("ocaml.deprecated"|"deprecated");_},_ -> false
      | _ -> true) x0.pext_attributes
    in
    let x0 = { x0 with pext_attributes = at } in

      To.Parsetree.Psig_exception
        { To.Parsetree.ptyexn_constructor = (copy_extension_constructor x0);
          To.Parsetree.ptyexn_loc = x0.From.Parsetree.pext_loc;
          To.Parsetree.ptyexn_attributes = copy_attributes atat; }
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_description :
  From.Parsetree.class_description -> To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_type :
  From.Parsetree.class_type -> To.Parsetree.class_type =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc = (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc -> To.Parsetree.class_type_desc =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension (copy_extension x0)
  | From.Parsetree.Pcty_open (x0,x1,x2) ->
      To.Parsetree.Pcty_open
        ({ To.Parsetree.popen_expr = (copy_loc copy_longident x1);
           To.Parsetree.popen_override = (copy_override_flag x0);
           To.Parsetree.popen_loc = x1.Location.loc;
           To.Parsetree.popen_attributes = []; },
         (copy_class_type x2))

and copy_class_signature :
  From.Parsetree.class_signature -> To.Parsetree.class_signature =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
    ->
      let fields =
        List.sort
          (fun (a : From.Parsetree.class_type_field) (b : From.Parsetree.class_type_field) ->
             compare a.pctf_loc.loc_start.pos_cnum b.pctf_loc.loc_start.pos_cnum)
          pcsig_fields
      in

    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field -> To.Parsetree.class_type_field =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc = (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         ((copy_loc copy_label x0),
           (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         ((copy_loc copy_label x0),
           (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension (copy_extension x0)

and copy_extension :
  From.Parsetree.extension -> To.Parsetree.extension =
  fun x  ->
    let (x0,x1) = x  in
    let x1 =
      match x0.txt with
      | "ocaml.error" | "error" ->
        begin match x1 with
        | PStr (hd :: _ :: tl) -> From.Parsetree.PStr (hd :: tl)
        | _ -> x1
        end
      | _ -> x1 in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos -> 'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc = (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag -> To.Asttypes.virtual_flag =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc = (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description -> To.Parsetree.open_description =
  fun
    { From.Parsetree.popen_lid = popen_lid;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
     ->
    {
      To.Parsetree.popen_expr =
        (copy_loc copy_longident popen_lid);
      To.Parsetree.popen_override =
        (copy_override_flag popen_override);
      To.Parsetree.popen_loc = (copy_location popen_loc);
      To.Parsetree.popen_attributes =
        (copy_attributes popen_attributes)
    }

and copy_override_flag :
  From.Asttypes.override_flag -> To.Asttypes.override_flag =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc = (copy_location pmd_loc)
    }

and copy_type_extension :
  From.Parsetree.type_extension -> To.Parsetree.type_extension =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_loc = ptyext_path.Location.loc;
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc = (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident x0)

and copy_type_declaration :
  From.Parsetree.type_declaration -> To.Parsetree.type_declaration =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc = (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind -> To.Parsetree.type_kind =
  function
  | From.Parsetree.Ptype_abstract  -> To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  -> To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc = (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration -> To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc = (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag -> To.Asttypes.mutable_flag =
  function
  | From.Asttypes.Immutable  -> To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  -> To.Asttypes.Covariant
  | From.Asttypes.Contravariant  -> To.Asttypes.Contravariant
  | From.Asttypes.Invariant  -> To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description -> To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim = (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc = (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 -> To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 -> To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag -> To.Asttypes.closed_flag =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label = fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  -> To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  -> To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 -> To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 -> To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun { From.Asttypes.txt = txt; From.Asttypes.loc = loc }  ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location : From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = (copy_bool otype_unboxed);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        ((To.Outcometree.Oide_ident { To.Outcometree.printed_name = x0; }),
         (List.map (fun x  -> x) x1),
         (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_string :
  From.Outcometree.out_string -> To.Outcometree.out_string =
  function
  | From.Outcometree.Ostr_string -> To.Outcometree.Ostr_string
  | From.Outcometree.Ostr_bytes -> To.Outcometree.Ostr_bytes

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_typ x0 ->
      To.Outcometree.Ovar_typ (copy_out_type x0)

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string (x0, x1, x2) ->
      To.Outcometree.Oval_string (x0, x1, copy_out_string x2)
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 ->
    To.Outcometree.Oide_ident
      ({ To.Outcometree.printed_name = x0; })

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

end
module Migrate_parsetree_408_407_migrate
= struct
#1 "migrate_parsetree_408_407_migrate.ml"
# 1 "src/migrate_parsetree_408_407_migrate.ml"
module From = Ast_408
module To = Ast_407

module Def = Migrate_parsetree_def

let migration_error location feature =
  raise (Def.Migration_error (feature, location))

let rec copy_toplevel_phrase :
  From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase =
  function
  | From.Parsetree.Ptop_def x0 ->
      To.Parsetree.Ptop_def (copy_structure x0)
  | From.Parsetree.Ptop_dir
      { From.Parsetree.pdir_name;
        From.Parsetree.pdir_arg;
        From.Parsetree.pdir_loc = _; } ->
      To.Parsetree.Ptop_dir
        (pdir_name.Location.txt,
         (match pdir_arg with
          | None -> To.Parsetree.Pdir_none
          | Some arg -> copy_directive_argument arg))

and copy_directive_argument :
  From.Parsetree.directive_argument ->
    To.Parsetree.directive_argument
  =
  fun
    { From.Parsetree.pdira_desc = pdira_desc;
      From.Parsetree.pdira_loc = _pdira_loc }
     ->
       (copy_directive_argument_desc pdira_desc)

and copy_directive_argument_desc :
  From.Parsetree.directive_argument_desc ->
    To.Parsetree.directive_argument
  =
  function
  | From.Parsetree.Pdir_string x0 -> To.Parsetree.Pdir_string x0
  | From.Parsetree.Pdir_int (x0,x1) ->
      To.Parsetree.Pdir_int (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pdir_ident x0 ->
      To.Parsetree.Pdir_ident (copy_longident x0)
  | From.Parsetree.Pdir_bool x0 ->
      To.Parsetree.Pdir_bool (copy_bool x0)

and copy_expression :
  From.Parsetree.expression -> To.Parsetree.expression =
  fun
    { From.Parsetree.pexp_desc = pexp_desc;
      From.Parsetree.pexp_loc = pexp_loc;
      From.Parsetree.pexp_loc_stack = _;
      From.Parsetree.pexp_attributes = pexp_attributes }
     ->
    {
      To.Parsetree.pexp_desc =
        (copy_expression_desc pexp_desc);
      To.Parsetree.pexp_loc = (copy_location pexp_loc);
      To.Parsetree.pexp_attributes =
        (copy_attributes pexp_attributes)
    }

and copy_expression_desc :
  From.Parsetree.expression_desc -> To.Parsetree.expression_desc =
  function
  | From.Parsetree.Pexp_ident x0 ->
      To.Parsetree.Pexp_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_constant x0 ->
      To.Parsetree.Pexp_constant (copy_constant x0)
  | From.Parsetree.Pexp_let (x0,x1,x2) ->
      To.Parsetree.Pexp_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_function x0 ->
      To.Parsetree.Pexp_function
        (List.map copy_case x0)
  | From.Parsetree.Pexp_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pexp_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_expression x3))
  | From.Parsetree.Pexp_apply (x0,x1) ->
      To.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pexp_match (x0,x1) ->
      To.Parsetree.Pexp_match
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_try (x0,x1) ->
      To.Parsetree.Pexp_try
        ((copy_expression x0),
          (List.map copy_case x1))
  | From.Parsetree.Pexp_tuple x0 ->
      To.Parsetree.Pexp_tuple
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_construct (x0,x1) ->
      To.Parsetree.Pexp_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_variant (x0,x1) ->
      To.Parsetree.Pexp_variant
        ((copy_label x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_record (x0,x1) ->
      To.Parsetree.Pexp_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_expression x1))) x0),
          (copy_option copy_expression x1))
  | From.Parsetree.Pexp_field (x0,x1) ->
      To.Parsetree.Pexp_field
        ((copy_expression x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pexp_setfield (x0,x1,x2) ->
      To.Parsetree.Pexp_setfield
        ((copy_expression x0),
          (copy_loc copy_longident x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_array x0 ->
      To.Parsetree.Pexp_array
        (List.map copy_expression x0)
  | From.Parsetree.Pexp_ifthenelse (x0,x1,x2) ->
      To.Parsetree.Pexp_ifthenelse
        ((copy_expression x0),
          (copy_expression x1),
          (copy_option copy_expression x2))
  | From.Parsetree.Pexp_sequence (x0,x1) ->
      To.Parsetree.Pexp_sequence
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_while (x0,x1) ->
      To.Parsetree.Pexp_while
        ((copy_expression x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_for (x0,x1,x2,x3,x4) ->
      To.Parsetree.Pexp_for
        ((copy_pattern x0),
          (copy_expression x1),
          (copy_expression x2),
          (copy_direction_flag x3),
          (copy_expression x4))
  | From.Parsetree.Pexp_constraint (x0,x1) ->
      To.Parsetree.Pexp_constraint
        ((copy_expression x0),
          (copy_core_type x1))
  | From.Parsetree.Pexp_coerce (x0,x1,x2) ->
      To.Parsetree.Pexp_coerce
        ((copy_expression x0),
          (copy_option copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Pexp_send (x0,x1) ->
      To.Parsetree.Pexp_send
        ((copy_expression x0),
          (copy_loc copy_label x1))
  | From.Parsetree.Pexp_new x0 ->
      To.Parsetree.Pexp_new
        (copy_loc copy_longident x0)
  | From.Parsetree.Pexp_setinstvar (x0,x1) ->
      To.Parsetree.Pexp_setinstvar
        ((copy_loc copy_label x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_override x0 ->
      To.Parsetree.Pexp_override
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_loc copy_label x0),
                (copy_expression x1))) x0)
  | From.Parsetree.Pexp_letmodule (x0,x1,x2) ->
      To.Parsetree.Pexp_letmodule
        ((copy_loc (fun x  -> x) x0),
          (copy_module_expr x1),
          (copy_expression x2))
  | From.Parsetree.Pexp_letexception (x0,x1) ->
      To.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_assert x0 ->
      To.Parsetree.Pexp_assert (copy_expression x0)
  | From.Parsetree.Pexp_lazy x0 ->
      To.Parsetree.Pexp_lazy (copy_expression x0)
  | From.Parsetree.Pexp_poly (x0,x1) ->
      To.Parsetree.Pexp_poly
        ((copy_expression x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pexp_object x0 ->
      To.Parsetree.Pexp_object
        (copy_class_structure x0)
  | From.Parsetree.Pexp_newtype (x0,x1) ->
      To.Parsetree.Pexp_newtype
        ((copy_loc (fun x  -> x) x0),
          (copy_expression x1))
  | From.Parsetree.Pexp_pack x0 ->
      To.Parsetree.Pexp_pack (copy_module_expr x0)
  | From.Parsetree.Pexp_open (x0,x1) ->
    begin match x0.From.Parsetree.popen_expr.From.Parsetree.pmod_desc with
    | Pmod_ident lid ->
      To.Parsetree.Pexp_open
        (copy_override_flag x0.From.Parsetree.popen_override,
         (copy_loc copy_longident lid),
         (copy_expression x1))
    | Pmod_structure _ | Pmod_functor _ | Pmod_apply _
    | Pmod_constraint _ | Pmod_unpack _ | Pmod_extension _ ->
      migration_error x0.From.Parsetree.popen_loc Def.Pexp_open
    end
  | From.Parsetree.Pexp_letop { let_; ands = _; body = _; } ->
    migration_error let_.pbop_op.loc Def.Pexp_letop
  | From.Parsetree.Pexp_extension x0 ->
      To.Parsetree.Pexp_extension (copy_extension x0)
  | From.Parsetree.Pexp_unreachable  -> To.Parsetree.Pexp_unreachable

and copy_direction_flag :
  From.Asttypes.direction_flag -> To.Asttypes.direction_flag =
  function
  | From.Asttypes.Upto  -> To.Asttypes.Upto
  | From.Asttypes.Downto  -> To.Asttypes.Downto

and copy_case :
  From.Parsetree.case -> To.Parsetree.case =
  fun
    { From.Parsetree.pc_lhs = pc_lhs;
      From.Parsetree.pc_guard = pc_guard;
      From.Parsetree.pc_rhs = pc_rhs }
     ->
    {
      To.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      To.Parsetree.pc_guard =
        (copy_option copy_expression pc_guard);
      To.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }

and copy_value_binding :
  From.Parsetree.value_binding -> To.Parsetree.value_binding =
  fun
    { From.Parsetree.pvb_pat = pvb_pat;
      From.Parsetree.pvb_expr = pvb_expr;
      From.Parsetree.pvb_attributes = pvb_attributes;
      From.Parsetree.pvb_loc = pvb_loc }
     ->
    {
      To.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      To.Parsetree.pvb_expr =
        (copy_expression pvb_expr);
      To.Parsetree.pvb_attributes =
        (copy_attributes pvb_attributes);
      To.Parsetree.pvb_loc = (copy_location pvb_loc)
    }

and copy_pattern :
  From.Parsetree.pattern -> To.Parsetree.pattern =
  fun
    { From.Parsetree.ppat_desc = ppat_desc;
      From.Parsetree.ppat_loc = ppat_loc;
      From.Parsetree.ppat_loc_stack = _;
      From.Parsetree.ppat_attributes = ppat_attributes }
     ->
    {
      To.Parsetree.ppat_desc =
        (copy_pattern_desc ppat_desc);
      To.Parsetree.ppat_loc = (copy_location ppat_loc);
      To.Parsetree.ppat_attributes =
        (copy_attributes ppat_attributes)
    }

and copy_pattern_desc :
  From.Parsetree.pattern_desc -> To.Parsetree.pattern_desc =
  function
  | From.Parsetree.Ppat_any  -> To.Parsetree.Ppat_any
  | From.Parsetree.Ppat_var x0 ->
      To.Parsetree.Ppat_var (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_alias (x0,x1) ->
      To.Parsetree.Ppat_alias
        ((copy_pattern x0),
          (copy_loc (fun x  -> x) x1))
  | From.Parsetree.Ppat_constant x0 ->
      To.Parsetree.Ppat_constant (copy_constant x0)
  | From.Parsetree.Ppat_interval (x0,x1) ->
      To.Parsetree.Ppat_interval
        ((copy_constant x0),
          (copy_constant x1))
  | From.Parsetree.Ppat_tuple x0 ->
      To.Parsetree.Ppat_tuple
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_construct (x0,x1) ->
      To.Parsetree.Ppat_construct
        ((copy_loc copy_longident x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_variant (x0,x1) ->
      To.Parsetree.Ppat_variant
        ((copy_label x0),
          (copy_option copy_pattern x1))
  | From.Parsetree.Ppat_record (x0,x1) ->
      To.Parsetree.Ppat_record
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               ((copy_loc copy_longident x0),
                 (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ppat_array x0 ->
      To.Parsetree.Ppat_array
        (List.map copy_pattern x0)
  | From.Parsetree.Ppat_or (x0,x1) ->
      To.Parsetree.Ppat_or
        ((copy_pattern x0),
          (copy_pattern x1))
  | From.Parsetree.Ppat_constraint (x0,x1) ->
      To.Parsetree.Ppat_constraint
        ((copy_pattern x0),
          (copy_core_type x1))
  | From.Parsetree.Ppat_type x0 ->
      To.Parsetree.Ppat_type
        (copy_loc copy_longident x0)
  | From.Parsetree.Ppat_lazy x0 ->
      To.Parsetree.Ppat_lazy (copy_pattern x0)
  | From.Parsetree.Ppat_unpack x0 ->
      To.Parsetree.Ppat_unpack
        (copy_loc (fun x  -> x) x0)
  | From.Parsetree.Ppat_exception x0 ->
      To.Parsetree.Ppat_exception (copy_pattern x0)
  | From.Parsetree.Ppat_extension x0 ->
      To.Parsetree.Ppat_extension (copy_extension x0)
  | From.Parsetree.Ppat_open (x0,x1) ->
      To.Parsetree.Ppat_open
        ((copy_loc copy_longident x0),
          (copy_pattern x1))

and copy_core_type :
  From.Parsetree.core_type -> To.Parsetree.core_type =
  fun
    { From.Parsetree.ptyp_desc = ptyp_desc;
      From.Parsetree.ptyp_loc = ptyp_loc;
      From.Parsetree.ptyp_loc_stack = _;
      From.Parsetree.ptyp_attributes = ptyp_attributes }
     ->
    {
      To.Parsetree.ptyp_desc =
        (copy_core_type_desc ptyp_desc);
      To.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      To.Parsetree.ptyp_attributes =
        (copy_attributes ptyp_attributes)
    }

and copy_core_type_desc :
  From.Parsetree.core_type_desc -> To.Parsetree.core_type_desc =
  function
  | From.Parsetree.Ptyp_any  -> To.Parsetree.Ptyp_any
  | From.Parsetree.Ptyp_var x0 -> To.Parsetree.Ptyp_var x0
  | From.Parsetree.Ptyp_arrow (x0,x1,x2) ->
      To.Parsetree.Ptyp_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_core_type x2))
  | From.Parsetree.Ptyp_tuple x0 ->
      To.Parsetree.Ptyp_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Ptyp_constr (x0,x1) ->
      To.Parsetree.Ptyp_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_object (x0,x1) ->
      To.Parsetree.Ptyp_object
        ((List.map copy_object_field x0),
          (copy_closed_flag x1))
  | From.Parsetree.Ptyp_class (x0,x1) ->
      To.Parsetree.Ptyp_class
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Ptyp_alias (x0,x1) ->
      To.Parsetree.Ptyp_alias
        ((copy_core_type x0), x1)
  | From.Parsetree.Ptyp_variant (x0,x1,x2) ->
      To.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0),
          (copy_closed_flag x1),
          (copy_option (fun x  -> List.map copy_label x) x2))
  | From.Parsetree.Ptyp_poly (x0,x1) ->
      To.Parsetree.Ptyp_poly
        ((List.map (fun x  -> copy_loc (fun x  -> x) x) x0),
          (copy_core_type x1))
  | From.Parsetree.Ptyp_package x0 ->
      To.Parsetree.Ptyp_package (copy_package_type x0)
  | From.Parsetree.Ptyp_extension x0 ->
      To.Parsetree.Ptyp_extension (copy_extension x0)

and copy_package_type :
  From.Parsetree.package_type -> To.Parsetree.package_type =
  fun x  ->
    let (x0,x1) = x  in
    ((copy_loc copy_longident x0),
      (List.map
         (fun x  ->
            let (x0,x1) = x  in
            ((copy_loc copy_longident x0),
              (copy_core_type x1))) x1))

and copy_row_field :
  From.Parsetree.row_field -> To.Parsetree.row_field =
  fun
    { From.Parsetree.prf_desc = prf_desc;
      From.Parsetree.prf_loc = _;
      From.Parsetree.prf_attributes = prf_attributes }
    ->
      match prf_desc with
      | From.Parsetree.Rtag (x0, x1, x2) ->
        To.Parsetree.Rtag ((copy_loc copy_label x0),
                                (copy_attributes prf_attributes),
                                (copy_bool x1),
                                (List.map copy_core_type x2))
      | From.Parsetree.Rinherit x0 ->
        To.Parsetree.Rinherit (copy_core_type x0)

and copy_object_field :
  From.Parsetree.object_field -> To.Parsetree.object_field =
  fun
    { From.Parsetree.pof_desc = pof_desc;
      From.Parsetree.pof_loc = _;
      From.Parsetree.pof_attributes = pof_attributes }
    ->
      match pof_desc with
      | From.Parsetree.Otag (x0, x1) ->
        To.Parsetree.Otag ((copy_loc copy_label x0),
                                (copy_attributes pof_attributes),
                                (copy_core_type x1))
      | From.Parsetree.Oinherit x0 ->
        To.Parsetree.Oinherit (copy_core_type x0)

and copy_attributes :
  From.Parsetree.attributes -> To.Parsetree.attributes =
  fun x  -> List.map copy_attribute x

and copy_attribute :
  From.Parsetree.attribute -> To.Parsetree.attribute =
  fun
    { From.Parsetree.attr_name = attr_name;
      From.Parsetree.attr_payload = attr_payload;
      From.Parsetree.attr_loc = _ }
    ->
      ((copy_loc (fun x  -> x) attr_name),
       (copy_payload attr_payload))

and copy_payload :
  From.Parsetree.payload -> To.Parsetree.payload =
  function
  | From.Parsetree.PStr x0 ->
      To.Parsetree.PStr (copy_structure x0)
  | From.Parsetree.PSig x0 ->
      To.Parsetree.PSig (copy_signature x0)
  | From.Parsetree.PTyp x0 ->
      To.Parsetree.PTyp (copy_core_type x0)
  | From.Parsetree.PPat (x0,x1) ->
      To.Parsetree.PPat
        ((copy_pattern x0),
          (copy_option copy_expression x1))

and copy_structure :
  From.Parsetree.structure -> To.Parsetree.structure =
  fun x  -> List.map copy_structure_item x

and copy_structure_item :
  From.Parsetree.structure_item -> To.Parsetree.structure_item =
  fun
    { From.Parsetree.pstr_desc = pstr_desc;
      From.Parsetree.pstr_loc = pstr_loc }
     ->
    {
      To.Parsetree.pstr_desc =
        (copy_structure_item_desc pstr_desc);
      To.Parsetree.pstr_loc = (copy_location pstr_loc)
    }

and copy_structure_item_desc :
  From.Parsetree.structure_item_desc ->
    To.Parsetree.structure_item_desc
  =
  function
  | From.Parsetree.Pstr_eval (x0,x1) ->
      To.Parsetree.Pstr_eval
        ((copy_expression x0),
          (copy_attributes x1))
  | From.Parsetree.Pstr_value (x0,x1) ->
      To.Parsetree.Pstr_value
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1))
  | From.Parsetree.Pstr_primitive x0 ->
      To.Parsetree.Pstr_primitive
        (copy_value_description x0)
  | From.Parsetree.Pstr_type (x0,x1) ->
      To.Parsetree.Pstr_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Pstr_typext x0 ->
      To.Parsetree.Pstr_typext
        (copy_type_extension x0)
  | From.Parsetree.Pstr_exception x0 ->
      To.Parsetree.Pstr_exception
        (let e = copy_extension_constructor
                   x0.From.Parsetree.ptyexn_constructor in
         { e with pext_attributes = e.pext_attributes @ (copy_attributes x0.ptyexn_attributes) }
        )
  | From.Parsetree.Pstr_module x0 ->
      To.Parsetree.Pstr_module
        (copy_module_binding x0)
  | From.Parsetree.Pstr_recmodule x0 ->
      To.Parsetree.Pstr_recmodule
        (List.map copy_module_binding x0)
  | From.Parsetree.Pstr_modtype x0 ->
      To.Parsetree.Pstr_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Pstr_open x0 ->
    begin match x0.From.Parsetree.popen_expr.From.Parsetree.pmod_desc with
    | Pmod_ident lid ->
      To.Parsetree.Pstr_open
        { To.Parsetree.popen_lid = (copy_loc copy_longident lid);
          To.Parsetree.popen_override = (copy_override_flag x0.From.Parsetree.popen_override);
          To.Parsetree.popen_loc = (copy_location x0.From.Parsetree.popen_loc);
          To.Parsetree.popen_attributes = (copy_attributes x0.From.Parsetree.popen_attributes); }
    | Pmod_structure _ | Pmod_functor _ | Pmod_apply _
    | Pmod_constraint _ | Pmod_unpack _ | Pmod_extension _ ->
      migration_error x0.From.Parsetree.popen_loc Def.Pexp_open
    end
  | From.Parsetree.Pstr_class x0 ->
      To.Parsetree.Pstr_class
        (List.map copy_class_declaration x0)
  | From.Parsetree.Pstr_class_type x0 ->
      To.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Pstr_include x0 ->
      To.Parsetree.Pstr_include
        (copy_include_declaration x0)
  | From.Parsetree.Pstr_attribute x0 ->
      To.Parsetree.Pstr_attribute (copy_attribute x0)
  | From.Parsetree.Pstr_extension (x0,x1) ->
      To.Parsetree.Pstr_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_include_declaration :
  From.Parsetree.include_declaration ->
    To.Parsetree.include_declaration
  =
  fun x  ->
    copy_include_infos copy_module_expr x

and copy_class_declaration :
  From.Parsetree.class_declaration -> To.Parsetree.class_declaration
  =
  fun x  ->
    copy_class_infos copy_class_expr x

and copy_class_expr :
  From.Parsetree.class_expr -> To.Parsetree.class_expr =
  fun
    { From.Parsetree.pcl_desc = pcl_desc;
      From.Parsetree.pcl_loc = pcl_loc;
      From.Parsetree.pcl_attributes = pcl_attributes }
     ->
    {
      To.Parsetree.pcl_desc =
        (copy_class_expr_desc pcl_desc);
      To.Parsetree.pcl_loc = (copy_location pcl_loc);
      To.Parsetree.pcl_attributes =
        (copy_attributes pcl_attributes)
    }

and copy_class_expr_desc :
  From.Parsetree.class_expr_desc -> To.Parsetree.class_expr_desc =
  function
  | From.Parsetree.Pcl_constr (x0,x1) ->
      To.Parsetree.Pcl_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcl_structure x0 ->
      To.Parsetree.Pcl_structure
        (copy_class_structure x0)
  | From.Parsetree.Pcl_fun (x0,x1,x2,x3) ->
      To.Parsetree.Pcl_fun
        ((copy_arg_label x0),
          (copy_option copy_expression x1),
          (copy_pattern x2),
          (copy_class_expr x3))
  | From.Parsetree.Pcl_apply (x0,x1) ->
      To.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_arg_label x0),
                  (copy_expression x1))) x1))
  | From.Parsetree.Pcl_let (x0,x1,x2) ->
      To.Parsetree.Pcl_let
        ((copy_rec_flag x0),
          (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | From.Parsetree.Pcl_constraint (x0,x1) ->
      To.Parsetree.Pcl_constraint
        ((copy_class_expr x0),
          (copy_class_type x1))
  | From.Parsetree.Pcl_extension x0 ->
      To.Parsetree.Pcl_extension (copy_extension x0)
  | From.Parsetree.Pcl_open (x0,x1) ->
    To.Parsetree.Pcl_open
      ((copy_override_flag x0.From.Parsetree.popen_override),
       (copy_loc copy_longident x0.From.Parsetree.popen_expr),
       (copy_class_expr x1))

and copy_class_structure :
  From.Parsetree.class_structure -> To.Parsetree.class_structure =
  fun
    { From.Parsetree.pcstr_self = pcstr_self;
      From.Parsetree.pcstr_fields = pcstr_fields }
     ->
    {
      To.Parsetree.pcstr_self =
        (copy_pattern pcstr_self);
      To.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }

and copy_class_field :
  From.Parsetree.class_field -> To.Parsetree.class_field =
  fun
    { From.Parsetree.pcf_desc = pcf_desc;
      From.Parsetree.pcf_loc = pcf_loc;
      From.Parsetree.pcf_attributes = pcf_attributes }
     ->
    {
      To.Parsetree.pcf_desc =
        (copy_class_field_desc pcf_desc);
      To.Parsetree.pcf_loc = (copy_location pcf_loc);
      To.Parsetree.pcf_attributes =
        (copy_attributes pcf_attributes)
    }

and copy_class_field_desc :
  From.Parsetree.class_field_desc -> To.Parsetree.class_field_desc =
  function
  | From.Parsetree.Pcf_inherit (x0,x1,x2) ->
      To.Parsetree.Pcf_inherit
        ((copy_override_flag x0),
          (copy_class_expr x1),
          (copy_option (fun x  -> copy_loc (fun x  -> x) x)
             x2))
  | From.Parsetree.Pcf_val x0 ->
      To.Parsetree.Pcf_val
        (let (x0,x1,x2) = x0  in
         ((copy_loc copy_label x0),
           (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_method x0 ->
      To.Parsetree.Pcf_method
        (let (x0,x1,x2) = x0  in
         ((copy_loc copy_label x0),
           (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | From.Parsetree.Pcf_constraint x0 ->
      To.Parsetree.Pcf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pcf_initializer x0 ->
      To.Parsetree.Pcf_initializer
        (copy_expression x0)
  | From.Parsetree.Pcf_attribute x0 ->
      To.Parsetree.Pcf_attribute (copy_attribute x0)
  | From.Parsetree.Pcf_extension x0 ->
      To.Parsetree.Pcf_extension (copy_extension x0)

and copy_class_field_kind :
  From.Parsetree.class_field_kind -> To.Parsetree.class_field_kind =
  function
  | From.Parsetree.Cfk_virtual x0 ->
      To.Parsetree.Cfk_virtual (copy_core_type x0)
  | From.Parsetree.Cfk_concrete (x0,x1) ->
      To.Parsetree.Cfk_concrete
        ((copy_override_flag x0),
          (copy_expression x1))

and copy_module_binding :
  From.Parsetree.module_binding -> To.Parsetree.module_binding =
  fun
    { From.Parsetree.pmb_name = pmb_name;
      From.Parsetree.pmb_expr = pmb_expr;
      From.Parsetree.pmb_attributes = pmb_attributes;
      From.Parsetree.pmb_loc = pmb_loc }
     ->
    {
      To.Parsetree.pmb_name =
        (copy_loc (fun x  -> x) pmb_name);
      To.Parsetree.pmb_expr =
        (copy_module_expr pmb_expr);
      To.Parsetree.pmb_attributes =
        (copy_attributes pmb_attributes);
      To.Parsetree.pmb_loc = (copy_location pmb_loc)
    }

and copy_module_expr :
  From.Parsetree.module_expr -> To.Parsetree.module_expr =
  fun
    { From.Parsetree.pmod_desc = pmod_desc;
      From.Parsetree.pmod_loc = pmod_loc;
      From.Parsetree.pmod_attributes = pmod_attributes }
     ->
    {
      To.Parsetree.pmod_desc =
        (copy_module_expr_desc pmod_desc);
      To.Parsetree.pmod_loc = (copy_location pmod_loc);
      To.Parsetree.pmod_attributes =
        (copy_attributes pmod_attributes)
    }

and copy_module_expr_desc :
  From.Parsetree.module_expr_desc -> To.Parsetree.module_expr_desc =
  function
  | From.Parsetree.Pmod_ident x0 ->
      To.Parsetree.Pmod_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmod_structure x0 ->
      To.Parsetree.Pmod_structure (copy_structure x0)
  | From.Parsetree.Pmod_functor (x0,x1,x2) ->
      To.Parsetree.Pmod_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_expr x2))
  | From.Parsetree.Pmod_apply (x0,x1) ->
      To.Parsetree.Pmod_apply
        ((copy_module_expr x0),
          (copy_module_expr x1))
  | From.Parsetree.Pmod_constraint (x0,x1) ->
      To.Parsetree.Pmod_constraint
        ((copy_module_expr x0),
          (copy_module_type x1))
  | From.Parsetree.Pmod_unpack x0 ->
      To.Parsetree.Pmod_unpack (copy_expression x0)
  | From.Parsetree.Pmod_extension x0 ->
      To.Parsetree.Pmod_extension (copy_extension x0)

and copy_module_type :
  From.Parsetree.module_type -> To.Parsetree.module_type =
  fun
    { From.Parsetree.pmty_desc = pmty_desc;
      From.Parsetree.pmty_loc = pmty_loc;
      From.Parsetree.pmty_attributes = pmty_attributes }
     ->
    {
      To.Parsetree.pmty_desc =
        (copy_module_type_desc pmty_desc);
      To.Parsetree.pmty_loc = (copy_location pmty_loc);
      To.Parsetree.pmty_attributes =
        (copy_attributes pmty_attributes)
    }

and copy_module_type_desc :
  From.Parsetree.module_type_desc -> To.Parsetree.module_type_desc =
  function
  | From.Parsetree.Pmty_ident x0 ->
      To.Parsetree.Pmty_ident
        (copy_loc copy_longident x0)
  | From.Parsetree.Pmty_signature x0 ->
      To.Parsetree.Pmty_signature (copy_signature x0)
  | From.Parsetree.Pmty_functor (x0,x1,x2) ->
      To.Parsetree.Pmty_functor
        ((copy_loc (fun x  -> x) x0),
          (copy_option copy_module_type x1),
          (copy_module_type x2))
  | From.Parsetree.Pmty_with (x0,x1) ->
      To.Parsetree.Pmty_with
        ((copy_module_type x0),
          (List.map copy_with_constraint x1))
  | From.Parsetree.Pmty_typeof x0 ->
      To.Parsetree.Pmty_typeof (copy_module_expr x0)
  | From.Parsetree.Pmty_extension x0 ->
      To.Parsetree.Pmty_extension (copy_extension x0)
  | From.Parsetree.Pmty_alias x0 ->
      To.Parsetree.Pmty_alias
        (copy_loc copy_longident x0)

and copy_with_constraint :
  From.Parsetree.with_constraint -> To.Parsetree.with_constraint =
  function
  | From.Parsetree.Pwith_type (x0,x1) ->
      To.Parsetree.Pwith_type
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_module (x0,x1) ->
      To.Parsetree.Pwith_module
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))
  | From.Parsetree.Pwith_typesubst (x0,x1) ->
      To.Parsetree.Pwith_typesubst
        ((copy_loc copy_longident x0),
          (copy_type_declaration x1))
  | From.Parsetree.Pwith_modsubst (x0,x1) ->
      To.Parsetree.Pwith_modsubst
        ((copy_loc copy_longident x0),
          (copy_loc copy_longident x1))

and copy_signature :
  From.Parsetree.signature -> To.Parsetree.signature =
  fun x  -> List.map copy_signature_item x

and copy_signature_item :
  From.Parsetree.signature_item -> To.Parsetree.signature_item =
  fun
    { From.Parsetree.psig_desc = psig_desc;
      From.Parsetree.psig_loc = psig_loc }
     ->
    {
      To.Parsetree.psig_desc =
        (copy_signature_item_desc psig_desc);
      To.Parsetree.psig_loc = (copy_location psig_loc)
    }

and copy_signature_item_desc :
  From.Parsetree.signature_item_desc ->
    To.Parsetree.signature_item_desc
  =
  function
  | From.Parsetree.Psig_value x0 ->
      To.Parsetree.Psig_value
        (copy_value_description x0)
  | From.Parsetree.Psig_type (x0,x1) ->
      To.Parsetree.Psig_type
        ((copy_rec_flag x0),
          (List.map copy_type_declaration x1))
  | From.Parsetree.Psig_typesubst x0 ->
    let x0_loc =
      match x0 with
      | [] -> Location.none
      | { From.Parsetree.ptype_loc; _ } :: _ -> ptype_loc in
    migration_error x0_loc Def.Psig_typesubst
  | From.Parsetree.Psig_typext x0 ->
      To.Parsetree.Psig_typext
        (copy_type_extension x0)
  | From.Parsetree.Psig_exception x0 ->
      To.Parsetree.Psig_exception
        (let e = copy_extension_constructor
                   x0.From.Parsetree.ptyexn_constructor in
         {e with pext_attributes = e.pext_attributes @ (copy_attributes x0.ptyexn_attributes) })
  | From.Parsetree.Psig_module x0 ->
      To.Parsetree.Psig_module
        (copy_module_declaration x0)
  | From.Parsetree.Psig_modsubst x0 ->
      migration_error x0.pms_loc Def.Psig_modsubst
  | From.Parsetree.Psig_recmodule x0 ->
      To.Parsetree.Psig_recmodule
        (List.map copy_module_declaration x0)
  | From.Parsetree.Psig_modtype x0 ->
      To.Parsetree.Psig_modtype
        (copy_module_type_declaration x0)
  | From.Parsetree.Psig_open x0 ->
      To.Parsetree.Psig_open
        (copy_open_description x0)
  | From.Parsetree.Psig_include x0 ->
      To.Parsetree.Psig_include
        (copy_include_description x0)
  | From.Parsetree.Psig_class x0 ->
      To.Parsetree.Psig_class
        (List.map copy_class_description x0)
  | From.Parsetree.Psig_class_type x0 ->
      To.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | From.Parsetree.Psig_attribute x0 ->
      To.Parsetree.Psig_attribute (copy_attribute x0)
  | From.Parsetree.Psig_extension (x0,x1) ->
      To.Parsetree.Psig_extension
        ((copy_extension x0),
          (copy_attributes x1))

and copy_class_type_declaration :
  From.Parsetree.class_type_declaration ->
    To.Parsetree.class_type_declaration
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_description :
  From.Parsetree.class_description -> To.Parsetree.class_description
  =
  fun x  ->
    copy_class_infos copy_class_type x

and copy_class_type :
  From.Parsetree.class_type -> To.Parsetree.class_type =
  fun
    { From.Parsetree.pcty_desc = pcty_desc;
      From.Parsetree.pcty_loc = pcty_loc;
      From.Parsetree.pcty_attributes = pcty_attributes }
     ->
    {
      To.Parsetree.pcty_desc =
        (copy_class_type_desc pcty_desc);
      To.Parsetree.pcty_loc = (copy_location pcty_loc);
      To.Parsetree.pcty_attributes =
        (copy_attributes pcty_attributes)
    }

and copy_class_type_desc :
  From.Parsetree.class_type_desc -> To.Parsetree.class_type_desc =
  function
  | From.Parsetree.Pcty_constr (x0,x1) ->
      To.Parsetree.Pcty_constr
        ((copy_loc copy_longident x0),
          (List.map copy_core_type x1))
  | From.Parsetree.Pcty_signature x0 ->
      To.Parsetree.Pcty_signature
        (copy_class_signature x0)
  | From.Parsetree.Pcty_arrow (x0,x1,x2) ->
      To.Parsetree.Pcty_arrow
        ((copy_arg_label x0),
          (copy_core_type x1),
          (copy_class_type x2))
  | From.Parsetree.Pcty_extension x0 ->
      To.Parsetree.Pcty_extension (copy_extension x0)
  | From.Parsetree.Pcty_open (x0,x1) ->
    To.Parsetree.Pcty_open
      ((copy_override_flag x0.From.Parsetree.popen_override),
       (copy_loc copy_longident x0.From.Parsetree.popen_expr),
       (copy_class_type x1))

and copy_class_signature :
  From.Parsetree.class_signature -> To.Parsetree.class_signature =
  fun
    { From.Parsetree.pcsig_self = pcsig_self;
      From.Parsetree.pcsig_fields = pcsig_fields }
     ->
    {
      To.Parsetree.pcsig_self =
        (copy_core_type pcsig_self);
      To.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }

and copy_class_type_field :
  From.Parsetree.class_type_field -> To.Parsetree.class_type_field =
  fun
    { From.Parsetree.pctf_desc = pctf_desc;
      From.Parsetree.pctf_loc = pctf_loc;
      From.Parsetree.pctf_attributes = pctf_attributes }
     ->
    {
      To.Parsetree.pctf_desc =
        (copy_class_type_field_desc pctf_desc);
      To.Parsetree.pctf_loc = (copy_location pctf_loc);
      To.Parsetree.pctf_attributes =
        (copy_attributes pctf_attributes)
    }

and copy_class_type_field_desc :
  From.Parsetree.class_type_field_desc ->
    To.Parsetree.class_type_field_desc
  =
  function
  | From.Parsetree.Pctf_inherit x0 ->
      To.Parsetree.Pctf_inherit (copy_class_type x0)
  | From.Parsetree.Pctf_val x0 ->
      To.Parsetree.Pctf_val
        (let (x0,x1,x2,x3) = x0  in
         ((copy_loc copy_label x0),
           (copy_mutable_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_method x0 ->
      To.Parsetree.Pctf_method
        (let (x0,x1,x2,x3) = x0  in
         ((copy_loc copy_label x0),
           (copy_private_flag x1),
           (copy_virtual_flag x2),
           (copy_core_type x3)))
  | From.Parsetree.Pctf_constraint x0 ->
      To.Parsetree.Pctf_constraint
        (let (x0,x1) = x0  in
         ((copy_core_type x0),
           (copy_core_type x1)))
  | From.Parsetree.Pctf_attribute x0 ->
      To.Parsetree.Pctf_attribute (copy_attribute x0)
  | From.Parsetree.Pctf_extension x0 ->
      To.Parsetree.Pctf_extension (copy_extension x0)

and copy_extension :
  From.Parsetree.extension -> To.Parsetree.extension =
  fun x  ->
    let (x0,x1) = x  in
    let x1 =
      match x0.txt with
        | "ocaml.error" | "error" ->
          begin match x1 with
          | PStr (hd :: tl) -> From.Parsetree.PStr (hd :: hd :: tl)
          | _ -> x1
          end
        | _ -> x1 in
    ((copy_loc (fun x  -> x) x0),
      (copy_payload x1))

and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.class_infos -> 'g0 To.Parsetree.class_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pci_virt = pci_virt;
        From.Parsetree.pci_params = pci_params;
        From.Parsetree.pci_name = pci_name;
        From.Parsetree.pci_expr = pci_expr;
        From.Parsetree.pci_loc = pci_loc;
        From.Parsetree.pci_attributes = pci_attributes }
       ->
      {
        To.Parsetree.pci_virt =
          (copy_virtual_flag pci_virt);
        To.Parsetree.pci_params =
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                ((copy_core_type x0),
                  (copy_variance x1))) pci_params);
        To.Parsetree.pci_name =
          (copy_loc (fun x  -> x) pci_name);
        To.Parsetree.pci_expr = (f0 pci_expr);
        To.Parsetree.pci_loc = (copy_location pci_loc);
        To.Parsetree.pci_attributes =
          (copy_attributes pci_attributes)
      }

and copy_virtual_flag :
  From.Asttypes.virtual_flag -> To.Asttypes.virtual_flag =
  function
  | From.Asttypes.Virtual  -> To.Asttypes.Virtual
  | From.Asttypes.Concrete  -> To.Asttypes.Concrete

and copy_include_description :
  From.Parsetree.include_description ->
    To.Parsetree.include_description
  =
  fun x  ->
    copy_include_infos copy_module_type x

and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 From.Parsetree.include_infos ->
        'g0 To.Parsetree.include_infos
  =
  fun f0  ->
    fun
      { From.Parsetree.pincl_mod = pincl_mod;
        From.Parsetree.pincl_loc = pincl_loc;
        From.Parsetree.pincl_attributes = pincl_attributes }
       ->
      {
        To.Parsetree.pincl_mod = (f0 pincl_mod);
        To.Parsetree.pincl_loc = (copy_location pincl_loc);
        To.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }

and copy_open_description :
  From.Parsetree.open_description -> To.Parsetree.open_description =
  fun
    { From.Parsetree.popen_expr = popen_expr;
      From.Parsetree.popen_override = popen_override;
      From.Parsetree.popen_loc = popen_loc;
      From.Parsetree.popen_attributes = popen_attributes }
    ->
      { To.Parsetree.popen_lid = (copy_loc copy_longident popen_expr);
        To.Parsetree.popen_override = (copy_override_flag popen_override);
        To.Parsetree.popen_loc = (copy_location popen_loc);
        To.Parsetree.popen_attributes = (copy_attributes popen_attributes); }

and copy_override_flag :
  From.Asttypes.override_flag -> To.Asttypes.override_flag =
  function
  | From.Asttypes.Override  -> To.Asttypes.Override
  | From.Asttypes.Fresh  -> To.Asttypes.Fresh

and copy_module_type_declaration :
  From.Parsetree.module_type_declaration ->
    To.Parsetree.module_type_declaration
  =
  fun
    { From.Parsetree.pmtd_name = pmtd_name;
      From.Parsetree.pmtd_type = pmtd_type;
      From.Parsetree.pmtd_attributes = pmtd_attributes;
      From.Parsetree.pmtd_loc = pmtd_loc }
     ->
    {
      To.Parsetree.pmtd_name =
        (copy_loc (fun x  -> x) pmtd_name);
      To.Parsetree.pmtd_type =
        (copy_option copy_module_type pmtd_type);
      To.Parsetree.pmtd_attributes =
        (copy_attributes pmtd_attributes);
      To.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }

and copy_module_declaration :
  From.Parsetree.module_declaration ->
    To.Parsetree.module_declaration
  =
  fun
    { From.Parsetree.pmd_name = pmd_name;
      From.Parsetree.pmd_type = pmd_type;
      From.Parsetree.pmd_attributes = pmd_attributes;
      From.Parsetree.pmd_loc = pmd_loc }
     ->
    {
      To.Parsetree.pmd_name =
        (copy_loc (fun x  -> x) pmd_name);
      To.Parsetree.pmd_type =
        (copy_module_type pmd_type);
      To.Parsetree.pmd_attributes =
        (copy_attributes pmd_attributes);
      To.Parsetree.pmd_loc = (copy_location pmd_loc)
    }

(* and copy_type_exception :
  From.Parsetree.type_exception -> To.Parsetree.type_exception =
  fun
    { From.Parsetree.ptyexn_constructor = ptyexn_constructor;
      From.Parsetree.ptyexn_loc = ptyexn_loc;
      From.Parsetree.ptyexn_attributes = ptyexn_attributes }
     ->
    {
      To.Parsetree.ptyexn_constructor =
        (copy_extension_constructor ptyexn_constructor);
      To.Parsetree.ptyexn_loc = (copy_location ptyexn_loc);
      To.Parsetree.ptyexn_attributes =
        (copy_attributes ptyexn_attributes)
    }*)

and copy_type_extension :
  From.Parsetree.type_extension -> To.Parsetree.type_extension =
  fun
    { From.Parsetree.ptyext_path = ptyext_path;
      From.Parsetree.ptyext_params = ptyext_params;
      From.Parsetree.ptyext_constructors = ptyext_constructors;
      From.Parsetree.ptyext_private = ptyext_private;
      From.Parsetree.ptyext_loc = _;
      From.Parsetree.ptyext_attributes = ptyext_attributes }
     ->
    {
      To.Parsetree.ptyext_path =
        (copy_loc copy_longident ptyext_path);
      To.Parsetree.ptyext_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptyext_params);
      To.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor
           ptyext_constructors);
      To.Parsetree.ptyext_private =
        (copy_private_flag ptyext_private);
      To.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }

and copy_extension_constructor :
  From.Parsetree.extension_constructor ->
    To.Parsetree.extension_constructor
  =
  fun
    { From.Parsetree.pext_name = pext_name;
      From.Parsetree.pext_kind = pext_kind;
      From.Parsetree.pext_loc = pext_loc;
      From.Parsetree.pext_attributes = pext_attributes }
     ->
    {
      To.Parsetree.pext_name =
        (copy_loc (fun x  -> x) pext_name);
      To.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      To.Parsetree.pext_loc = (copy_location pext_loc);
      To.Parsetree.pext_attributes =
        (copy_attributes pext_attributes)
    }

and copy_extension_constructor_kind :
  From.Parsetree.extension_constructor_kind ->
    To.Parsetree.extension_constructor_kind
  =
  function
  | From.Parsetree.Pext_decl (x0,x1) ->
      To.Parsetree.Pext_decl
        ((copy_constructor_arguments x0),
          (copy_option copy_core_type x1))
  | From.Parsetree.Pext_rebind x0 ->
      To.Parsetree.Pext_rebind
        (copy_loc copy_longident x0)

and copy_type_declaration :
  From.Parsetree.type_declaration -> To.Parsetree.type_declaration =
  fun
    { From.Parsetree.ptype_name = ptype_name;
      From.Parsetree.ptype_params = ptype_params;
      From.Parsetree.ptype_cstrs = ptype_cstrs;
      From.Parsetree.ptype_kind = ptype_kind;
      From.Parsetree.ptype_private = ptype_private;
      From.Parsetree.ptype_manifest = ptype_manifest;
      From.Parsetree.ptype_attributes = ptype_attributes;
      From.Parsetree.ptype_loc = ptype_loc }
     ->
    {
      To.Parsetree.ptype_name =
        (copy_loc (fun x  -> x) ptype_name);
      To.Parsetree.ptype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_core_type x0),
                (copy_variance x1))) ptype_params);
      To.Parsetree.ptype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              ((copy_core_type x0),
                (copy_core_type x1),
                (copy_location x2))) ptype_cstrs);
      To.Parsetree.ptype_kind =
        (copy_type_kind ptype_kind);
      To.Parsetree.ptype_private =
        (copy_private_flag ptype_private);
      To.Parsetree.ptype_manifest =
        (copy_option copy_core_type ptype_manifest);
      To.Parsetree.ptype_attributes =
        (copy_attributes ptype_attributes);
      To.Parsetree.ptype_loc = (copy_location ptype_loc)
    }

and copy_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_type_kind :
  From.Parsetree.type_kind -> To.Parsetree.type_kind =
  function
  | From.Parsetree.Ptype_abstract  -> To.Parsetree.Ptype_abstract
  | From.Parsetree.Ptype_variant x0 ->
      To.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | From.Parsetree.Ptype_record x0 ->
      To.Parsetree.Ptype_record
        (List.map copy_label_declaration x0)
  | From.Parsetree.Ptype_open  -> To.Parsetree.Ptype_open

and copy_constructor_declaration :
  From.Parsetree.constructor_declaration ->
    To.Parsetree.constructor_declaration
  =
  fun
    { From.Parsetree.pcd_name = pcd_name;
      From.Parsetree.pcd_args = pcd_args;
      From.Parsetree.pcd_res = pcd_res;
      From.Parsetree.pcd_loc = pcd_loc;
      From.Parsetree.pcd_attributes = pcd_attributes }
     ->
    {
      To.Parsetree.pcd_name =
        (copy_loc (fun x  -> x) pcd_name);
      To.Parsetree.pcd_args =
        (copy_constructor_arguments pcd_args);
      To.Parsetree.pcd_res =
        (copy_option copy_core_type pcd_res);
      To.Parsetree.pcd_loc = (copy_location pcd_loc);
      To.Parsetree.pcd_attributes =
        (copy_attributes pcd_attributes)
    }

and copy_constructor_arguments :
  From.Parsetree.constructor_arguments ->
    To.Parsetree.constructor_arguments
  =
  function
  | From.Parsetree.Pcstr_tuple x0 ->
      To.Parsetree.Pcstr_tuple
        (List.map copy_core_type x0)
  | From.Parsetree.Pcstr_record x0 ->
      To.Parsetree.Pcstr_record
        (List.map copy_label_declaration x0)

and copy_label_declaration :
  From.Parsetree.label_declaration -> To.Parsetree.label_declaration
  =
  fun
    { From.Parsetree.pld_name = pld_name;
      From.Parsetree.pld_mutable = pld_mutable;
      From.Parsetree.pld_type = pld_type;
      From.Parsetree.pld_loc = pld_loc;
      From.Parsetree.pld_attributes = pld_attributes }
     ->
    {
      To.Parsetree.pld_name =
        (copy_loc (fun x  -> x) pld_name);
      To.Parsetree.pld_mutable =
        (copy_mutable_flag pld_mutable);
      To.Parsetree.pld_type =
        (copy_core_type pld_type);
      To.Parsetree.pld_loc = (copy_location pld_loc);
      To.Parsetree.pld_attributes =
        (copy_attributes pld_attributes)
    }

and copy_mutable_flag :
  From.Asttypes.mutable_flag -> To.Asttypes.mutable_flag =
  function
  | From.Asttypes.Immutable  -> To.Asttypes.Immutable
  | From.Asttypes.Mutable  -> To.Asttypes.Mutable

and copy_variance :
  From.Asttypes.variance -> To.Asttypes.variance =
  function
  | From.Asttypes.Covariant  -> To.Asttypes.Covariant
  | From.Asttypes.Contravariant  -> To.Asttypes.Contravariant
  | From.Asttypes.Invariant  -> To.Asttypes.Invariant

and copy_value_description :
  From.Parsetree.value_description -> To.Parsetree.value_description
  =
  fun
    { From.Parsetree.pval_name = pval_name;
      From.Parsetree.pval_type = pval_type;
      From.Parsetree.pval_prim = pval_prim;
      From.Parsetree.pval_attributes = pval_attributes;
      From.Parsetree.pval_loc = pval_loc }
     ->
    {
      To.Parsetree.pval_name =
        (copy_loc (fun x  -> x) pval_name);
      To.Parsetree.pval_type =
        (copy_core_type pval_type);
      To.Parsetree.pval_prim = (List.map (fun x  -> x) pval_prim);
      To.Parsetree.pval_attributes =
        (copy_attributes pval_attributes);
      To.Parsetree.pval_loc = (copy_location pval_loc)
    }

and copy_arg_label :
  From.Asttypes.arg_label -> To.Asttypes.arg_label =
  function
  | From.Asttypes.Nolabel  -> To.Asttypes.Nolabel
  | From.Asttypes.Labelled x0 -> To.Asttypes.Labelled x0
  | From.Asttypes.Optional x0 -> To.Asttypes.Optional x0

and copy_closed_flag :
  From.Asttypes.closed_flag -> To.Asttypes.closed_flag =
  function
  | From.Asttypes.Closed  -> To.Asttypes.Closed
  | From.Asttypes.Open  -> To.Asttypes.Open

and copy_label :
  From.Asttypes.label -> To.Asttypes.label = fun x  -> x

and copy_rec_flag :
  From.Asttypes.rec_flag -> To.Asttypes.rec_flag =
  function
  | From.Asttypes.Nonrecursive  -> To.Asttypes.Nonrecursive
  | From.Asttypes.Recursive  -> To.Asttypes.Recursive

and copy_constant :
  From.Parsetree.constant -> To.Parsetree.constant =
  function
  | From.Parsetree.Pconst_integer (x0,x1) ->
      To.Parsetree.Pconst_integer (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_char x0 -> To.Parsetree.Pconst_char x0
  | From.Parsetree.Pconst_string (x0,x1) ->
      To.Parsetree.Pconst_string (x0, (copy_option (fun x  -> x) x1))
  | From.Parsetree.Pconst_float (x0,x1) ->
      To.Parsetree.Pconst_float (x0, (copy_option (fun x  -> x) x1))

and copy_option : 'f0 'g0 . ('f0 -> 'g0) -> 'f0 option -> 'g0 option =
  fun f0  -> function | None  -> None | Some x0 -> Some (f0 x0)

and copy_longident : From.Longident.t -> To.Longident.t =
  function
  | From.Longident.Lident x0 -> To.Longident.Lident x0
  | From.Longident.Ldot (x0,x1) ->
      To.Longident.Ldot ((copy_longident x0), x1)
  | From.Longident.Lapply (x0,x1) ->
      To.Longident.Lapply
        ((copy_longident x0), (copy_longident x1))

and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 From.Asttypes.loc -> 'g0 To.Asttypes.loc
  =
  fun f0  ->
    fun { From.Asttypes.txt = txt; From.Asttypes.loc = loc }  ->
      {
        To.Asttypes.txt = (f0 txt);
        To.Asttypes.loc = (copy_location loc)
      }

and copy_location : From.Location.t -> To.Location.t =
  fun
    { From.Location.loc_start = loc_start;
      From.Location.loc_end = loc_end;
      From.Location.loc_ghost = loc_ghost }
     ->
    {
      To.Location.loc_start = (copy_Lexing_position loc_start);
      To.Location.loc_end = (copy_Lexing_position loc_end);
      To.Location.loc_ghost = (copy_bool loc_ghost)
    }

and copy_bool : bool -> bool = function | false  -> false | true  -> true

and copy_Lexing_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
     ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

let copy_cases x = List.map copy_case x
let copy_pat = copy_pattern
let copy_expr = copy_expression
let copy_typ = copy_core_type

let rec copy_out_phrase :
  From.Outcometree.out_phrase -> To.Outcometree.out_phrase =
  function
  | From.Outcometree.Ophr_eval (x0,x1) ->
      To.Outcometree.Ophr_eval
        ((copy_out_value x0),
          (copy_out_type x1))
  | From.Outcometree.Ophr_signature x0 ->
      To.Outcometree.Ophr_signature
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_sig_item x0),
                (copy_option copy_out_value x1))) x0)
  | From.Outcometree.Ophr_exception x0 ->
      To.Outcometree.Ophr_exception
        (let (x0,x1) = x0  in
         ((copy_exn x0), (copy_out_value x1)))

and copy_exn : exn -> exn = fun x  -> x

and copy_out_sig_item :
  From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item =
  function
  | From.Outcometree.Osig_class (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_class_type (x0,x1,x2,x3,x4) ->
      To.Outcometree.Osig_class_type
        ((copy_bool x0), x1,
          (List.map
             (fun x  ->
                let (x0,x1) = x  in
                (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
             x2), (copy_out_class_type x3),
          (copy_out_rec_status x4))
  | From.Outcometree.Osig_typext (x0,x1) ->
      To.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0),
          (copy_out_ext_status x1))
  | From.Outcometree.Osig_modtype (x0,x1) ->
      To.Outcometree.Osig_modtype
        (x0, (copy_out_module_type x1))
  | From.Outcometree.Osig_module (x0,x1,x2) ->
      To.Outcometree.Osig_module
        (x0, (copy_out_module_type x1),
          (copy_out_rec_status x2))
  | From.Outcometree.Osig_type (x0,x1) ->
      To.Outcometree.Osig_type
        ((copy_out_type_decl x0),
          (copy_out_rec_status x1))
  | From.Outcometree.Osig_value x0 ->
      To.Outcometree.Osig_value
        (copy_out_val_decl x0)
  | From.Outcometree.Osig_ellipsis  -> To.Outcometree.Osig_ellipsis

and copy_out_val_decl :
  From.Outcometree.out_val_decl -> To.Outcometree.out_val_decl =
  fun
    { From.Outcometree.oval_name = oval_name;
      From.Outcometree.oval_type = oval_type;
      From.Outcometree.oval_prims = oval_prims;
      From.Outcometree.oval_attributes = oval_attributes }
     ->
    {
      To.Outcometree.oval_name = oval_name;
      To.Outcometree.oval_type =
        (copy_out_type oval_type);
      To.Outcometree.oval_prims = (List.map (fun x  -> x) oval_prims);
      To.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }

and copy_out_type_decl :
  From.Outcometree.out_type_decl -> To.Outcometree.out_type_decl =
  fun
    { From.Outcometree.otype_name = otype_name;
      From.Outcometree.otype_params = otype_params;
      From.Outcometree.otype_type = otype_type;
      From.Outcometree.otype_private = otype_private;
      From.Outcometree.otype_immediate = otype_immediate;
      From.Outcometree.otype_unboxed = otype_unboxed;
      From.Outcometree.otype_cstrs = otype_cstrs }
     ->
    {
      To.Outcometree.otype_name = otype_name;
      To.Outcometree.otype_params =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              (x0, (let (x0,x1) = x1  in ((copy_bool x0), (copy_bool x1)))))
           otype_params);
      To.Outcometree.otype_type =
        (copy_out_type otype_type);
      To.Outcometree.otype_private =
        (copy_From_Asttypes_private_flag otype_private);
      To.Outcometree.otype_immediate = (copy_bool otype_immediate);
      To.Outcometree.otype_unboxed = (copy_bool otype_unboxed);
      To.Outcometree.otype_cstrs =
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_type x0),
                (copy_out_type x1))) otype_cstrs)
    }

and copy_out_module_type :
  From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  =
  function
  | From.Outcometree.Omty_abstract  -> To.Outcometree.Omty_abstract
  | From.Outcometree.Omty_functor (x0,x1,x2) ->
      To.Outcometree.Omty_functor
        (x0, (copy_option copy_out_module_type x1),
          (copy_out_module_type x2))
  | From.Outcometree.Omty_ident x0 ->
      To.Outcometree.Omty_ident (copy_out_ident x0)
  | From.Outcometree.Omty_signature x0 ->
      To.Outcometree.Omty_signature
        (List.map copy_out_sig_item x0)
  | From.Outcometree.Omty_alias x0 ->
      To.Outcometree.Omty_alias (copy_out_ident x0)

and copy_out_ext_status :
  From.Outcometree.out_ext_status -> To.Outcometree.out_ext_status =
  function
  | From.Outcometree.Oext_first  -> To.Outcometree.Oext_first
  | From.Outcometree.Oext_next  -> To.Outcometree.Oext_next
  | From.Outcometree.Oext_exception  -> To.Outcometree.Oext_exception

and copy_out_extension_constructor :
  From.Outcometree.out_extension_constructor ->
    To.Outcometree.out_extension_constructor
  =
  fun
    { From.Outcometree.oext_name = oext_name;
      From.Outcometree.oext_type_name = oext_type_name;
      From.Outcometree.oext_type_params = oext_type_params;
      From.Outcometree.oext_args = oext_args;
      From.Outcometree.oext_ret_type = oext_ret_type;
      From.Outcometree.oext_private = oext_private }
     ->
    {
      To.Outcometree.oext_name = oext_name;
      To.Outcometree.oext_type_name = oext_type_name;
      To.Outcometree.oext_type_params =
        (List.map (fun x  -> x) oext_type_params);
      To.Outcometree.oext_args =
        (List.map copy_out_type oext_args);
      To.Outcometree.oext_ret_type =
        (copy_option copy_out_type oext_ret_type);
      To.Outcometree.oext_private =
        (copy_From_Asttypes_private_flag oext_private)
    }

and copy_From_Asttypes_private_flag :
  From.Asttypes.private_flag -> To.Asttypes.private_flag =
  function
  | From.Asttypes.Private  -> To.Asttypes.Private
  | From.Asttypes.Public  -> To.Asttypes.Public

and copy_out_rec_status :
  From.Outcometree.out_rec_status -> To.Outcometree.out_rec_status =
  function
  | From.Outcometree.Orec_not  -> To.Outcometree.Orec_not
  | From.Outcometree.Orec_first  -> To.Outcometree.Orec_first
  | From.Outcometree.Orec_next  -> To.Outcometree.Orec_next

and copy_out_class_type :
  From.Outcometree.out_class_type -> To.Outcometree.out_class_type =
  function
  | From.Outcometree.Octy_constr (x0,x1) ->
      To.Outcometree.Octy_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Octy_arrow (x0,x1,x2) ->
      To.Outcometree.Octy_arrow
        (x0, (copy_out_type x1),
          (copy_out_class_type x2))
  | From.Outcometree.Octy_signature (x0,x1) ->
      To.Outcometree.Octy_signature
        ((copy_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))

and copy_out_class_sig_item :
  From.Outcometree.out_class_sig_item ->
    To.Outcometree.out_class_sig_item
  =
  function
  | From.Outcometree.Ocsg_constraint (x0,x1) ->
      To.Outcometree.Ocsg_constraint
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Ocsg_method (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_method
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))
  | From.Outcometree.Ocsg_value (x0,x1,x2,x3) ->
      To.Outcometree.Ocsg_value
        (x0, (copy_bool x1), (copy_bool x2),
          (copy_out_type x3))

and copy_out_type :
  From.Outcometree.out_type -> To.Outcometree.out_type =
  function
  | From.Outcometree.Otyp_abstract  -> To.Outcometree.Otyp_abstract
  | From.Outcometree.Otyp_open  -> To.Outcometree.Otyp_open
  | From.Outcometree.Otyp_alias (x0,x1) ->
      To.Outcometree.Otyp_alias
        ((copy_out_type x0), x1)
  | From.Outcometree.Otyp_arrow (x0,x1,x2) ->
      To.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1),
          (copy_out_type x2))
  | From.Outcometree.Otyp_class (x0,x1,x2) ->
      To.Outcometree.Otyp_class
        ((copy_bool x0), (copy_out_ident x1),
          (List.map copy_out_type x2))
  | From.Outcometree.Otyp_constr (x0,x1) ->
      To.Outcometree.Otyp_constr
        ((copy_out_ident x0),
          (List.map copy_out_type x1))
  | From.Outcometree.Otyp_manifest (x0,x1) ->
      To.Outcometree.Otyp_manifest
        ((copy_out_type x0),
          (copy_out_type x1))
  | From.Outcometree.Otyp_object (x0,x1) ->
      To.Outcometree.Otyp_object
        ((List.map
            (fun x  ->
               let (x0,x1) = x  in
               (x0, (copy_out_type x1))) x0),
          (copy_option copy_bool x1))
  | From.Outcometree.Otyp_record x0 ->
      To.Outcometree.Otyp_record
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1), (copy_out_type x2)))
           x0)
  | From.Outcometree.Otyp_stuff x0 -> To.Outcometree.Otyp_stuff x0
  | From.Outcometree.Otyp_sum x0 ->
      To.Outcometree.Otyp_sum
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2))) x0)
  | From.Outcometree.Otyp_tuple x0 ->
      To.Outcometree.Otyp_tuple
        (List.map copy_out_type x0)
  | From.Outcometree.Otyp_var (x0,x1) ->
      To.Outcometree.Otyp_var ((copy_bool x0), x1)
  | From.Outcometree.Otyp_variant (x0,x1,x2,x3) ->
      To.Outcometree.Otyp_variant
        ((copy_bool x0), (copy_out_variant x1),
          (copy_bool x2),
          (copy_option (fun x  -> List.map (fun x  -> x) x) x3))
  | From.Outcometree.Otyp_poly (x0,x1) ->
      To.Outcometree.Otyp_poly
        ((List.map (fun x  -> x) x0), (copy_out_type x1))
  | From.Outcometree.Otyp_module (x0,x1,x2) ->
      To.Outcometree.Otyp_module
        ((match x0 with
           | Oide_ident id -> id.From.Outcometree.printed_name
           | From.Outcometree.Oide_apply _
           | From.Outcometree.Oide_dot _ ->
             migration_error Location.none Def.Otyp_module),
         (List.map (fun x  -> x) x1),
         (List.map copy_out_type x2))
  | From.Outcometree.Otyp_attribute (x0,x1) ->
      To.Outcometree.Otyp_attribute
        ((copy_out_type x0),
          (copy_out_attribute x1))

and copy_out_string :
  From.Outcometree.out_string -> To.Outcometree.out_string =
  function
  | From.Outcometree.Ostr_string -> To.Outcometree.Ostr_string
  | From.Outcometree.Ostr_bytes -> To.Outcometree.Ostr_bytes

and copy_out_attribute :
  From.Outcometree.out_attribute -> To.Outcometree.out_attribute =
  fun { From.Outcometree.oattr_name = oattr_name }  ->
    { To.Outcometree.oattr_name = oattr_name }

and copy_out_variant :
  From.Outcometree.out_variant -> To.Outcometree.out_variant =
  function
  | From.Outcometree.Ovar_fields x0 ->
      To.Outcometree.Ovar_fields
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (copy_bool x1),
                (List.map copy_out_type x2))) x0)
  | From.Outcometree.Ovar_typ x0 ->
      To.Outcometree.Ovar_typ (copy_out_type x0)

and copy_out_value :
  From.Outcometree.out_value -> To.Outcometree.out_value =
  function
  | From.Outcometree.Oval_array x0 ->
      To.Outcometree.Oval_array
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_char x0 -> To.Outcometree.Oval_char x0
  | From.Outcometree.Oval_constr (x0,x1) ->
      To.Outcometree.Oval_constr
        ((copy_out_ident x0),
          (List.map copy_out_value x1))
  | From.Outcometree.Oval_ellipsis  -> To.Outcometree.Oval_ellipsis
  | From.Outcometree.Oval_float x0 ->
      To.Outcometree.Oval_float (copy_float x0)
  | From.Outcometree.Oval_int x0 -> To.Outcometree.Oval_int x0
  | From.Outcometree.Oval_int32 x0 -> To.Outcometree.Oval_int32 x0
  | From.Outcometree.Oval_int64 x0 -> To.Outcometree.Oval_int64 x0
  | From.Outcometree.Oval_nativeint x0 ->
      To.Outcometree.Oval_nativeint x0
  | From.Outcometree.Oval_list x0 ->
      To.Outcometree.Oval_list
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_printer x0 ->
      To.Outcometree.Oval_printer x0
  | From.Outcometree.Oval_record x0 ->
      To.Outcometree.Oval_record
        (List.map
           (fun x  ->
              let (x0,x1) = x  in
              ((copy_out_ident x0),
                (copy_out_value x1))) x0)
  | From.Outcometree.Oval_string (x0, x1, x2) ->
      To.Outcometree.Oval_string (x0, x1, copy_out_string x2)
  | From.Outcometree.Oval_stuff x0 -> To.Outcometree.Oval_stuff x0
  | From.Outcometree.Oval_tuple x0 ->
      To.Outcometree.Oval_tuple
        (List.map copy_out_value x0)
  | From.Outcometree.Oval_variant (x0,x1) ->
      To.Outcometree.Oval_variant
        (x0, (copy_option copy_out_value x1))

and copy_float : float -> float = fun x  -> x

and copy_out_ident :
  From.Outcometree.out_ident -> To.Outcometree.out_ident =
  function
  | From.Outcometree.Oide_apply (x0,x1) ->
      To.Outcometree.Oide_apply
        ((copy_out_ident x0),
          (copy_out_ident x1))
  | From.Outcometree.Oide_dot (x0,x1) ->
      To.Outcometree.Oide_dot
        ((copy_out_ident x0), x1)
  | From.Outcometree.Oide_ident x0 -> To.Outcometree.Oide_ident x0.From.Outcometree.printed_name

let copy_out_type_extension :
  From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension =
  fun
    { From.Outcometree.otyext_name = otyext_name;
      From.Outcometree.otyext_params = otyext_params;
      From.Outcometree.otyext_constructors = otyext_constructors;
      From.Outcometree.otyext_private = otyext_private }
     ->
    {
      To.Outcometree.otyext_name = otyext_name;
      To.Outcometree.otyext_params =
        (List.map (fun x  -> x) otyext_params);
      To.Outcometree.otyext_constructors =
        (List.map
           (fun x  ->
              let (x0,x1,x2) = x  in
              (x0, (List.map copy_out_type x1),
                (copy_option copy_out_type x2)))
           otyext_constructors);
      To.Outcometree.otyext_private =
        (copy_private_flag otyext_private)
    }

end
module Migrate_parsetree_407_408
= struct
#1 "migrate_parsetree_407_408.ml"
# 1 "src/migrate_parsetree_407_408.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_407_408_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
   } as mapper) ->
  let module Def = Migrate_parsetree_def in
  let migration_error location feature =
    raise (Def.Migration_error (feature, location)) in
  let module R = Migrate_parsetree_408_407_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
    (* The following ones were introduced in 4.08. *)
    binding_op = (fun _ x -> migration_error x.pbop_op.Location.loc Def.Pexp_letop);
    module_substitution = (fun _ x -> migration_error x.pms_loc Def.Psig_modsubst);
    open_declaration = (fun _ x -> migration_error x.popen_loc Def.Pexp_open);
    type_exception = (fun _ x -> migration_error x.ptyexn_loc Def.Psig_typesubst);
  }

end
module Migrate_parsetree_408_407
= struct
#1 "migrate_parsetree_408_407.ml"
# 1 "src/migrate_parsetree_408_407.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_408_407_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     (*$*)
     (* The following ones were introduced in 4.08. *)
     binding_op = _;
     module_substitution = _;
     open_declaration = _;
     type_exception = _;
   } as mapper) ->
  let module R = Migrate_parsetree_407_408_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    (*$*)
  }

end
module Migrate_parsetree_408_409_migrate
= struct
#1 "migrate_parsetree_408_409_migrate.ml"
# 1 "src/migrate_parsetree_408_409_migrate.ml"
open Stdlib0
module From = Ast_408
module To = Ast_409
let rec copy_out_type_extension :
  Ast_408.Outcometree.out_type_extension ->
    Ast_409.Outcometree.out_type_extension
  =
  fun
    { Ast_408.Outcometree.otyext_name = otyext_name;
      Ast_408.Outcometree.otyext_params = otyext_params;
      Ast_408.Outcometree.otyext_constructors = otyext_constructors;
      Ast_408.Outcometree.otyext_private = otyext_private }
    ->
    {
      Ast_409.Outcometree.otyext_name = otyext_name;
      Ast_409.Outcometree.otyext_params =
        (List.map (fun x -> x) otyext_params);
      Ast_409.Outcometree.otyext_constructors =
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              (x0, (List.map copy_out_type x1),
                (Option.map copy_out_type x2))) otyext_constructors);
      Ast_409.Outcometree.otyext_private = (copy_private_flag otyext_private)
    }
and copy_out_phrase :
  Ast_408.Outcometree.out_phrase -> Ast_409.Outcometree.out_phrase =
  function
  | Ast_408.Outcometree.Ophr_eval (x0, x1) ->
      Ast_409.Outcometree.Ophr_eval ((copy_out_value x0), (copy_out_type x1))
  | Ast_408.Outcometree.Ophr_signature x0 ->
      Ast_409.Outcometree.Ophr_signature
        (List.map
           (fun x ->
              let (x0, x1) = x in
              ((copy_out_sig_item x0), (Option.map copy_out_value x1))) x0)
  | Ast_408.Outcometree.Ophr_exception x0 ->
      Ast_409.Outcometree.Ophr_exception
        (let (x0, x1) = x0 in (x0, (copy_out_value x1)))
and copy_out_sig_item :
  Ast_408.Outcometree.out_sig_item -> Ast_409.Outcometree.out_sig_item =
  function
  | Ast_408.Outcometree.Osig_class (x0, x1, x2, x3, x4) ->
      Ast_409.Outcometree.Osig_class
        (x0, x1,
          (List.map
             (fun x ->
                let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1)))) x2),
          (copy_out_class_type x3), (copy_out_rec_status x4))
  | Ast_408.Outcometree.Osig_class_type (x0, x1, x2, x3, x4) ->
      Ast_409.Outcometree.Osig_class_type
        (x0, x1,
          (List.map
             (fun x ->
                let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1)))) x2),
          (copy_out_class_type x3), (copy_out_rec_status x4))
  | Ast_408.Outcometree.Osig_typext (x0, x1) ->
      Ast_409.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0), (copy_out_ext_status x1))
  | Ast_408.Outcometree.Osig_modtype (x0, x1) ->
      Ast_409.Outcometree.Osig_modtype (x0, (copy_out_module_type x1))
  | Ast_408.Outcometree.Osig_module (x0, x1, x2) ->
      Ast_409.Outcometree.Osig_module
        (x0, (copy_out_module_type x1), (copy_out_rec_status x2))
  | Ast_408.Outcometree.Osig_type (x0, x1) ->
      Ast_409.Outcometree.Osig_type
        ((copy_out_type_decl x0), (copy_out_rec_status x1))
  | Ast_408.Outcometree.Osig_value x0 ->
      Ast_409.Outcometree.Osig_value (copy_out_val_decl x0)
  | Ast_408.Outcometree.Osig_ellipsis -> Ast_409.Outcometree.Osig_ellipsis
and copy_out_val_decl :
  Ast_408.Outcometree.out_val_decl -> Ast_409.Outcometree.out_val_decl =
  fun
    { Ast_408.Outcometree.oval_name = oval_name;
      Ast_408.Outcometree.oval_type = oval_type;
      Ast_408.Outcometree.oval_prims = oval_prims;
      Ast_408.Outcometree.oval_attributes = oval_attributes }
    ->
    {
      Ast_409.Outcometree.oval_name = oval_name;
      Ast_409.Outcometree.oval_type = (copy_out_type oval_type);
      Ast_409.Outcometree.oval_prims = (List.map (fun x -> x) oval_prims);
      Ast_409.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }
and copy_out_type_decl :
  Ast_408.Outcometree.out_type_decl -> Ast_409.Outcometree.out_type_decl =
  fun
    { Ast_408.Outcometree.otype_name = otype_name;
      Ast_408.Outcometree.otype_params = otype_params;
      Ast_408.Outcometree.otype_type = otype_type;
      Ast_408.Outcometree.otype_private = otype_private;
      Ast_408.Outcometree.otype_immediate = otype_immediate;
      Ast_408.Outcometree.otype_unboxed = otype_unboxed;
      Ast_408.Outcometree.otype_cstrs = otype_cstrs }
    ->
    {
      Ast_409.Outcometree.otype_name = otype_name;
      Ast_409.Outcometree.otype_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1))))
           otype_params);
      Ast_409.Outcometree.otype_type = (copy_out_type otype_type);
      Ast_409.Outcometree.otype_private = (copy_private_flag otype_private);
      Ast_409.Outcometree.otype_immediate = otype_immediate;
      Ast_409.Outcometree.otype_unboxed = otype_unboxed;
      Ast_409.Outcometree.otype_cstrs =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_out_type x0), (copy_out_type x1)))
           otype_cstrs)
    }
and copy_out_module_type :
  Ast_408.Outcometree.out_module_type -> Ast_409.Outcometree.out_module_type
  =
  function
  | Ast_408.Outcometree.Omty_abstract -> Ast_409.Outcometree.Omty_abstract
  | Ast_408.Outcometree.Omty_functor (x0, x1, x2) ->
      Ast_409.Outcometree.Omty_functor
        (x0, (Option.map copy_out_module_type x1), (copy_out_module_type x2))
  | Ast_408.Outcometree.Omty_ident x0 ->
      Ast_409.Outcometree.Omty_ident (copy_out_ident x0)
  | Ast_408.Outcometree.Omty_signature x0 ->
      Ast_409.Outcometree.Omty_signature (List.map copy_out_sig_item x0)
  | Ast_408.Outcometree.Omty_alias x0 ->
      Ast_409.Outcometree.Omty_alias (copy_out_ident x0)
and copy_out_ext_status :
  Ast_408.Outcometree.out_ext_status -> Ast_409.Outcometree.out_ext_status =
  function
  | Ast_408.Outcometree.Oext_first -> Ast_409.Outcometree.Oext_first
  | Ast_408.Outcometree.Oext_next -> Ast_409.Outcometree.Oext_next
  | Ast_408.Outcometree.Oext_exception -> Ast_409.Outcometree.Oext_exception
and copy_out_extension_constructor :
  Ast_408.Outcometree.out_extension_constructor ->
    Ast_409.Outcometree.out_extension_constructor
  =
  fun
    { Ast_408.Outcometree.oext_name = oext_name;
      Ast_408.Outcometree.oext_type_name = oext_type_name;
      Ast_408.Outcometree.oext_type_params = oext_type_params;
      Ast_408.Outcometree.oext_args = oext_args;
      Ast_408.Outcometree.oext_ret_type = oext_ret_type;
      Ast_408.Outcometree.oext_private = oext_private }
    ->
    {
      Ast_409.Outcometree.oext_name = oext_name;
      Ast_409.Outcometree.oext_type_name = oext_type_name;
      Ast_409.Outcometree.oext_type_params =
        (List.map (fun x -> x) oext_type_params);
      Ast_409.Outcometree.oext_args = (List.map copy_out_type oext_args);
      Ast_409.Outcometree.oext_ret_type =
        (Option.map copy_out_type oext_ret_type);
      Ast_409.Outcometree.oext_private = (copy_private_flag oext_private)
    }
and copy_out_rec_status :
  Ast_408.Outcometree.out_rec_status -> Ast_409.Outcometree.out_rec_status =
  function
  | Ast_408.Outcometree.Orec_not -> Ast_409.Outcometree.Orec_not
  | Ast_408.Outcometree.Orec_first -> Ast_409.Outcometree.Orec_first
  | Ast_408.Outcometree.Orec_next -> Ast_409.Outcometree.Orec_next
and copy_out_class_type :
  Ast_408.Outcometree.out_class_type -> Ast_409.Outcometree.out_class_type =
  function
  | Ast_408.Outcometree.Octy_constr (x0, x1) ->
      Ast_409.Outcometree.Octy_constr
        ((copy_out_ident x0), (List.map copy_out_type x1))
  | Ast_408.Outcometree.Octy_arrow (x0, x1, x2) ->
      Ast_409.Outcometree.Octy_arrow
        (x0, (copy_out_type x1), (copy_out_class_type x2))
  | Ast_408.Outcometree.Octy_signature (x0, x1) ->
      Ast_409.Outcometree.Octy_signature
        ((Option.map copy_out_type x0),
          (List.map copy_out_class_sig_item x1))
and copy_out_class_sig_item :
  Ast_408.Outcometree.out_class_sig_item ->
    Ast_409.Outcometree.out_class_sig_item
  =
  function
  | Ast_408.Outcometree.Ocsg_constraint (x0, x1) ->
      Ast_409.Outcometree.Ocsg_constraint
        ((copy_out_type x0), (copy_out_type x1))
  | Ast_408.Outcometree.Ocsg_method (x0, x1, x2, x3) ->
      Ast_409.Outcometree.Ocsg_method (x0, x1, x2, (copy_out_type x3))
  | Ast_408.Outcometree.Ocsg_value (x0, x1, x2, x3) ->
      Ast_409.Outcometree.Ocsg_value (x0, x1, x2, (copy_out_type x3))
and copy_out_type :
  Ast_408.Outcometree.out_type -> Ast_409.Outcometree.out_type =
  function
  | Ast_408.Outcometree.Otyp_abstract -> Ast_409.Outcometree.Otyp_abstract
  | Ast_408.Outcometree.Otyp_open -> Ast_409.Outcometree.Otyp_open
  | Ast_408.Outcometree.Otyp_alias (x0, x1) ->
      Ast_409.Outcometree.Otyp_alias ((copy_out_type x0), x1)
  | Ast_408.Outcometree.Otyp_arrow (x0, x1, x2) ->
      Ast_409.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1), (copy_out_type x2))
  | Ast_408.Outcometree.Otyp_class (x0, x1, x2) ->
      Ast_409.Outcometree.Otyp_class
        (x0, (copy_out_ident x1), (List.map copy_out_type x2))
  | Ast_408.Outcometree.Otyp_constr (x0, x1) ->
      Ast_409.Outcometree.Otyp_constr
        ((copy_out_ident x0), (List.map copy_out_type x1))
  | Ast_408.Outcometree.Otyp_manifest (x0, x1) ->
      Ast_409.Outcometree.Otyp_manifest
        ((copy_out_type x0), (copy_out_type x1))
  | Ast_408.Outcometree.Otyp_object (x0, x1) ->
      Ast_409.Outcometree.Otyp_object
        ((List.map (fun x -> let (x0, x1) = x in (x0, (copy_out_type x1))) x0),
          (Option.map (fun x -> x) x1))
  | Ast_408.Outcometree.Otyp_record x0 ->
      Ast_409.Outcometree.Otyp_record
        (List.map
           (fun x -> let (x0, x1, x2) = x in (x0, x1, (copy_out_type x2))) x0)
  | Ast_408.Outcometree.Otyp_stuff x0 -> Ast_409.Outcometree.Otyp_stuff x0
  | Ast_408.Outcometree.Otyp_sum x0 ->
      Ast_409.Outcometree.Otyp_sum
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              (x0, (List.map copy_out_type x1),
                (Option.map copy_out_type x2))) x0)
  | Ast_408.Outcometree.Otyp_tuple x0 ->
      Ast_409.Outcometree.Otyp_tuple (List.map copy_out_type x0)
  | Ast_408.Outcometree.Otyp_var (x0, x1) ->
      Ast_409.Outcometree.Otyp_var (x0, x1)
  | Ast_408.Outcometree.Otyp_variant (x0, x1, x2, x3) ->
      Ast_409.Outcometree.Otyp_variant
        (x0, (copy_out_variant x1), x2,
          (Option.map (fun x -> List.map (fun x -> x) x) x3))
  | Ast_408.Outcometree.Otyp_poly (x0, x1) ->
      Ast_409.Outcometree.Otyp_poly
        ((List.map (fun x -> x) x0), (copy_out_type x1))
  | Ast_408.Outcometree.Otyp_module (x0, x1, x2) ->
      Ast_409.Outcometree.Otyp_module
        ((copy_out_ident x0), (List.map (fun x -> x) x1),
          (List.map copy_out_type x2))
  | Ast_408.Outcometree.Otyp_attribute (x0, x1) ->
      Ast_409.Outcometree.Otyp_attribute
        ((copy_out_type x0), (copy_out_attribute x1))
and copy_out_attribute :
  Ast_408.Outcometree.out_attribute -> Ast_409.Outcometree.out_attribute =
  fun { Ast_408.Outcometree.oattr_name = oattr_name } ->
    { Ast_409.Outcometree.oattr_name = oattr_name }
and copy_out_variant :
  Ast_408.Outcometree.out_variant -> Ast_409.Outcometree.out_variant =
  function
  | Ast_408.Outcometree.Ovar_fields x0 ->
      Ast_409.Outcometree.Ovar_fields
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in (x0, x1, (List.map copy_out_type x2)))
           x0)
  | Ast_408.Outcometree.Ovar_typ x0 ->
      Ast_409.Outcometree.Ovar_typ (copy_out_type x0)
and copy_out_value :
  Ast_408.Outcometree.out_value -> Ast_409.Outcometree.out_value =
  function
  | Ast_408.Outcometree.Oval_array x0 ->
      Ast_409.Outcometree.Oval_array (List.map copy_out_value x0)
  | Ast_408.Outcometree.Oval_char x0 -> Ast_409.Outcometree.Oval_char x0
  | Ast_408.Outcometree.Oval_constr (x0, x1) ->
      Ast_409.Outcometree.Oval_constr
        ((copy_out_ident x0), (List.map copy_out_value x1))
  | Ast_408.Outcometree.Oval_ellipsis -> Ast_409.Outcometree.Oval_ellipsis
  | Ast_408.Outcometree.Oval_float x0 -> Ast_409.Outcometree.Oval_float x0
  | Ast_408.Outcometree.Oval_int x0 -> Ast_409.Outcometree.Oval_int x0
  | Ast_408.Outcometree.Oval_int32 x0 -> Ast_409.Outcometree.Oval_int32 x0
  | Ast_408.Outcometree.Oval_int64 x0 -> Ast_409.Outcometree.Oval_int64 x0
  | Ast_408.Outcometree.Oval_nativeint x0 ->
      Ast_409.Outcometree.Oval_nativeint x0
  | Ast_408.Outcometree.Oval_list x0 ->
      Ast_409.Outcometree.Oval_list (List.map copy_out_value x0)
  | Ast_408.Outcometree.Oval_printer x0 ->
      Ast_409.Outcometree.Oval_printer x0
  | Ast_408.Outcometree.Oval_record x0 ->
      Ast_409.Outcometree.Oval_record
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_out_ident x0), (copy_out_value x1)))
           x0)
  | Ast_408.Outcometree.Oval_string (x0, x1, x2) ->
      Ast_409.Outcometree.Oval_string (x0, x1, (copy_out_string x2))
  | Ast_408.Outcometree.Oval_stuff x0 -> Ast_409.Outcometree.Oval_stuff x0
  | Ast_408.Outcometree.Oval_tuple x0 ->
      Ast_409.Outcometree.Oval_tuple (List.map copy_out_value x0)
  | Ast_408.Outcometree.Oval_variant (x0, x1) ->
      Ast_409.Outcometree.Oval_variant (x0, (Option.map copy_out_value x1))
and copy_out_string :
  Ast_408.Outcometree.out_string -> Ast_409.Outcometree.out_string =
  function
  | Ast_408.Outcometree.Ostr_string -> Ast_409.Outcometree.Ostr_string
  | Ast_408.Outcometree.Ostr_bytes -> Ast_409.Outcometree.Ostr_bytes
and copy_out_ident :
  Ast_408.Outcometree.out_ident -> Ast_409.Outcometree.out_ident =
  function
  | Ast_408.Outcometree.Oide_apply (x0, x1) ->
      Ast_409.Outcometree.Oide_apply
        ((copy_out_ident x0), (copy_out_ident x1))
  | Ast_408.Outcometree.Oide_dot (x0, x1) ->
      Ast_409.Outcometree.Oide_dot ((copy_out_ident x0), x1)
  | Ast_408.Outcometree.Oide_ident x0 ->
      Ast_409.Outcometree.Oide_ident (copy_out_name x0)
and copy_out_name :
  Ast_408.Outcometree.out_name -> Ast_409.Outcometree.out_name =
  fun { Ast_408.Outcometree.printed_name = printed_name } ->
    { Ast_409.Outcometree.printed_name = printed_name }
and copy_toplevel_phrase :
  Ast_408.Parsetree.toplevel_phrase -> Ast_409.Parsetree.toplevel_phrase =
  function
  | Ast_408.Parsetree.Ptop_def x0 ->
      Ast_409.Parsetree.Ptop_def (copy_structure x0)
  | Ast_408.Parsetree.Ptop_dir x0 ->
      Ast_409.Parsetree.Ptop_dir (copy_toplevel_directive x0)
and copy_toplevel_directive :
  Ast_408.Parsetree.toplevel_directive ->
    Ast_409.Parsetree.toplevel_directive
  =
  fun
    { Ast_408.Parsetree.pdir_name = pdir_name;
      Ast_408.Parsetree.pdir_arg = pdir_arg;
      Ast_408.Parsetree.pdir_loc = pdir_loc }
    ->
    {
      Ast_409.Parsetree.pdir_name = (copy_loc (fun x -> x) pdir_name);
      Ast_409.Parsetree.pdir_arg =
        (Option.map copy_directive_argument pdir_arg);
      Ast_409.Parsetree.pdir_loc = (copy_location pdir_loc)
    }
and copy_directive_argument :
  Ast_408.Parsetree.directive_argument ->
    Ast_409.Parsetree.directive_argument
  =
  fun
    { Ast_408.Parsetree.pdira_desc = pdira_desc;
      Ast_408.Parsetree.pdira_loc = pdira_loc }
    ->
    {
      Ast_409.Parsetree.pdira_desc =
        (copy_directive_argument_desc pdira_desc);
      Ast_409.Parsetree.pdira_loc = (copy_location pdira_loc)
    }
and copy_directive_argument_desc :
  Ast_408.Parsetree.directive_argument_desc ->
    Ast_409.Parsetree.directive_argument_desc
  =
  function
  | Ast_408.Parsetree.Pdir_string x0 -> Ast_409.Parsetree.Pdir_string x0
  | Ast_408.Parsetree.Pdir_int (x0, x1) ->
      Ast_409.Parsetree.Pdir_int (x0, (Option.map (fun x -> x) x1))
  | Ast_408.Parsetree.Pdir_ident x0 ->
      Ast_409.Parsetree.Pdir_ident (copy_Longident_t x0)
  | Ast_408.Parsetree.Pdir_bool x0 -> Ast_409.Parsetree.Pdir_bool x0
and copy_typ : Ast_408.Parsetree.typ -> Ast_409.Parsetree.typ =
  fun x -> copy_core_type x
and copy_pat : Ast_408.Parsetree.pat -> Ast_409.Parsetree.pat =
  fun x -> copy_pattern x
and copy_expr : Ast_408.Parsetree.expr -> Ast_409.Parsetree.expr =
  fun x -> copy_expression x
and copy_expression :
  Ast_408.Parsetree.expression -> Ast_409.Parsetree.expression =
  fun
    { Ast_408.Parsetree.pexp_desc = pexp_desc;
      Ast_408.Parsetree.pexp_loc = pexp_loc;
      Ast_408.Parsetree.pexp_loc_stack = pexp_loc_stack;
      Ast_408.Parsetree.pexp_attributes = pexp_attributes }
    ->
    {
      Ast_409.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
      Ast_409.Parsetree.pexp_loc = (copy_location pexp_loc);
      Ast_409.Parsetree.pexp_loc_stack =
        (List.map copy_location pexp_loc_stack);
      Ast_409.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
    }
and copy_expression_desc :
  Ast_408.Parsetree.expression_desc -> Ast_409.Parsetree.expression_desc =
  function
  | Ast_408.Parsetree.Pexp_ident x0 ->
      Ast_409.Parsetree.Pexp_ident (copy_loc copy_Longident_t x0)
  | Ast_408.Parsetree.Pexp_constant x0 ->
      Ast_409.Parsetree.Pexp_constant (copy_constant x0)
  | Ast_408.Parsetree.Pexp_let (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_let
        ((copy_rec_flag x0), (List.map copy_value_binding x1),
          (copy_expression x2))
  | Ast_408.Parsetree.Pexp_function x0 ->
      Ast_409.Parsetree.Pexp_function (copy_cases x0)
  | Ast_408.Parsetree.Pexp_fun (x0, x1, x2, x3) ->
      Ast_409.Parsetree.Pexp_fun
        ((copy_arg_label x0), (Option.map copy_expression x1),
          (copy_pattern x2), (copy_expression x3))
  | Ast_408.Parsetree.Pexp_apply (x0, x1) ->
      Ast_409.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x ->
                let (x0, x1) = x in
                ((copy_arg_label x0), (copy_expression x1))) x1))
  | Ast_408.Parsetree.Pexp_match (x0, x1) ->
      Ast_409.Parsetree.Pexp_match ((copy_expression x0), (copy_cases x1))
  | Ast_408.Parsetree.Pexp_try (x0, x1) ->
      Ast_409.Parsetree.Pexp_try ((copy_expression x0), (copy_cases x1))
  | Ast_408.Parsetree.Pexp_tuple x0 ->
      Ast_409.Parsetree.Pexp_tuple (List.map copy_expression x0)
  | Ast_408.Parsetree.Pexp_construct (x0, x1) ->
      Ast_409.Parsetree.Pexp_construct
        ((copy_loc copy_Longident_t x0), (Option.map copy_expression x1))
  | Ast_408.Parsetree.Pexp_variant (x0, x1) ->
      Ast_409.Parsetree.Pexp_variant
        ((copy_label x0), (Option.map copy_expression x1))
  | Ast_408.Parsetree.Pexp_record (x0, x1) ->
      Ast_409.Parsetree.Pexp_record
        ((List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_loc copy_Longident_t x0), (copy_expression x1))) x0),
          (Option.map copy_expression x1))
  | Ast_408.Parsetree.Pexp_field (x0, x1) ->
      Ast_409.Parsetree.Pexp_field
        ((copy_expression x0), (copy_loc copy_Longident_t x1))
  | Ast_408.Parsetree.Pexp_setfield (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_setfield
        ((copy_expression x0), (copy_loc copy_Longident_t x1),
          (copy_expression x2))
  | Ast_408.Parsetree.Pexp_array x0 ->
      Ast_409.Parsetree.Pexp_array (List.map copy_expression x0)
  | Ast_408.Parsetree.Pexp_ifthenelse (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_ifthenelse
        ((copy_expression x0), (copy_expression x1),
          (Option.map copy_expression x2))
  | Ast_408.Parsetree.Pexp_sequence (x0, x1) ->
      Ast_409.Parsetree.Pexp_sequence
        ((copy_expression x0), (copy_expression x1))
  | Ast_408.Parsetree.Pexp_while (x0, x1) ->
      Ast_409.Parsetree.Pexp_while
        ((copy_expression x0), (copy_expression x1))
  | Ast_408.Parsetree.Pexp_for (x0, x1, x2, x3, x4) ->
      Ast_409.Parsetree.Pexp_for
        ((copy_pattern x0), (copy_expression x1), (copy_expression x2),
          (copy_direction_flag x3), (copy_expression x4))
  | Ast_408.Parsetree.Pexp_constraint (x0, x1) ->
      Ast_409.Parsetree.Pexp_constraint
        ((copy_expression x0), (copy_core_type x1))
  | Ast_408.Parsetree.Pexp_coerce (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_coerce
        ((copy_expression x0), (Option.map copy_core_type x1),
          (copy_core_type x2))
  | Ast_408.Parsetree.Pexp_send (x0, x1) ->
      Ast_409.Parsetree.Pexp_send
        ((copy_expression x0), (copy_loc copy_label x1))
  | Ast_408.Parsetree.Pexp_new x0 ->
      Ast_409.Parsetree.Pexp_new (copy_loc copy_Longident_t x0)
  | Ast_408.Parsetree.Pexp_setinstvar (x0, x1) ->
      Ast_409.Parsetree.Pexp_setinstvar
        ((copy_loc copy_label x0), (copy_expression x1))
  | Ast_408.Parsetree.Pexp_override x0 ->
      Ast_409.Parsetree.Pexp_override
        (List.map
           (fun x ->
              let (x0, x1) = x in
              ((copy_loc copy_label x0), (copy_expression x1))) x0)
  | Ast_408.Parsetree.Pexp_letmodule (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_letmodule
        ((copy_loc (fun x -> x) x0), (copy_module_expr x1),
          (copy_expression x2))
  | Ast_408.Parsetree.Pexp_letexception (x0, x1) ->
      Ast_409.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0), (copy_expression x1))
  | Ast_408.Parsetree.Pexp_assert x0 ->
      Ast_409.Parsetree.Pexp_assert (copy_expression x0)
  | Ast_408.Parsetree.Pexp_lazy x0 ->
      Ast_409.Parsetree.Pexp_lazy (copy_expression x0)
  | Ast_408.Parsetree.Pexp_poly (x0, x1) ->
      Ast_409.Parsetree.Pexp_poly
        ((copy_expression x0), (Option.map copy_core_type x1))
  | Ast_408.Parsetree.Pexp_object x0 ->
      Ast_409.Parsetree.Pexp_object (copy_class_structure x0)
  | Ast_408.Parsetree.Pexp_newtype (x0, x1) ->
      Ast_409.Parsetree.Pexp_newtype
        ((copy_loc (fun x -> x) x0), (copy_expression x1))
  | Ast_408.Parsetree.Pexp_pack x0 ->
      Ast_409.Parsetree.Pexp_pack (copy_module_expr x0)
  | Ast_408.Parsetree.Pexp_open (x0, x1) ->
      Ast_409.Parsetree.Pexp_open
        ((copy_open_declaration x0), (copy_expression x1))
  | Ast_408.Parsetree.Pexp_letop x0 ->
      Ast_409.Parsetree.Pexp_letop (copy_letop x0)
  | Ast_408.Parsetree.Pexp_extension x0 ->
      Ast_409.Parsetree.Pexp_extension (copy_extension x0)
  | Ast_408.Parsetree.Pexp_unreachable -> Ast_409.Parsetree.Pexp_unreachable
and copy_letop : Ast_408.Parsetree.letop -> Ast_409.Parsetree.letop =
  fun
    { Ast_408.Parsetree.let_ = let_; Ast_408.Parsetree.ands = ands;
      Ast_408.Parsetree.body = body }
    ->
    {
      Ast_409.Parsetree.let_ = (copy_binding_op let_);
      Ast_409.Parsetree.ands = (List.map copy_binding_op ands);
      Ast_409.Parsetree.body = (copy_expression body)
    }
and copy_binding_op :
  Ast_408.Parsetree.binding_op -> Ast_409.Parsetree.binding_op =
  fun
    { Ast_408.Parsetree.pbop_op = pbop_op;
      Ast_408.Parsetree.pbop_pat = pbop_pat;
      Ast_408.Parsetree.pbop_exp = pbop_exp;
      Ast_408.Parsetree.pbop_loc = pbop_loc }
    ->
    {
      Ast_409.Parsetree.pbop_op = (copy_loc (fun x -> x) pbop_op);
      Ast_409.Parsetree.pbop_pat = (copy_pattern pbop_pat);
      Ast_409.Parsetree.pbop_exp = (copy_expression pbop_exp);
      Ast_409.Parsetree.pbop_loc = (copy_location pbop_loc)
    }
and copy_direction_flag :
  Ast_408.Asttypes.direction_flag -> Ast_409.Asttypes.direction_flag =
  function
  | Ast_408.Asttypes.Upto -> Ast_409.Asttypes.Upto
  | Ast_408.Asttypes.Downto -> Ast_409.Asttypes.Downto
and copy_cases : Ast_408.Parsetree.cases -> Ast_409.Parsetree.cases =
  fun x -> List.map copy_case x
and copy_case : Ast_408.Parsetree.case -> Ast_409.Parsetree.case =
  fun
    { Ast_408.Parsetree.pc_lhs = pc_lhs;
      Ast_408.Parsetree.pc_guard = pc_guard;
      Ast_408.Parsetree.pc_rhs = pc_rhs }
    ->
    {
      Ast_409.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      Ast_409.Parsetree.pc_guard = (Option.map copy_expression pc_guard);
      Ast_409.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }
and copy_value_binding :
  Ast_408.Parsetree.value_binding -> Ast_409.Parsetree.value_binding =
  fun
    { Ast_408.Parsetree.pvb_pat = pvb_pat;
      Ast_408.Parsetree.pvb_expr = pvb_expr;
      Ast_408.Parsetree.pvb_attributes = pvb_attributes;
      Ast_408.Parsetree.pvb_loc = pvb_loc }
    ->
    {
      Ast_409.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      Ast_409.Parsetree.pvb_expr = (copy_expression pvb_expr);
      Ast_409.Parsetree.pvb_attributes = (copy_attributes pvb_attributes);
      Ast_409.Parsetree.pvb_loc = (copy_location pvb_loc)
    }
and copy_pattern : Ast_408.Parsetree.pattern -> Ast_409.Parsetree.pattern =
  fun
    { Ast_408.Parsetree.ppat_desc = ppat_desc;
      Ast_408.Parsetree.ppat_loc = ppat_loc;
      Ast_408.Parsetree.ppat_loc_stack = ppat_loc_stack;
      Ast_408.Parsetree.ppat_attributes = ppat_attributes }
    ->
    {
      Ast_409.Parsetree.ppat_desc = (copy_pattern_desc ppat_desc);
      Ast_409.Parsetree.ppat_loc = (copy_location ppat_loc);
      Ast_409.Parsetree.ppat_loc_stack =
        (List.map copy_location ppat_loc_stack);
      Ast_409.Parsetree.ppat_attributes = (copy_attributes ppat_attributes)
    }
and copy_pattern_desc :
  Ast_408.Parsetree.pattern_desc -> Ast_409.Parsetree.pattern_desc =
  function
  | Ast_408.Parsetree.Ppat_any -> Ast_409.Parsetree.Ppat_any
  | Ast_408.Parsetree.Ppat_var x0 ->
      Ast_409.Parsetree.Ppat_var (copy_loc (fun x -> x) x0)
  | Ast_408.Parsetree.Ppat_alias (x0, x1) ->
      Ast_409.Parsetree.Ppat_alias
        ((copy_pattern x0), (copy_loc (fun x -> x) x1))
  | Ast_408.Parsetree.Ppat_constant x0 ->
      Ast_409.Parsetree.Ppat_constant (copy_constant x0)
  | Ast_408.Parsetree.Ppat_interval (x0, x1) ->
      Ast_409.Parsetree.Ppat_interval
        ((copy_constant x0), (copy_constant x1))
  | Ast_408.Parsetree.Ppat_tuple x0 ->
      Ast_409.Parsetree.Ppat_tuple (List.map copy_pattern x0)
  | Ast_408.Parsetree.Ppat_construct (x0, x1) ->
      Ast_409.Parsetree.Ppat_construct
        ((copy_loc copy_Longident_t x0), (Option.map copy_pattern x1))
  | Ast_408.Parsetree.Ppat_variant (x0, x1) ->
      Ast_409.Parsetree.Ppat_variant
        ((copy_label x0), (Option.map copy_pattern x1))
  | Ast_408.Parsetree.Ppat_record (x0, x1) ->
      Ast_409.Parsetree.Ppat_record
        ((List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_loc copy_Longident_t x0), (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | Ast_408.Parsetree.Ppat_array x0 ->
      Ast_409.Parsetree.Ppat_array (List.map copy_pattern x0)
  | Ast_408.Parsetree.Ppat_or (x0, x1) ->
      Ast_409.Parsetree.Ppat_or ((copy_pattern x0), (copy_pattern x1))
  | Ast_408.Parsetree.Ppat_constraint (x0, x1) ->
      Ast_409.Parsetree.Ppat_constraint
        ((copy_pattern x0), (copy_core_type x1))
  | Ast_408.Parsetree.Ppat_type x0 ->
      Ast_409.Parsetree.Ppat_type (copy_loc copy_Longident_t x0)
  | Ast_408.Parsetree.Ppat_lazy x0 ->
      Ast_409.Parsetree.Ppat_lazy (copy_pattern x0)
  | Ast_408.Parsetree.Ppat_unpack x0 ->
      Ast_409.Parsetree.Ppat_unpack (copy_loc (fun x -> x) x0)
  | Ast_408.Parsetree.Ppat_exception x0 ->
      Ast_409.Parsetree.Ppat_exception (copy_pattern x0)
  | Ast_408.Parsetree.Ppat_extension x0 ->
      Ast_409.Parsetree.Ppat_extension (copy_extension x0)
  | Ast_408.Parsetree.Ppat_open (x0, x1) ->
      Ast_409.Parsetree.Ppat_open
        ((copy_loc copy_Longident_t x0), (copy_pattern x1))
and copy_core_type :
  Ast_408.Parsetree.core_type -> Ast_409.Parsetree.core_type =
  fun
    { Ast_408.Parsetree.ptyp_desc = ptyp_desc;
      Ast_408.Parsetree.ptyp_loc = ptyp_loc;
      Ast_408.Parsetree.ptyp_loc_stack = ptyp_loc_stack;
      Ast_408.Parsetree.ptyp_attributes = ptyp_attributes }
    ->
    {
      Ast_409.Parsetree.ptyp_desc = (copy_core_type_desc ptyp_desc);
      Ast_409.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      Ast_409.Parsetree.ptyp_loc_stack =
        (List.map copy_location ptyp_loc_stack);
      Ast_409.Parsetree.ptyp_attributes = (copy_attributes ptyp_attributes)
    }
and copy_core_type_desc :
  Ast_408.Parsetree.core_type_desc -> Ast_409.Parsetree.core_type_desc =
  function
  | Ast_408.Parsetree.Ptyp_any -> Ast_409.Parsetree.Ptyp_any
  | Ast_408.Parsetree.Ptyp_var x0 -> Ast_409.Parsetree.Ptyp_var x0
  | Ast_408.Parsetree.Ptyp_arrow (x0, x1, x2) ->
      Ast_409.Parsetree.Ptyp_arrow
        ((copy_arg_label x0), (copy_core_type x1), (copy_core_type x2))
  | Ast_408.Parsetree.Ptyp_tuple x0 ->
      Ast_409.Parsetree.Ptyp_tuple (List.map copy_core_type x0)
  | Ast_408.Parsetree.Ptyp_constr (x0, x1) ->
      Ast_409.Parsetree.Ptyp_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_408.Parsetree.Ptyp_object (x0, x1) ->
      Ast_409.Parsetree.Ptyp_object
        ((List.map copy_object_field x0), (copy_closed_flag x1))
  | Ast_408.Parsetree.Ptyp_class (x0, x1) ->
      Ast_409.Parsetree.Ptyp_class
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_408.Parsetree.Ptyp_alias (x0, x1) ->
      Ast_409.Parsetree.Ptyp_alias ((copy_core_type x0), x1)
  | Ast_408.Parsetree.Ptyp_variant (x0, x1, x2) ->
      Ast_409.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0), (copy_closed_flag x1),
          (Option.map (fun x -> List.map copy_label x) x2))
  | Ast_408.Parsetree.Ptyp_poly (x0, x1) ->
      Ast_409.Parsetree.Ptyp_poly
        ((List.map (fun x -> copy_loc (fun x -> x) x) x0),
          (copy_core_type x1))
  | Ast_408.Parsetree.Ptyp_package x0 ->
      Ast_409.Parsetree.Ptyp_package (copy_package_type x0)
  | Ast_408.Parsetree.Ptyp_extension x0 ->
      Ast_409.Parsetree.Ptyp_extension (copy_extension x0)
and copy_package_type :
  Ast_408.Parsetree.package_type -> Ast_409.Parsetree.package_type =
  fun x ->
    let (x0, x1) = x in
    ((copy_loc copy_Longident_t x0),
      (List.map
         (fun x ->
            let (x0, x1) = x in
            ((copy_loc copy_Longident_t x0), (copy_core_type x1))) x1))
and copy_row_field :
  Ast_408.Parsetree.row_field -> Ast_409.Parsetree.row_field =
  fun
    { Ast_408.Parsetree.prf_desc = prf_desc;
      Ast_408.Parsetree.prf_loc = prf_loc;
      Ast_408.Parsetree.prf_attributes = prf_attributes }
    ->
    {
      Ast_409.Parsetree.prf_desc = (copy_row_field_desc prf_desc);
      Ast_409.Parsetree.prf_loc = (copy_location prf_loc);
      Ast_409.Parsetree.prf_attributes = (copy_attributes prf_attributes)
    }
and copy_row_field_desc :
  Ast_408.Parsetree.row_field_desc -> Ast_409.Parsetree.row_field_desc =
  function
  | Ast_408.Parsetree.Rtag (x0, x1, x2) ->
      Ast_409.Parsetree.Rtag
        ((copy_loc copy_label x0), x1, (List.map copy_core_type x2))
  | Ast_408.Parsetree.Rinherit x0 ->
      Ast_409.Parsetree.Rinherit (copy_core_type x0)
and copy_object_field :
  Ast_408.Parsetree.object_field -> Ast_409.Parsetree.object_field =
  fun
    { Ast_408.Parsetree.pof_desc = pof_desc;
      Ast_408.Parsetree.pof_loc = pof_loc;
      Ast_408.Parsetree.pof_attributes = pof_attributes }
    ->
    {
      Ast_409.Parsetree.pof_desc = (copy_object_field_desc pof_desc);
      Ast_409.Parsetree.pof_loc = (copy_location pof_loc);
      Ast_409.Parsetree.pof_attributes = (copy_attributes pof_attributes)
    }
and copy_attributes :
  Ast_408.Parsetree.attributes -> Ast_409.Parsetree.attributes =
  fun x -> List.map copy_attribute x
and copy_attribute :
  Ast_408.Parsetree.attribute -> Ast_409.Parsetree.attribute =
  fun
    { Ast_408.Parsetree.attr_name = attr_name;
      Ast_408.Parsetree.attr_payload = attr_payload;
      Ast_408.Parsetree.attr_loc = attr_loc }
    ->
    {
      Ast_409.Parsetree.attr_name = (copy_loc (fun x -> x) attr_name);
      Ast_409.Parsetree.attr_payload = (copy_payload attr_payload);
      Ast_409.Parsetree.attr_loc = (copy_location attr_loc)
    }
and copy_payload : Ast_408.Parsetree.payload -> Ast_409.Parsetree.payload =
  function
  | Ast_408.Parsetree.PStr x0 -> Ast_409.Parsetree.PStr (copy_structure x0)
  | Ast_408.Parsetree.PSig x0 -> Ast_409.Parsetree.PSig (copy_signature x0)
  | Ast_408.Parsetree.PTyp x0 -> Ast_409.Parsetree.PTyp (copy_core_type x0)
  | Ast_408.Parsetree.PPat (x0, x1) ->
      Ast_409.Parsetree.PPat
        ((copy_pattern x0), (Option.map copy_expression x1))
and copy_structure :
  Ast_408.Parsetree.structure -> Ast_409.Parsetree.structure =
  fun x -> List.map copy_structure_item x
and copy_structure_item :
  Ast_408.Parsetree.structure_item -> Ast_409.Parsetree.structure_item =
  fun
    { Ast_408.Parsetree.pstr_desc = pstr_desc;
      Ast_408.Parsetree.pstr_loc = pstr_loc }
    ->
    {
      Ast_409.Parsetree.pstr_desc = (copy_structure_item_desc pstr_desc);
      Ast_409.Parsetree.pstr_loc = (copy_location pstr_loc)
    }
and copy_structure_item_desc :
  Ast_408.Parsetree.structure_item_desc ->
    Ast_409.Parsetree.structure_item_desc
  =
  function
  | Ast_408.Parsetree.Pstr_eval (x0, x1) ->
      Ast_409.Parsetree.Pstr_eval
        ((copy_expression x0), (copy_attributes x1))
  | Ast_408.Parsetree.Pstr_value (x0, x1) ->
      Ast_409.Parsetree.Pstr_value
        ((copy_rec_flag x0), (List.map copy_value_binding x1))
  | Ast_408.Parsetree.Pstr_primitive x0 ->
      Ast_409.Parsetree.Pstr_primitive (copy_value_description x0)
  | Ast_408.Parsetree.Pstr_type (x0, x1) ->
      Ast_409.Parsetree.Pstr_type
        ((copy_rec_flag x0), (List.map copy_type_declaration x1))
  | Ast_408.Parsetree.Pstr_typext x0 ->
      Ast_409.Parsetree.Pstr_typext (copy_type_extension x0)
  | Ast_408.Parsetree.Pstr_exception x0 ->
      Ast_409.Parsetree.Pstr_exception (copy_type_exception x0)
  | Ast_408.Parsetree.Pstr_module x0 ->
      Ast_409.Parsetree.Pstr_module (copy_module_binding x0)
  | Ast_408.Parsetree.Pstr_recmodule x0 ->
      Ast_409.Parsetree.Pstr_recmodule (List.map copy_module_binding x0)
  | Ast_408.Parsetree.Pstr_modtype x0 ->
      Ast_409.Parsetree.Pstr_modtype (copy_module_type_declaration x0)
  | Ast_408.Parsetree.Pstr_open x0 ->
      Ast_409.Parsetree.Pstr_open (copy_open_declaration x0)
  | Ast_408.Parsetree.Pstr_class x0 ->
      Ast_409.Parsetree.Pstr_class (List.map copy_class_declaration x0)
  | Ast_408.Parsetree.Pstr_class_type x0 ->
      Ast_409.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | Ast_408.Parsetree.Pstr_include x0 ->
      Ast_409.Parsetree.Pstr_include (copy_include_declaration x0)
  | Ast_408.Parsetree.Pstr_attribute x0 ->
      Ast_409.Parsetree.Pstr_attribute (copy_attribute x0)
  | Ast_408.Parsetree.Pstr_extension (x0, x1) ->
      Ast_409.Parsetree.Pstr_extension
        ((copy_extension x0), (copy_attributes x1))
and copy_include_declaration :
  Ast_408.Parsetree.include_declaration ->
    Ast_409.Parsetree.include_declaration
  = fun x -> copy_include_infos copy_module_expr x
and copy_class_declaration :
  Ast_408.Parsetree.class_declaration -> Ast_409.Parsetree.class_declaration
  = fun x -> copy_class_infos copy_class_expr x
and copy_class_expr :
  Ast_408.Parsetree.class_expr -> Ast_409.Parsetree.class_expr =
  fun
    { Ast_408.Parsetree.pcl_desc = pcl_desc;
      Ast_408.Parsetree.pcl_loc = pcl_loc;
      Ast_408.Parsetree.pcl_attributes = pcl_attributes }
    ->
    {
      Ast_409.Parsetree.pcl_desc = (copy_class_expr_desc pcl_desc);
      Ast_409.Parsetree.pcl_loc = (copy_location pcl_loc);
      Ast_409.Parsetree.pcl_attributes = (copy_attributes pcl_attributes)
    }
and copy_class_expr_desc :
  Ast_408.Parsetree.class_expr_desc -> Ast_409.Parsetree.class_expr_desc =
  function
  | Ast_408.Parsetree.Pcl_constr (x0, x1) ->
      Ast_409.Parsetree.Pcl_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_408.Parsetree.Pcl_structure x0 ->
      Ast_409.Parsetree.Pcl_structure (copy_class_structure x0)
  | Ast_408.Parsetree.Pcl_fun (x0, x1, x2, x3) ->
      Ast_409.Parsetree.Pcl_fun
        ((copy_arg_label x0), (Option.map copy_expression x1),
          (copy_pattern x2), (copy_class_expr x3))
  | Ast_408.Parsetree.Pcl_apply (x0, x1) ->
      Ast_409.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x ->
                let (x0, x1) = x in
                ((copy_arg_label x0), (copy_expression x1))) x1))
  | Ast_408.Parsetree.Pcl_let (x0, x1, x2) ->
      Ast_409.Parsetree.Pcl_let
        ((copy_rec_flag x0), (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | Ast_408.Parsetree.Pcl_constraint (x0, x1) ->
      Ast_409.Parsetree.Pcl_constraint
        ((copy_class_expr x0), (copy_class_type x1))
  | Ast_408.Parsetree.Pcl_extension x0 ->
      Ast_409.Parsetree.Pcl_extension (copy_extension x0)
  | Ast_408.Parsetree.Pcl_open (x0, x1) ->
      Ast_409.Parsetree.Pcl_open
        ((copy_open_description x0), (copy_class_expr x1))
and copy_class_structure :
  Ast_408.Parsetree.class_structure -> Ast_409.Parsetree.class_structure =
  fun
    { Ast_408.Parsetree.pcstr_self = pcstr_self;
      Ast_408.Parsetree.pcstr_fields = pcstr_fields }
    ->
    {
      Ast_409.Parsetree.pcstr_self = (copy_pattern pcstr_self);
      Ast_409.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }
and copy_class_field :
  Ast_408.Parsetree.class_field -> Ast_409.Parsetree.class_field =
  fun
    { Ast_408.Parsetree.pcf_desc = pcf_desc;
      Ast_408.Parsetree.pcf_loc = pcf_loc;
      Ast_408.Parsetree.pcf_attributes = pcf_attributes }
    ->
    {
      Ast_409.Parsetree.pcf_desc = (copy_class_field_desc pcf_desc);
      Ast_409.Parsetree.pcf_loc = (copy_location pcf_loc);
      Ast_409.Parsetree.pcf_attributes = (copy_attributes pcf_attributes)
    }
and copy_class_field_desc :
  Ast_408.Parsetree.class_field_desc -> Ast_409.Parsetree.class_field_desc =
  function
  | Ast_408.Parsetree.Pcf_inherit (x0, x1, x2) ->
      Ast_409.Parsetree.Pcf_inherit
        ((copy_override_flag x0), (copy_class_expr x1),
          (Option.map (fun x -> copy_loc (fun x -> x) x) x2))
  | Ast_408.Parsetree.Pcf_val x0 ->
      Ast_409.Parsetree.Pcf_val
        (let (x0, x1, x2) = x0 in
         ((copy_loc copy_label x0), (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | Ast_408.Parsetree.Pcf_method x0 ->
      Ast_409.Parsetree.Pcf_method
        (let (x0, x1, x2) = x0 in
         ((copy_loc copy_label x0), (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | Ast_408.Parsetree.Pcf_constraint x0 ->
      Ast_409.Parsetree.Pcf_constraint
        (let (x0, x1) = x0 in ((copy_core_type x0), (copy_core_type x1)))
  | Ast_408.Parsetree.Pcf_initializer x0 ->
      Ast_409.Parsetree.Pcf_initializer (copy_expression x0)
  | Ast_408.Parsetree.Pcf_attribute x0 ->
      Ast_409.Parsetree.Pcf_attribute (copy_attribute x0)
  | Ast_408.Parsetree.Pcf_extension x0 ->
      Ast_409.Parsetree.Pcf_extension (copy_extension x0)
and copy_class_field_kind :
  Ast_408.Parsetree.class_field_kind -> Ast_409.Parsetree.class_field_kind =
  function
  | Ast_408.Parsetree.Cfk_virtual x0 ->
      Ast_409.Parsetree.Cfk_virtual (copy_core_type x0)
  | Ast_408.Parsetree.Cfk_concrete (x0, x1) ->
      Ast_409.Parsetree.Cfk_concrete
        ((copy_override_flag x0), (copy_expression x1))
and copy_open_declaration :
  Ast_408.Parsetree.open_declaration -> Ast_409.Parsetree.open_declaration =
  fun x -> copy_open_infos copy_module_expr x
and copy_module_binding :
  Ast_408.Parsetree.module_binding -> Ast_409.Parsetree.module_binding =
  fun
    { Ast_408.Parsetree.pmb_name = pmb_name;
      Ast_408.Parsetree.pmb_expr = pmb_expr;
      Ast_408.Parsetree.pmb_attributes = pmb_attributes;
      Ast_408.Parsetree.pmb_loc = pmb_loc }
    ->
    {
      Ast_409.Parsetree.pmb_name = (copy_loc (fun x -> x) pmb_name);
      Ast_409.Parsetree.pmb_expr = (copy_module_expr pmb_expr);
      Ast_409.Parsetree.pmb_attributes = (copy_attributes pmb_attributes);
      Ast_409.Parsetree.pmb_loc = (copy_location pmb_loc)
    }
and copy_module_expr :
  Ast_408.Parsetree.module_expr -> Ast_409.Parsetree.module_expr =
  fun
    { Ast_408.Parsetree.pmod_desc = pmod_desc;
      Ast_408.Parsetree.pmod_loc = pmod_loc;
      Ast_408.Parsetree.pmod_attributes = pmod_attributes }
    ->
    {
      Ast_409.Parsetree.pmod_desc = (copy_module_expr_desc pmod_desc);
      Ast_409.Parsetree.pmod_loc = (copy_location pmod_loc);
      Ast_409.Parsetree.pmod_attributes = (copy_attributes pmod_attributes)
    }
and copy_module_expr_desc :
  Ast_408.Parsetree.module_expr_desc -> Ast_409.Parsetree.module_expr_desc =
  function
  | Ast_408.Parsetree.Pmod_ident x0 ->
      Ast_409.Parsetree.Pmod_ident (copy_loc copy_Longident_t x0)
  | Ast_408.Parsetree.Pmod_structure x0 ->
      Ast_409.Parsetree.Pmod_structure (copy_structure x0)
  | Ast_408.Parsetree.Pmod_functor (x0, x1, x2) ->
      Ast_409.Parsetree.Pmod_functor
        ((copy_loc (fun x -> x) x0), (Option.map copy_module_type x1),
          (copy_module_expr x2))
  | Ast_408.Parsetree.Pmod_apply (x0, x1) ->
      Ast_409.Parsetree.Pmod_apply
        ((copy_module_expr x0), (copy_module_expr x1))
  | Ast_408.Parsetree.Pmod_constraint (x0, x1) ->
      Ast_409.Parsetree.Pmod_constraint
        ((copy_module_expr x0), (copy_module_type x1))
  | Ast_408.Parsetree.Pmod_unpack x0 ->
      Ast_409.Parsetree.Pmod_unpack (copy_expression x0)
  | Ast_408.Parsetree.Pmod_extension x0 ->
      Ast_409.Parsetree.Pmod_extension (copy_extension x0)
and copy_module_type :
  Ast_408.Parsetree.module_type -> Ast_409.Parsetree.module_type =
  fun
    { Ast_408.Parsetree.pmty_desc = pmty_desc;
      Ast_408.Parsetree.pmty_loc = pmty_loc;
      Ast_408.Parsetree.pmty_attributes = pmty_attributes }
    ->
    {
      Ast_409.Parsetree.pmty_desc = (copy_module_type_desc pmty_desc);
      Ast_409.Parsetree.pmty_loc = (copy_location pmty_loc);
      Ast_409.Parsetree.pmty_attributes = (copy_attributes pmty_attributes)
    }
and copy_module_type_desc :
  Ast_408.Parsetree.module_type_desc -> Ast_409.Parsetree.module_type_desc =
  function
  | Ast_408.Parsetree.Pmty_ident x0 ->
      Ast_409.Parsetree.Pmty_ident (copy_loc copy_Longident_t x0)
  | Ast_408.Parsetree.Pmty_signature x0 ->
      Ast_409.Parsetree.Pmty_signature (copy_signature x0)
  | Ast_408.Parsetree.Pmty_functor (x0, x1, x2) ->
      Ast_409.Parsetree.Pmty_functor
        ((copy_loc (fun x -> x) x0), (Option.map copy_module_type x1),
          (copy_module_type x2))
  | Ast_408.Parsetree.Pmty_with (x0, x1) ->
      Ast_409.Parsetree.Pmty_with
        ((copy_module_type x0), (List.map copy_with_constraint x1))
  | Ast_408.Parsetree.Pmty_typeof x0 ->
      Ast_409.Parsetree.Pmty_typeof (copy_module_expr x0)
  | Ast_408.Parsetree.Pmty_extension x0 ->
      Ast_409.Parsetree.Pmty_extension (copy_extension x0)
  | Ast_408.Parsetree.Pmty_alias x0 ->
      Ast_409.Parsetree.Pmty_alias (copy_loc copy_Longident_t x0)
and copy_with_constraint :
  Ast_408.Parsetree.with_constraint -> Ast_409.Parsetree.with_constraint =
  function
  | Ast_408.Parsetree.Pwith_type (x0, x1) ->
      Ast_409.Parsetree.Pwith_type
        ((copy_loc copy_Longident_t x0), (copy_type_declaration x1))
  | Ast_408.Parsetree.Pwith_module (x0, x1) ->
      Ast_409.Parsetree.Pwith_module
        ((copy_loc copy_Longident_t x0), (copy_loc copy_Longident_t x1))
  | Ast_408.Parsetree.Pwith_typesubst (x0, x1) ->
      Ast_409.Parsetree.Pwith_typesubst
        ((copy_loc copy_Longident_t x0), (copy_type_declaration x1))
  | Ast_408.Parsetree.Pwith_modsubst (x0, x1) ->
      Ast_409.Parsetree.Pwith_modsubst
        ((copy_loc copy_Longident_t x0), (copy_loc copy_Longident_t x1))
and copy_signature :
  Ast_408.Parsetree.signature -> Ast_409.Parsetree.signature =
  fun x -> List.map copy_signature_item x
and copy_signature_item :
  Ast_408.Parsetree.signature_item -> Ast_409.Parsetree.signature_item =
  fun
    { Ast_408.Parsetree.psig_desc = psig_desc;
      Ast_408.Parsetree.psig_loc = psig_loc }
    ->
    {
      Ast_409.Parsetree.psig_desc = (copy_signature_item_desc psig_desc);
      Ast_409.Parsetree.psig_loc = (copy_location psig_loc)
    }
and copy_signature_item_desc :
  Ast_408.Parsetree.signature_item_desc ->
    Ast_409.Parsetree.signature_item_desc
  =
  function
  | Ast_408.Parsetree.Psig_value x0 ->
      Ast_409.Parsetree.Psig_value (copy_value_description x0)
  | Ast_408.Parsetree.Psig_type (x0, x1) ->
      Ast_409.Parsetree.Psig_type
        ((copy_rec_flag x0), (List.map copy_type_declaration x1))
  | Ast_408.Parsetree.Psig_typesubst x0 ->
      Ast_409.Parsetree.Psig_typesubst (List.map copy_type_declaration x0)
  | Ast_408.Parsetree.Psig_typext x0 ->
      Ast_409.Parsetree.Psig_typext (copy_type_extension x0)
  | Ast_408.Parsetree.Psig_exception x0 ->
      Ast_409.Parsetree.Psig_exception (copy_type_exception x0)
  | Ast_408.Parsetree.Psig_module x0 ->
      Ast_409.Parsetree.Psig_module (copy_module_declaration x0)
  | Ast_408.Parsetree.Psig_modsubst x0 ->
      Ast_409.Parsetree.Psig_modsubst (copy_module_substitution x0)
  | Ast_408.Parsetree.Psig_recmodule x0 ->
      Ast_409.Parsetree.Psig_recmodule (List.map copy_module_declaration x0)
  | Ast_408.Parsetree.Psig_modtype x0 ->
      Ast_409.Parsetree.Psig_modtype (copy_module_type_declaration x0)
  | Ast_408.Parsetree.Psig_open x0 ->
      Ast_409.Parsetree.Psig_open (copy_open_description x0)
  | Ast_408.Parsetree.Psig_include x0 ->
      Ast_409.Parsetree.Psig_include (copy_include_description x0)
  | Ast_408.Parsetree.Psig_class x0 ->
      Ast_409.Parsetree.Psig_class (List.map copy_class_description x0)
  | Ast_408.Parsetree.Psig_class_type x0 ->
      Ast_409.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | Ast_408.Parsetree.Psig_attribute x0 ->
      Ast_409.Parsetree.Psig_attribute (copy_attribute x0)
  | Ast_408.Parsetree.Psig_extension (x0, x1) ->
      Ast_409.Parsetree.Psig_extension
        ((copy_extension x0), (copy_attributes x1))
and copy_class_type_declaration :
  Ast_408.Parsetree.class_type_declaration ->
    Ast_409.Parsetree.class_type_declaration
  = fun x -> copy_class_infos copy_class_type x
and copy_class_description :
  Ast_408.Parsetree.class_description -> Ast_409.Parsetree.class_description
  = fun x -> copy_class_infos copy_class_type x
and copy_class_type :
  Ast_408.Parsetree.class_type -> Ast_409.Parsetree.class_type =
  fun
    { Ast_408.Parsetree.pcty_desc = pcty_desc;
      Ast_408.Parsetree.pcty_loc = pcty_loc;
      Ast_408.Parsetree.pcty_attributes = pcty_attributes }
    ->
    {
      Ast_409.Parsetree.pcty_desc = (copy_class_type_desc pcty_desc);
      Ast_409.Parsetree.pcty_loc = (copy_location pcty_loc);
      Ast_409.Parsetree.pcty_attributes = (copy_attributes pcty_attributes)
    }
and copy_class_type_desc :
  Ast_408.Parsetree.class_type_desc -> Ast_409.Parsetree.class_type_desc =
  function
  | Ast_408.Parsetree.Pcty_constr (x0, x1) ->
      Ast_409.Parsetree.Pcty_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_408.Parsetree.Pcty_signature x0 ->
      Ast_409.Parsetree.Pcty_signature (copy_class_signature x0)
  | Ast_408.Parsetree.Pcty_arrow (x0, x1, x2) ->
      Ast_409.Parsetree.Pcty_arrow
        ((copy_arg_label x0), (copy_core_type x1), (copy_class_type x2))
  | Ast_408.Parsetree.Pcty_extension x0 ->
      Ast_409.Parsetree.Pcty_extension (copy_extension x0)
  | Ast_408.Parsetree.Pcty_open (x0, x1) ->
      Ast_409.Parsetree.Pcty_open
        ((copy_open_description x0), (copy_class_type x1))
and copy_class_signature :
  Ast_408.Parsetree.class_signature -> Ast_409.Parsetree.class_signature =
  fun
    { Ast_408.Parsetree.pcsig_self = pcsig_self;
      Ast_408.Parsetree.pcsig_fields = pcsig_fields }
    ->
    {
      Ast_409.Parsetree.pcsig_self = (copy_core_type pcsig_self);
      Ast_409.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }
and copy_class_type_field :
  Ast_408.Parsetree.class_type_field -> Ast_409.Parsetree.class_type_field =
  fun
    { Ast_408.Parsetree.pctf_desc = pctf_desc;
      Ast_408.Parsetree.pctf_loc = pctf_loc;
      Ast_408.Parsetree.pctf_attributes = pctf_attributes }
    ->
    {
      Ast_409.Parsetree.pctf_desc = (copy_class_type_field_desc pctf_desc);
      Ast_409.Parsetree.pctf_loc = (copy_location pctf_loc);
      Ast_409.Parsetree.pctf_attributes = (copy_attributes pctf_attributes)
    }
and copy_class_type_field_desc :
  Ast_408.Parsetree.class_type_field_desc ->
    Ast_409.Parsetree.class_type_field_desc
  =
  function
  | Ast_408.Parsetree.Pctf_inherit x0 ->
      Ast_409.Parsetree.Pctf_inherit (copy_class_type x0)
  | Ast_408.Parsetree.Pctf_val x0 ->
      Ast_409.Parsetree.Pctf_val
        (let (x0, x1, x2, x3) = x0 in
         ((copy_loc copy_label x0), (copy_mutable_flag x1),
           (copy_virtual_flag x2), (copy_core_type x3)))
  | Ast_408.Parsetree.Pctf_method x0 ->
      Ast_409.Parsetree.Pctf_method
        (let (x0, x1, x2, x3) = x0 in
         ((copy_loc copy_label x0), (copy_private_flag x1),
           (copy_virtual_flag x2), (copy_core_type x3)))
  | Ast_408.Parsetree.Pctf_constraint x0 ->
      Ast_409.Parsetree.Pctf_constraint
        (let (x0, x1) = x0 in ((copy_core_type x0), (copy_core_type x1)))
  | Ast_408.Parsetree.Pctf_attribute x0 ->
      Ast_409.Parsetree.Pctf_attribute (copy_attribute x0)
  | Ast_408.Parsetree.Pctf_extension x0 ->
      Ast_409.Parsetree.Pctf_extension (copy_extension x0)
and copy_extension :
  Ast_408.Parsetree.extension -> Ast_409.Parsetree.extension =
  fun x ->
    let (x0, x1) = x in ((copy_loc (fun x -> x) x0), (copy_payload x1))
and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_408.Parsetree.class_infos -> 'g0 Ast_409.Parsetree.class_infos
  =
  fun f0 ->
    fun
      { Ast_408.Parsetree.pci_virt = pci_virt;
        Ast_408.Parsetree.pci_params = pci_params;
        Ast_408.Parsetree.pci_name = pci_name;
        Ast_408.Parsetree.pci_expr = pci_expr;
        Ast_408.Parsetree.pci_loc = pci_loc;
        Ast_408.Parsetree.pci_attributes = pci_attributes }
      ->
      {
        Ast_409.Parsetree.pci_virt = (copy_virtual_flag pci_virt);
        Ast_409.Parsetree.pci_params =
          (List.map
             (fun x ->
                let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
             pci_params);
        Ast_409.Parsetree.pci_name = (copy_loc (fun x -> x) pci_name);
        Ast_409.Parsetree.pci_expr = (f0 pci_expr);
        Ast_409.Parsetree.pci_loc = (copy_location pci_loc);
        Ast_409.Parsetree.pci_attributes = (copy_attributes pci_attributes)
      }
and copy_virtual_flag :
  Ast_408.Asttypes.virtual_flag -> Ast_409.Asttypes.virtual_flag =
  function
  | Ast_408.Asttypes.Virtual -> Ast_409.Asttypes.Virtual
  | Ast_408.Asttypes.Concrete -> Ast_409.Asttypes.Concrete
and copy_include_description :
  Ast_408.Parsetree.include_description ->
    Ast_409.Parsetree.include_description
  = fun x -> copy_include_infos copy_module_type x
and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_408.Parsetree.include_infos ->
        'g0 Ast_409.Parsetree.include_infos
  =
  fun f0 ->
    fun
      { Ast_408.Parsetree.pincl_mod = pincl_mod;
        Ast_408.Parsetree.pincl_loc = pincl_loc;
        Ast_408.Parsetree.pincl_attributes = pincl_attributes }
      ->
      {
        Ast_409.Parsetree.pincl_mod = (f0 pincl_mod);
        Ast_409.Parsetree.pincl_loc = (copy_location pincl_loc);
        Ast_409.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }
and copy_open_description :
  Ast_408.Parsetree.open_description -> Ast_409.Parsetree.open_description =
  fun x -> copy_open_infos (fun x -> copy_loc copy_Longident_t x) x
and copy_open_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_408.Parsetree.open_infos -> 'g0 Ast_409.Parsetree.open_infos
  =
  fun f0 ->
    fun
      { Ast_408.Parsetree.popen_expr = popen_expr;
        Ast_408.Parsetree.popen_override = popen_override;
        Ast_408.Parsetree.popen_loc = popen_loc;
        Ast_408.Parsetree.popen_attributes = popen_attributes }
      ->
      {
        Ast_409.Parsetree.popen_expr = (f0 popen_expr);
        Ast_409.Parsetree.popen_override =
          (copy_override_flag popen_override);
        Ast_409.Parsetree.popen_loc = (copy_location popen_loc);
        Ast_409.Parsetree.popen_attributes =
          (copy_attributes popen_attributes)
      }
and copy_override_flag :
  Ast_408.Asttypes.override_flag -> Ast_409.Asttypes.override_flag =
  function
  | Ast_408.Asttypes.Override -> Ast_409.Asttypes.Override
  | Ast_408.Asttypes.Fresh -> Ast_409.Asttypes.Fresh
and copy_module_type_declaration :
  Ast_408.Parsetree.module_type_declaration ->
    Ast_409.Parsetree.module_type_declaration
  =
  fun
    { Ast_408.Parsetree.pmtd_name = pmtd_name;
      Ast_408.Parsetree.pmtd_type = pmtd_type;
      Ast_408.Parsetree.pmtd_attributes = pmtd_attributes;
      Ast_408.Parsetree.pmtd_loc = pmtd_loc }
    ->
    {
      Ast_409.Parsetree.pmtd_name = (copy_loc (fun x -> x) pmtd_name);
      Ast_409.Parsetree.pmtd_type = (Option.map copy_module_type pmtd_type);
      Ast_409.Parsetree.pmtd_attributes = (copy_attributes pmtd_attributes);
      Ast_409.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }
and copy_module_substitution :
  Ast_408.Parsetree.module_substitution ->
    Ast_409.Parsetree.module_substitution
  =
  fun
    { Ast_408.Parsetree.pms_name = pms_name;
      Ast_408.Parsetree.pms_manifest = pms_manifest;
      Ast_408.Parsetree.pms_attributes = pms_attributes;
      Ast_408.Parsetree.pms_loc = pms_loc }
    ->
    {
      Ast_409.Parsetree.pms_name = (copy_loc (fun x -> x) pms_name);
      Ast_409.Parsetree.pms_manifest =
        (copy_loc copy_Longident_t pms_manifest);
      Ast_409.Parsetree.pms_attributes = (copy_attributes pms_attributes);
      Ast_409.Parsetree.pms_loc = (copy_location pms_loc)
    }
and copy_module_declaration :
  Ast_408.Parsetree.module_declaration ->
    Ast_409.Parsetree.module_declaration
  =
  fun
    { Ast_408.Parsetree.pmd_name = pmd_name;
      Ast_408.Parsetree.pmd_type = pmd_type;
      Ast_408.Parsetree.pmd_attributes = pmd_attributes;
      Ast_408.Parsetree.pmd_loc = pmd_loc }
    ->
    {
      Ast_409.Parsetree.pmd_name = (copy_loc (fun x -> x) pmd_name);
      Ast_409.Parsetree.pmd_type = (copy_module_type pmd_type);
      Ast_409.Parsetree.pmd_attributes = (copy_attributes pmd_attributes);
      Ast_409.Parsetree.pmd_loc = (copy_location pmd_loc)
    }
and copy_type_exception :
  Ast_408.Parsetree.type_exception -> Ast_409.Parsetree.type_exception =
  fun
    { Ast_408.Parsetree.ptyexn_constructor = ptyexn_constructor;
      Ast_408.Parsetree.ptyexn_loc = ptyexn_loc;
      Ast_408.Parsetree.ptyexn_attributes = ptyexn_attributes }
    ->
    {
      Ast_409.Parsetree.ptyexn_constructor =
        (copy_extension_constructor ptyexn_constructor);
      Ast_409.Parsetree.ptyexn_loc = (copy_location ptyexn_loc);
      Ast_409.Parsetree.ptyexn_attributes =
        (copy_attributes ptyexn_attributes)
    }
and copy_type_extension :
  Ast_408.Parsetree.type_extension -> Ast_409.Parsetree.type_extension =
  fun
    { Ast_408.Parsetree.ptyext_path = ptyext_path;
      Ast_408.Parsetree.ptyext_params = ptyext_params;
      Ast_408.Parsetree.ptyext_constructors = ptyext_constructors;
      Ast_408.Parsetree.ptyext_private = ptyext_private;
      Ast_408.Parsetree.ptyext_loc = ptyext_loc;
      Ast_408.Parsetree.ptyext_attributes = ptyext_attributes }
    ->
    {
      Ast_409.Parsetree.ptyext_path = (copy_loc copy_Longident_t ptyext_path);
      Ast_409.Parsetree.ptyext_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
           ptyext_params);
      Ast_409.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor ptyext_constructors);
      Ast_409.Parsetree.ptyext_private = (copy_private_flag ptyext_private);
      Ast_409.Parsetree.ptyext_loc = (copy_location ptyext_loc);
      Ast_409.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }
and copy_extension_constructor :
  Ast_408.Parsetree.extension_constructor ->
    Ast_409.Parsetree.extension_constructor
  =
  fun
    { Ast_408.Parsetree.pext_name = pext_name;
      Ast_408.Parsetree.pext_kind = pext_kind;
      Ast_408.Parsetree.pext_loc = pext_loc;
      Ast_408.Parsetree.pext_attributes = pext_attributes }
    ->
    {
      Ast_409.Parsetree.pext_name = (copy_loc (fun x -> x) pext_name);
      Ast_409.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      Ast_409.Parsetree.pext_loc = (copy_location pext_loc);
      Ast_409.Parsetree.pext_attributes = (copy_attributes pext_attributes)
    }
and copy_extension_constructor_kind :
  Ast_408.Parsetree.extension_constructor_kind ->
    Ast_409.Parsetree.extension_constructor_kind
  =
  function
  | Ast_408.Parsetree.Pext_decl (x0, x1) ->
      Ast_409.Parsetree.Pext_decl
        ((copy_constructor_arguments x0), (Option.map copy_core_type x1))
  | Ast_408.Parsetree.Pext_rebind x0 ->
      Ast_409.Parsetree.Pext_rebind (copy_loc copy_Longident_t x0)
and copy_type_declaration :
  Ast_408.Parsetree.type_declaration -> Ast_409.Parsetree.type_declaration =
  fun
    { Ast_408.Parsetree.ptype_name = ptype_name;
      Ast_408.Parsetree.ptype_params = ptype_params;
      Ast_408.Parsetree.ptype_cstrs = ptype_cstrs;
      Ast_408.Parsetree.ptype_kind = ptype_kind;
      Ast_408.Parsetree.ptype_private = ptype_private;
      Ast_408.Parsetree.ptype_manifest = ptype_manifest;
      Ast_408.Parsetree.ptype_attributes = ptype_attributes;
      Ast_408.Parsetree.ptype_loc = ptype_loc }
    ->
    {
      Ast_409.Parsetree.ptype_name = (copy_loc (fun x -> x) ptype_name);
      Ast_409.Parsetree.ptype_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
           ptype_params);
      Ast_409.Parsetree.ptype_cstrs =
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              ((copy_core_type x0), (copy_core_type x1), (copy_location x2)))
           ptype_cstrs);
      Ast_409.Parsetree.ptype_kind = (copy_type_kind ptype_kind);
      Ast_409.Parsetree.ptype_private = (copy_private_flag ptype_private);
      Ast_409.Parsetree.ptype_manifest =
        (Option.map copy_core_type ptype_manifest);
      Ast_409.Parsetree.ptype_attributes = (copy_attributes ptype_attributes);
      Ast_409.Parsetree.ptype_loc = (copy_location ptype_loc)
    }
and copy_private_flag :
  Ast_408.Asttypes.private_flag -> Ast_409.Asttypes.private_flag =
  function
  | Ast_408.Asttypes.Private -> Ast_409.Asttypes.Private
  | Ast_408.Asttypes.Public -> Ast_409.Asttypes.Public
and copy_type_kind :
  Ast_408.Parsetree.type_kind -> Ast_409.Parsetree.type_kind =
  function
  | Ast_408.Parsetree.Ptype_abstract -> Ast_409.Parsetree.Ptype_abstract
  | Ast_408.Parsetree.Ptype_variant x0 ->
      Ast_409.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | Ast_408.Parsetree.Ptype_record x0 ->
      Ast_409.Parsetree.Ptype_record (List.map copy_label_declaration x0)
  | Ast_408.Parsetree.Ptype_open -> Ast_409.Parsetree.Ptype_open
and copy_constructor_declaration :
  Ast_408.Parsetree.constructor_declaration ->
    Ast_409.Parsetree.constructor_declaration
  =
  fun
    { Ast_408.Parsetree.pcd_name = pcd_name;
      Ast_408.Parsetree.pcd_args = pcd_args;
      Ast_408.Parsetree.pcd_res = pcd_res;
      Ast_408.Parsetree.pcd_loc = pcd_loc;
      Ast_408.Parsetree.pcd_attributes = pcd_attributes }
    ->
    {
      Ast_409.Parsetree.pcd_name = (copy_loc (fun x -> x) pcd_name);
      Ast_409.Parsetree.pcd_args = (copy_constructor_arguments pcd_args);
      Ast_409.Parsetree.pcd_res = (Option.map copy_core_type pcd_res);
      Ast_409.Parsetree.pcd_loc = (copy_location pcd_loc);
      Ast_409.Parsetree.pcd_attributes = (copy_attributes pcd_attributes)
    }
and copy_constructor_arguments :
  Ast_408.Parsetree.constructor_arguments ->
    Ast_409.Parsetree.constructor_arguments
  =
  function
  | Ast_408.Parsetree.Pcstr_tuple x0 ->
      Ast_409.Parsetree.Pcstr_tuple (List.map copy_core_type x0)
  | Ast_408.Parsetree.Pcstr_record x0 ->
      Ast_409.Parsetree.Pcstr_record (List.map copy_label_declaration x0)
and copy_label_declaration :
  Ast_408.Parsetree.label_declaration -> Ast_409.Parsetree.label_declaration
  =
  fun
    { Ast_408.Parsetree.pld_name = pld_name;
      Ast_408.Parsetree.pld_mutable = pld_mutable;
      Ast_408.Parsetree.pld_type = pld_type;
      Ast_408.Parsetree.pld_loc = pld_loc;
      Ast_408.Parsetree.pld_attributes = pld_attributes }
    ->
    {
      Ast_409.Parsetree.pld_name = (copy_loc (fun x -> x) pld_name);
      Ast_409.Parsetree.pld_mutable = (copy_mutable_flag pld_mutable);
      Ast_409.Parsetree.pld_type = (copy_core_type pld_type);
      Ast_409.Parsetree.pld_loc = (copy_location pld_loc);
      Ast_409.Parsetree.pld_attributes = (copy_attributes pld_attributes)
    }
and copy_mutable_flag :
  Ast_408.Asttypes.mutable_flag -> Ast_409.Asttypes.mutable_flag =
  function
  | Ast_408.Asttypes.Immutable -> Ast_409.Asttypes.Immutable
  | Ast_408.Asttypes.Mutable -> Ast_409.Asttypes.Mutable
and copy_variance : Ast_408.Asttypes.variance -> Ast_409.Asttypes.variance =
  function
  | Ast_408.Asttypes.Covariant -> Ast_409.Asttypes.Covariant
  | Ast_408.Asttypes.Contravariant -> Ast_409.Asttypes.Contravariant
  | Ast_408.Asttypes.Invariant -> Ast_409.Asttypes.Invariant
and copy_value_description :
  Ast_408.Parsetree.value_description -> Ast_409.Parsetree.value_description
  =
  fun
    { Ast_408.Parsetree.pval_name = pval_name;
      Ast_408.Parsetree.pval_type = pval_type;
      Ast_408.Parsetree.pval_prim = pval_prim;
      Ast_408.Parsetree.pval_attributes = pval_attributes;
      Ast_408.Parsetree.pval_loc = pval_loc }
    ->
    {
      Ast_409.Parsetree.pval_name = (copy_loc (fun x -> x) pval_name);
      Ast_409.Parsetree.pval_type = (copy_core_type pval_type);
      Ast_409.Parsetree.pval_prim = (List.map (fun x -> x) pval_prim);
      Ast_409.Parsetree.pval_attributes = (copy_attributes pval_attributes);
      Ast_409.Parsetree.pval_loc = (copy_location pval_loc)
    }
and copy_object_field_desc :
  Ast_408.Parsetree.object_field_desc -> Ast_409.Parsetree.object_field_desc
  =
  function
  | Ast_408.Parsetree.Otag (x0, x1) ->
      Ast_409.Parsetree.Otag ((copy_loc copy_label x0), (copy_core_type x1))
  | Ast_408.Parsetree.Oinherit x0 ->
      Ast_409.Parsetree.Oinherit (copy_core_type x0)
and copy_arg_label : Ast_408.Asttypes.arg_label -> Ast_409.Asttypes.arg_label
  =
  function
  | Ast_408.Asttypes.Nolabel -> Ast_409.Asttypes.Nolabel
  | Ast_408.Asttypes.Labelled x0 -> Ast_409.Asttypes.Labelled x0
  | Ast_408.Asttypes.Optional x0 -> Ast_409.Asttypes.Optional x0
and copy_closed_flag :
  Ast_408.Asttypes.closed_flag -> Ast_409.Asttypes.closed_flag =
  function
  | Ast_408.Asttypes.Closed -> Ast_409.Asttypes.Closed
  | Ast_408.Asttypes.Open -> Ast_409.Asttypes.Open
and copy_label : Ast_408.Asttypes.label -> Ast_409.Asttypes.label =
  fun x -> x
and copy_rec_flag : Ast_408.Asttypes.rec_flag -> Ast_409.Asttypes.rec_flag =
  function
  | Ast_408.Asttypes.Nonrecursive -> Ast_409.Asttypes.Nonrecursive
  | Ast_408.Asttypes.Recursive -> Ast_409.Asttypes.Recursive
and copy_constant : Ast_408.Parsetree.constant -> Ast_409.Parsetree.constant
  =
  function
  | Ast_408.Parsetree.Pconst_integer (x0, x1) ->
      Ast_409.Parsetree.Pconst_integer (x0, (Option.map (fun x -> x) x1))
  | Ast_408.Parsetree.Pconst_char x0 -> Ast_409.Parsetree.Pconst_char x0
  | Ast_408.Parsetree.Pconst_string (x0, x1) ->
      Ast_409.Parsetree.Pconst_string (x0, (Option.map (fun x -> x) x1))
  | Ast_408.Parsetree.Pconst_float (x0, x1) ->
      Ast_409.Parsetree.Pconst_float (x0, (Option.map (fun x -> x) x1))
and copy_Longident_t : Ast_408.Longident.t -> Ast_409.Longident.t =
  function
  | Ast_408.Longident.Lident x0 -> Ast_409.Longident.Lident x0
  | Ast_408.Longident.Ldot (x0, x1) ->
      Ast_409.Longident.Ldot ((copy_Longident_t x0), x1)
  | Ast_408.Longident.Lapply (x0, x1) ->
      Ast_409.Longident.Lapply ((copy_Longident_t x0), (copy_Longident_t x1))
and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 Ast_408.Asttypes.loc -> 'g0 Ast_409.Asttypes.loc
  =
  fun f0 ->
    fun { Ast_408.Asttypes.txt = txt; Ast_408.Asttypes.loc = loc } ->
      {
        Ast_409.Asttypes.txt = (f0 txt);
        Ast_409.Asttypes.loc = (copy_location loc)
      }
and copy_location : Ast_408.Location.t -> Ast_409.Location.t =
  fun
    { Ast_408.Location.loc_start = loc_start;
      Ast_408.Location.loc_end = loc_end;
      Ast_408.Location.loc_ghost = loc_ghost }
    ->
    {
      Ast_409.Location.loc_start = (copy_position loc_start);
      Ast_409.Location.loc_end = (copy_position loc_end);
      Ast_409.Location.loc_ghost = loc_ghost
    }
and copy_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
    ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

end
module Migrate_parsetree_409_408_migrate
= struct
#1 "migrate_parsetree_409_408_migrate.ml"
# 1 "src/migrate_parsetree_409_408_migrate.ml"
open Stdlib0
module From = Ast_409
module To = Ast_408
let rec copy_out_type_extension :
  Ast_409.Outcometree.out_type_extension ->
    Ast_408.Outcometree.out_type_extension
  =
  fun
    { Ast_409.Outcometree.otyext_name = otyext_name;
      Ast_409.Outcometree.otyext_params = otyext_params;
      Ast_409.Outcometree.otyext_constructors = otyext_constructors;
      Ast_409.Outcometree.otyext_private = otyext_private }
    ->
    {
      Ast_408.Outcometree.otyext_name = otyext_name;
      Ast_408.Outcometree.otyext_params =
        (List.map (fun x -> x) otyext_params);
      Ast_408.Outcometree.otyext_constructors =
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              (x0, (List.map copy_out_type x1),
                (Option.map copy_out_type x2))) otyext_constructors);
      Ast_408.Outcometree.otyext_private = (copy_private_flag otyext_private)
    }
and copy_out_phrase :
  Ast_409.Outcometree.out_phrase -> Ast_408.Outcometree.out_phrase =
  function
  | Ast_409.Outcometree.Ophr_eval (x0, x1) ->
      Ast_408.Outcometree.Ophr_eval ((copy_out_value x0), (copy_out_type x1))
  | Ast_409.Outcometree.Ophr_signature x0 ->
      Ast_408.Outcometree.Ophr_signature
        (List.map
           (fun x ->
              let (x0, x1) = x in
              ((copy_out_sig_item x0), (Option.map copy_out_value x1))) x0)
  | Ast_409.Outcometree.Ophr_exception x0 ->
      Ast_408.Outcometree.Ophr_exception
        (let (x0, x1) = x0 in (x0, (copy_out_value x1)))
and copy_out_sig_item :
  Ast_409.Outcometree.out_sig_item -> Ast_408.Outcometree.out_sig_item =
  function
  | Ast_409.Outcometree.Osig_class (x0, x1, x2, x3, x4) ->
      Ast_408.Outcometree.Osig_class
        (x0, x1,
          (List.map
             (fun x ->
                let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1)))) x2),
          (copy_out_class_type x3), (copy_out_rec_status x4))
  | Ast_409.Outcometree.Osig_class_type (x0, x1, x2, x3, x4) ->
      Ast_408.Outcometree.Osig_class_type
        (x0, x1,
          (List.map
             (fun x ->
                let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1)))) x2),
          (copy_out_class_type x3), (copy_out_rec_status x4))
  | Ast_409.Outcometree.Osig_typext (x0, x1) ->
      Ast_408.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0), (copy_out_ext_status x1))
  | Ast_409.Outcometree.Osig_modtype (x0, x1) ->
      Ast_408.Outcometree.Osig_modtype (x0, (copy_out_module_type x1))
  | Ast_409.Outcometree.Osig_module (x0, x1, x2) ->
      Ast_408.Outcometree.Osig_module
        (x0, (copy_out_module_type x1), (copy_out_rec_status x2))
  | Ast_409.Outcometree.Osig_type (x0, x1) ->
      Ast_408.Outcometree.Osig_type
        ((copy_out_type_decl x0), (copy_out_rec_status x1))
  | Ast_409.Outcometree.Osig_value x0 ->
      Ast_408.Outcometree.Osig_value (copy_out_val_decl x0)
  | Ast_409.Outcometree.Osig_ellipsis -> Ast_408.Outcometree.Osig_ellipsis
and copy_out_val_decl :
  Ast_409.Outcometree.out_val_decl -> Ast_408.Outcometree.out_val_decl =
  fun
    { Ast_409.Outcometree.oval_name = oval_name;
      Ast_409.Outcometree.oval_type = oval_type;
      Ast_409.Outcometree.oval_prims = oval_prims;
      Ast_409.Outcometree.oval_attributes = oval_attributes }
    ->
    {
      Ast_408.Outcometree.oval_name = oval_name;
      Ast_408.Outcometree.oval_type = (copy_out_type oval_type);
      Ast_408.Outcometree.oval_prims = (List.map (fun x -> x) oval_prims);
      Ast_408.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }
and copy_out_type_decl :
  Ast_409.Outcometree.out_type_decl -> Ast_408.Outcometree.out_type_decl =
  fun
    { Ast_409.Outcometree.otype_name = otype_name;
      Ast_409.Outcometree.otype_params = otype_params;
      Ast_409.Outcometree.otype_type = otype_type;
      Ast_409.Outcometree.otype_private = otype_private;
      Ast_409.Outcometree.otype_immediate = otype_immediate;
      Ast_409.Outcometree.otype_unboxed = otype_unboxed;
      Ast_409.Outcometree.otype_cstrs = otype_cstrs }
    ->
    {
      Ast_408.Outcometree.otype_name = otype_name;
      Ast_408.Outcometree.otype_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1))))
           otype_params);
      Ast_408.Outcometree.otype_type = (copy_out_type otype_type);
      Ast_408.Outcometree.otype_private = (copy_private_flag otype_private);
      Ast_408.Outcometree.otype_immediate = otype_immediate;
      Ast_408.Outcometree.otype_unboxed = otype_unboxed;
      Ast_408.Outcometree.otype_cstrs =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_out_type x0), (copy_out_type x1)))
           otype_cstrs)
    }
and copy_out_module_type :
  Ast_409.Outcometree.out_module_type -> Ast_408.Outcometree.out_module_type
  =
  function
  | Ast_409.Outcometree.Omty_abstract -> Ast_408.Outcometree.Omty_abstract
  | Ast_409.Outcometree.Omty_functor (x0, x1, x2) ->
      Ast_408.Outcometree.Omty_functor
        (x0, (Option.map copy_out_module_type x1), (copy_out_module_type x2))
  | Ast_409.Outcometree.Omty_ident x0 ->
      Ast_408.Outcometree.Omty_ident (copy_out_ident x0)
  | Ast_409.Outcometree.Omty_signature x0 ->
      Ast_408.Outcometree.Omty_signature (List.map copy_out_sig_item x0)
  | Ast_409.Outcometree.Omty_alias x0 ->
      Ast_408.Outcometree.Omty_alias (copy_out_ident x0)
and copy_out_ext_status :
  Ast_409.Outcometree.out_ext_status -> Ast_408.Outcometree.out_ext_status =
  function
  | Ast_409.Outcometree.Oext_first -> Ast_408.Outcometree.Oext_first
  | Ast_409.Outcometree.Oext_next -> Ast_408.Outcometree.Oext_next
  | Ast_409.Outcometree.Oext_exception -> Ast_408.Outcometree.Oext_exception
and copy_out_extension_constructor :
  Ast_409.Outcometree.out_extension_constructor ->
    Ast_408.Outcometree.out_extension_constructor
  =
  fun
    { Ast_409.Outcometree.oext_name = oext_name;
      Ast_409.Outcometree.oext_type_name = oext_type_name;
      Ast_409.Outcometree.oext_type_params = oext_type_params;
      Ast_409.Outcometree.oext_args = oext_args;
      Ast_409.Outcometree.oext_ret_type = oext_ret_type;
      Ast_409.Outcometree.oext_private = oext_private }
    ->
    {
      Ast_408.Outcometree.oext_name = oext_name;
      Ast_408.Outcometree.oext_type_name = oext_type_name;
      Ast_408.Outcometree.oext_type_params =
        (List.map (fun x -> x) oext_type_params);
      Ast_408.Outcometree.oext_args = (List.map copy_out_type oext_args);
      Ast_408.Outcometree.oext_ret_type =
        (Option.map copy_out_type oext_ret_type);
      Ast_408.Outcometree.oext_private = (copy_private_flag oext_private)
    }
and copy_out_rec_status :
  Ast_409.Outcometree.out_rec_status -> Ast_408.Outcometree.out_rec_status =
  function
  | Ast_409.Outcometree.Orec_not -> Ast_408.Outcometree.Orec_not
  | Ast_409.Outcometree.Orec_first -> Ast_408.Outcometree.Orec_first
  | Ast_409.Outcometree.Orec_next -> Ast_408.Outcometree.Orec_next
and copy_out_class_type :
  Ast_409.Outcometree.out_class_type -> Ast_408.Outcometree.out_class_type =
  function
  | Ast_409.Outcometree.Octy_constr (x0, x1) ->
      Ast_408.Outcometree.Octy_constr
        ((copy_out_ident x0), (List.map copy_out_type x1))
  | Ast_409.Outcometree.Octy_arrow (x0, x1, x2) ->
      Ast_408.Outcometree.Octy_arrow
        (x0, (copy_out_type x1), (copy_out_class_type x2))
  | Ast_409.Outcometree.Octy_signature (x0, x1) ->
      Ast_408.Outcometree.Octy_signature
        ((Option.map copy_out_type x0),
          (List.map copy_out_class_sig_item x1))
and copy_out_class_sig_item :
  Ast_409.Outcometree.out_class_sig_item ->
    Ast_408.Outcometree.out_class_sig_item
  =
  function
  | Ast_409.Outcometree.Ocsg_constraint (x0, x1) ->
      Ast_408.Outcometree.Ocsg_constraint
        ((copy_out_type x0), (copy_out_type x1))
  | Ast_409.Outcometree.Ocsg_method (x0, x1, x2, x3) ->
      Ast_408.Outcometree.Ocsg_method (x0, x1, x2, (copy_out_type x3))
  | Ast_409.Outcometree.Ocsg_value (x0, x1, x2, x3) ->
      Ast_408.Outcometree.Ocsg_value (x0, x1, x2, (copy_out_type x3))
and copy_out_type :
  Ast_409.Outcometree.out_type -> Ast_408.Outcometree.out_type =
  function
  | Ast_409.Outcometree.Otyp_abstract -> Ast_408.Outcometree.Otyp_abstract
  | Ast_409.Outcometree.Otyp_open -> Ast_408.Outcometree.Otyp_open
  | Ast_409.Outcometree.Otyp_alias (x0, x1) ->
      Ast_408.Outcometree.Otyp_alias ((copy_out_type x0), x1)
  | Ast_409.Outcometree.Otyp_arrow (x0, x1, x2) ->
      Ast_408.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1), (copy_out_type x2))
  | Ast_409.Outcometree.Otyp_class (x0, x1, x2) ->
      Ast_408.Outcometree.Otyp_class
        (x0, (copy_out_ident x1), (List.map copy_out_type x2))
  | Ast_409.Outcometree.Otyp_constr (x0, x1) ->
      Ast_408.Outcometree.Otyp_constr
        ((copy_out_ident x0), (List.map copy_out_type x1))
  | Ast_409.Outcometree.Otyp_manifest (x0, x1) ->
      Ast_408.Outcometree.Otyp_manifest
        ((copy_out_type x0), (copy_out_type x1))
  | Ast_409.Outcometree.Otyp_object (x0, x1) ->
      Ast_408.Outcometree.Otyp_object
        ((List.map (fun x -> let (x0, x1) = x in (x0, (copy_out_type x1))) x0),
          (Option.map (fun x -> x) x1))
  | Ast_409.Outcometree.Otyp_record x0 ->
      Ast_408.Outcometree.Otyp_record
        (List.map
           (fun x -> let (x0, x1, x2) = x in (x0, x1, (copy_out_type x2))) x0)
  | Ast_409.Outcometree.Otyp_stuff x0 -> Ast_408.Outcometree.Otyp_stuff x0
  | Ast_409.Outcometree.Otyp_sum x0 ->
      Ast_408.Outcometree.Otyp_sum
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              (x0, (List.map copy_out_type x1),
                (Option.map copy_out_type x2))) x0)
  | Ast_409.Outcometree.Otyp_tuple x0 ->
      Ast_408.Outcometree.Otyp_tuple (List.map copy_out_type x0)
  | Ast_409.Outcometree.Otyp_var (x0, x1) ->
      Ast_408.Outcometree.Otyp_var (x0, x1)
  | Ast_409.Outcometree.Otyp_variant (x0, x1, x2, x3) ->
      Ast_408.Outcometree.Otyp_variant
        (x0, (copy_out_variant x1), x2,
          (Option.map (fun x -> List.map (fun x -> x) x) x3))
  | Ast_409.Outcometree.Otyp_poly (x0, x1) ->
      Ast_408.Outcometree.Otyp_poly
        ((List.map (fun x -> x) x0), (copy_out_type x1))
  | Ast_409.Outcometree.Otyp_module (x0, x1, x2) ->
      Ast_408.Outcometree.Otyp_module
        ((copy_out_ident x0), (List.map (fun x -> x) x1),
          (List.map copy_out_type x2))
  | Ast_409.Outcometree.Otyp_attribute (x0, x1) ->
      Ast_408.Outcometree.Otyp_attribute
        ((copy_out_type x0), (copy_out_attribute x1))
and copy_out_attribute :
  Ast_409.Outcometree.out_attribute -> Ast_408.Outcometree.out_attribute =
  fun { Ast_409.Outcometree.oattr_name = oattr_name } ->
    { Ast_408.Outcometree.oattr_name = oattr_name }
and copy_out_variant :
  Ast_409.Outcometree.out_variant -> Ast_408.Outcometree.out_variant =
  function
  | Ast_409.Outcometree.Ovar_fields x0 ->
      Ast_408.Outcometree.Ovar_fields
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in (x0, x1, (List.map copy_out_type x2)))
           x0)
  | Ast_409.Outcometree.Ovar_typ x0 ->
      Ast_408.Outcometree.Ovar_typ (copy_out_type x0)
and copy_out_value :
  Ast_409.Outcometree.out_value -> Ast_408.Outcometree.out_value =
  function
  | Ast_409.Outcometree.Oval_array x0 ->
      Ast_408.Outcometree.Oval_array (List.map copy_out_value x0)
  | Ast_409.Outcometree.Oval_char x0 -> Ast_408.Outcometree.Oval_char x0
  | Ast_409.Outcometree.Oval_constr (x0, x1) ->
      Ast_408.Outcometree.Oval_constr
        ((copy_out_ident x0), (List.map copy_out_value x1))
  | Ast_409.Outcometree.Oval_ellipsis -> Ast_408.Outcometree.Oval_ellipsis
  | Ast_409.Outcometree.Oval_float x0 -> Ast_408.Outcometree.Oval_float x0
  | Ast_409.Outcometree.Oval_int x0 -> Ast_408.Outcometree.Oval_int x0
  | Ast_409.Outcometree.Oval_int32 x0 -> Ast_408.Outcometree.Oval_int32 x0
  | Ast_409.Outcometree.Oval_int64 x0 -> Ast_408.Outcometree.Oval_int64 x0
  | Ast_409.Outcometree.Oval_nativeint x0 ->
      Ast_408.Outcometree.Oval_nativeint x0
  | Ast_409.Outcometree.Oval_list x0 ->
      Ast_408.Outcometree.Oval_list (List.map copy_out_value x0)
  | Ast_409.Outcometree.Oval_printer x0 ->
      Ast_408.Outcometree.Oval_printer x0
  | Ast_409.Outcometree.Oval_record x0 ->
      Ast_408.Outcometree.Oval_record
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_out_ident x0), (copy_out_value x1)))
           x0)
  | Ast_409.Outcometree.Oval_string (x0, x1, x2) ->
      Ast_408.Outcometree.Oval_string (x0, x1, (copy_out_string x2))
  | Ast_409.Outcometree.Oval_stuff x0 -> Ast_408.Outcometree.Oval_stuff x0
  | Ast_409.Outcometree.Oval_tuple x0 ->
      Ast_408.Outcometree.Oval_tuple (List.map copy_out_value x0)
  | Ast_409.Outcometree.Oval_variant (x0, x1) ->
      Ast_408.Outcometree.Oval_variant (x0, (Option.map copy_out_value x1))
and copy_out_string :
  Ast_409.Outcometree.out_string -> Ast_408.Outcometree.out_string =
  function
  | Ast_409.Outcometree.Ostr_string -> Ast_408.Outcometree.Ostr_string
  | Ast_409.Outcometree.Ostr_bytes -> Ast_408.Outcometree.Ostr_bytes
and copy_out_ident :
  Ast_409.Outcometree.out_ident -> Ast_408.Outcometree.out_ident =
  function
  | Ast_409.Outcometree.Oide_apply (x0, x1) ->
      Ast_408.Outcometree.Oide_apply
        ((copy_out_ident x0), (copy_out_ident x1))
  | Ast_409.Outcometree.Oide_dot (x0, x1) ->
      Ast_408.Outcometree.Oide_dot ((copy_out_ident x0), x1)
  | Ast_409.Outcometree.Oide_ident x0 ->
      Ast_408.Outcometree.Oide_ident (copy_out_name x0)
and copy_out_name :
  Ast_409.Outcometree.out_name -> Ast_408.Outcometree.out_name =
  fun { Ast_409.Outcometree.printed_name = printed_name } ->
    { Ast_408.Outcometree.printed_name = printed_name }
and copy_toplevel_phrase :
  Ast_409.Parsetree.toplevel_phrase -> Ast_408.Parsetree.toplevel_phrase =
  function
  | Ast_409.Parsetree.Ptop_def x0 ->
      Ast_408.Parsetree.Ptop_def (copy_structure x0)
  | Ast_409.Parsetree.Ptop_dir x0 ->
      Ast_408.Parsetree.Ptop_dir (copy_toplevel_directive x0)
and copy_toplevel_directive :
  Ast_409.Parsetree.toplevel_directive ->
    Ast_408.Parsetree.toplevel_directive
  =
  fun
    { Ast_409.Parsetree.pdir_name = pdir_name;
      Ast_409.Parsetree.pdir_arg = pdir_arg;
      Ast_409.Parsetree.pdir_loc = pdir_loc }
    ->
    {
      Ast_408.Parsetree.pdir_name = (copy_loc (fun x -> x) pdir_name);
      Ast_408.Parsetree.pdir_arg =
        (Option.map copy_directive_argument pdir_arg);
      Ast_408.Parsetree.pdir_loc = (copy_location pdir_loc)
    }
and copy_directive_argument :
  Ast_409.Parsetree.directive_argument ->
    Ast_408.Parsetree.directive_argument
  =
  fun
    { Ast_409.Parsetree.pdira_desc = pdira_desc;
      Ast_409.Parsetree.pdira_loc = pdira_loc }
    ->
    {
      Ast_408.Parsetree.pdira_desc =
        (copy_directive_argument_desc pdira_desc);
      Ast_408.Parsetree.pdira_loc = (copy_location pdira_loc)
    }
and copy_directive_argument_desc :
  Ast_409.Parsetree.directive_argument_desc ->
    Ast_408.Parsetree.directive_argument_desc
  =
  function
  | Ast_409.Parsetree.Pdir_string x0 -> Ast_408.Parsetree.Pdir_string x0
  | Ast_409.Parsetree.Pdir_int (x0, x1) ->
      Ast_408.Parsetree.Pdir_int (x0, (Option.map (fun x -> x) x1))
  | Ast_409.Parsetree.Pdir_ident x0 ->
      Ast_408.Parsetree.Pdir_ident (copy_Longident_t x0)
  | Ast_409.Parsetree.Pdir_bool x0 -> Ast_408.Parsetree.Pdir_bool x0
and copy_typ : Ast_409.Parsetree.typ -> Ast_408.Parsetree.typ =
  fun x -> copy_core_type x
and copy_pat : Ast_409.Parsetree.pat -> Ast_408.Parsetree.pat =
  fun x -> copy_pattern x
and copy_expr : Ast_409.Parsetree.expr -> Ast_408.Parsetree.expr =
  fun x -> copy_expression x
and copy_expression :
  Ast_409.Parsetree.expression -> Ast_408.Parsetree.expression =
  fun
    { Ast_409.Parsetree.pexp_desc = pexp_desc;
      Ast_409.Parsetree.pexp_loc = pexp_loc;
      Ast_409.Parsetree.pexp_loc_stack = pexp_loc_stack;
      Ast_409.Parsetree.pexp_attributes = pexp_attributes }
    ->
    {
      Ast_408.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
      Ast_408.Parsetree.pexp_loc = (copy_location pexp_loc);
      Ast_408.Parsetree.pexp_loc_stack =
        (List.map copy_location pexp_loc_stack);
      Ast_408.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
    }
and copy_expression_desc :
  Ast_409.Parsetree.expression_desc -> Ast_408.Parsetree.expression_desc =
  function
  | Ast_409.Parsetree.Pexp_ident x0 ->
      Ast_408.Parsetree.Pexp_ident (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Pexp_constant x0 ->
      Ast_408.Parsetree.Pexp_constant (copy_constant x0)
  | Ast_409.Parsetree.Pexp_let (x0, x1, x2) ->
      Ast_408.Parsetree.Pexp_let
        ((copy_rec_flag x0), (List.map copy_value_binding x1),
          (copy_expression x2))
  | Ast_409.Parsetree.Pexp_function x0 ->
      Ast_408.Parsetree.Pexp_function (copy_cases x0)
  | Ast_409.Parsetree.Pexp_fun (x0, x1, x2, x3) ->
      Ast_408.Parsetree.Pexp_fun
        ((copy_arg_label x0), (Option.map copy_expression x1),
          (copy_pattern x2), (copy_expression x3))
  | Ast_409.Parsetree.Pexp_apply (x0, x1) ->
      Ast_408.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x ->
                let (x0, x1) = x in
                ((copy_arg_label x0), (copy_expression x1))) x1))
  | Ast_409.Parsetree.Pexp_match (x0, x1) ->
      Ast_408.Parsetree.Pexp_match ((copy_expression x0), (copy_cases x1))
  | Ast_409.Parsetree.Pexp_try (x0, x1) ->
      Ast_408.Parsetree.Pexp_try ((copy_expression x0), (copy_cases x1))
  | Ast_409.Parsetree.Pexp_tuple x0 ->
      Ast_408.Parsetree.Pexp_tuple (List.map copy_expression x0)
  | Ast_409.Parsetree.Pexp_construct (x0, x1) ->
      Ast_408.Parsetree.Pexp_construct
        ((copy_loc copy_Longident_t x0), (Option.map copy_expression x1))
  | Ast_409.Parsetree.Pexp_variant (x0, x1) ->
      Ast_408.Parsetree.Pexp_variant
        ((copy_label x0), (Option.map copy_expression x1))
  | Ast_409.Parsetree.Pexp_record (x0, x1) ->
      Ast_408.Parsetree.Pexp_record
        ((List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_loc copy_Longident_t x0), (copy_expression x1))) x0),
          (Option.map copy_expression x1))
  | Ast_409.Parsetree.Pexp_field (x0, x1) ->
      Ast_408.Parsetree.Pexp_field
        ((copy_expression x0), (copy_loc copy_Longident_t x1))
  | Ast_409.Parsetree.Pexp_setfield (x0, x1, x2) ->
      Ast_408.Parsetree.Pexp_setfield
        ((copy_expression x0), (copy_loc copy_Longident_t x1),
          (copy_expression x2))
  | Ast_409.Parsetree.Pexp_array x0 ->
      Ast_408.Parsetree.Pexp_array (List.map copy_expression x0)
  | Ast_409.Parsetree.Pexp_ifthenelse (x0, x1, x2) ->
      Ast_408.Parsetree.Pexp_ifthenelse
        ((copy_expression x0), (copy_expression x1),
          (Option.map copy_expression x2))
  | Ast_409.Parsetree.Pexp_sequence (x0, x1) ->
      Ast_408.Parsetree.Pexp_sequence
        ((copy_expression x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_while (x0, x1) ->
      Ast_408.Parsetree.Pexp_while
        ((copy_expression x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_for (x0, x1, x2, x3, x4) ->
      Ast_408.Parsetree.Pexp_for
        ((copy_pattern x0), (copy_expression x1), (copy_expression x2),
          (copy_direction_flag x3), (copy_expression x4))
  | Ast_409.Parsetree.Pexp_constraint (x0, x1) ->
      Ast_408.Parsetree.Pexp_constraint
        ((copy_expression x0), (copy_core_type x1))
  | Ast_409.Parsetree.Pexp_coerce (x0, x1, x2) ->
      Ast_408.Parsetree.Pexp_coerce
        ((copy_expression x0), (Option.map copy_core_type x1),
          (copy_core_type x2))
  | Ast_409.Parsetree.Pexp_send (x0, x1) ->
      Ast_408.Parsetree.Pexp_send
        ((copy_expression x0), (copy_loc copy_label x1))
  | Ast_409.Parsetree.Pexp_new x0 ->
      Ast_408.Parsetree.Pexp_new (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Pexp_setinstvar (x0, x1) ->
      Ast_408.Parsetree.Pexp_setinstvar
        ((copy_loc copy_label x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_override x0 ->
      Ast_408.Parsetree.Pexp_override
        (List.map
           (fun x ->
              let (x0, x1) = x in
              ((copy_loc copy_label x0), (copy_expression x1))) x0)
  | Ast_409.Parsetree.Pexp_letmodule (x0, x1, x2) ->
      Ast_408.Parsetree.Pexp_letmodule
        ((copy_loc (fun x -> x) x0), (copy_module_expr x1),
          (copy_expression x2))
  | Ast_409.Parsetree.Pexp_letexception (x0, x1) ->
      Ast_408.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_assert x0 ->
      Ast_408.Parsetree.Pexp_assert (copy_expression x0)
  | Ast_409.Parsetree.Pexp_lazy x0 ->
      Ast_408.Parsetree.Pexp_lazy (copy_expression x0)
  | Ast_409.Parsetree.Pexp_poly (x0, x1) ->
      Ast_408.Parsetree.Pexp_poly
        ((copy_expression x0), (Option.map copy_core_type x1))
  | Ast_409.Parsetree.Pexp_object x0 ->
      Ast_408.Parsetree.Pexp_object (copy_class_structure x0)
  | Ast_409.Parsetree.Pexp_newtype (x0, x1) ->
      Ast_408.Parsetree.Pexp_newtype
        ((copy_loc (fun x -> x) x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_pack x0 ->
      Ast_408.Parsetree.Pexp_pack (copy_module_expr x0)
  | Ast_409.Parsetree.Pexp_open (x0, x1) ->
      Ast_408.Parsetree.Pexp_open
        ((copy_open_declaration x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_letop x0 ->
      Ast_408.Parsetree.Pexp_letop (copy_letop x0)
  | Ast_409.Parsetree.Pexp_extension x0 ->
      Ast_408.Parsetree.Pexp_extension (copy_extension x0)
  | Ast_409.Parsetree.Pexp_unreachable -> Ast_408.Parsetree.Pexp_unreachable
and copy_letop : Ast_409.Parsetree.letop -> Ast_408.Parsetree.letop =
  fun
    { Ast_409.Parsetree.let_ = let_; Ast_409.Parsetree.ands = ands;
      Ast_409.Parsetree.body = body }
    ->
    {
      Ast_408.Parsetree.let_ = (copy_binding_op let_);
      Ast_408.Parsetree.ands = (List.map copy_binding_op ands);
      Ast_408.Parsetree.body = (copy_expression body)
    }
and copy_binding_op :
  Ast_409.Parsetree.binding_op -> Ast_408.Parsetree.binding_op =
  fun
    { Ast_409.Parsetree.pbop_op = pbop_op;
      Ast_409.Parsetree.pbop_pat = pbop_pat;
      Ast_409.Parsetree.pbop_exp = pbop_exp;
      Ast_409.Parsetree.pbop_loc = pbop_loc }
    ->
    {
      Ast_408.Parsetree.pbop_op = (copy_loc (fun x -> x) pbop_op);
      Ast_408.Parsetree.pbop_pat = (copy_pattern pbop_pat);
      Ast_408.Parsetree.pbop_exp = (copy_expression pbop_exp);
      Ast_408.Parsetree.pbop_loc = (copy_location pbop_loc)
    }
and copy_direction_flag :
  Ast_409.Asttypes.direction_flag -> Ast_408.Asttypes.direction_flag =
  function
  | Ast_409.Asttypes.Upto -> Ast_408.Asttypes.Upto
  | Ast_409.Asttypes.Downto -> Ast_408.Asttypes.Downto
and copy_cases : Ast_409.Parsetree.cases -> Ast_408.Parsetree.cases =
  fun x -> List.map copy_case x
and copy_case : Ast_409.Parsetree.case -> Ast_408.Parsetree.case =
  fun
    { Ast_409.Parsetree.pc_lhs = pc_lhs;
      Ast_409.Parsetree.pc_guard = pc_guard;
      Ast_409.Parsetree.pc_rhs = pc_rhs }
    ->
    {
      Ast_408.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      Ast_408.Parsetree.pc_guard = (Option.map copy_expression pc_guard);
      Ast_408.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }
and copy_value_binding :
  Ast_409.Parsetree.value_binding -> Ast_408.Parsetree.value_binding =
  fun
    { Ast_409.Parsetree.pvb_pat = pvb_pat;
      Ast_409.Parsetree.pvb_expr = pvb_expr;
      Ast_409.Parsetree.pvb_attributes = pvb_attributes;
      Ast_409.Parsetree.pvb_loc = pvb_loc }
    ->
    {
      Ast_408.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      Ast_408.Parsetree.pvb_expr = (copy_expression pvb_expr);
      Ast_408.Parsetree.pvb_attributes = (copy_attributes pvb_attributes);
      Ast_408.Parsetree.pvb_loc = (copy_location pvb_loc)
    }
and copy_pattern : Ast_409.Parsetree.pattern -> Ast_408.Parsetree.pattern =
  fun
    { Ast_409.Parsetree.ppat_desc = ppat_desc;
      Ast_409.Parsetree.ppat_loc = ppat_loc;
      Ast_409.Parsetree.ppat_loc_stack = ppat_loc_stack;
      Ast_409.Parsetree.ppat_attributes = ppat_attributes }
    ->
    {
      Ast_408.Parsetree.ppat_desc = (copy_pattern_desc ppat_desc);
      Ast_408.Parsetree.ppat_loc = (copy_location ppat_loc);
      Ast_408.Parsetree.ppat_loc_stack =
        (List.map copy_location ppat_loc_stack);
      Ast_408.Parsetree.ppat_attributes = (copy_attributes ppat_attributes)
    }
and copy_pattern_desc :
  Ast_409.Parsetree.pattern_desc -> Ast_408.Parsetree.pattern_desc =
  function
  | Ast_409.Parsetree.Ppat_any -> Ast_408.Parsetree.Ppat_any
  | Ast_409.Parsetree.Ppat_var x0 ->
      Ast_408.Parsetree.Ppat_var (copy_loc (fun x -> x) x0)
  | Ast_409.Parsetree.Ppat_alias (x0, x1) ->
      Ast_408.Parsetree.Ppat_alias
        ((copy_pattern x0), (copy_loc (fun x -> x) x1))
  | Ast_409.Parsetree.Ppat_constant x0 ->
      Ast_408.Parsetree.Ppat_constant (copy_constant x0)
  | Ast_409.Parsetree.Ppat_interval (x0, x1) ->
      Ast_408.Parsetree.Ppat_interval
        ((copy_constant x0), (copy_constant x1))
  | Ast_409.Parsetree.Ppat_tuple x0 ->
      Ast_408.Parsetree.Ppat_tuple (List.map copy_pattern x0)
  | Ast_409.Parsetree.Ppat_construct (x0, x1) ->
      Ast_408.Parsetree.Ppat_construct
        ((copy_loc copy_Longident_t x0), (Option.map copy_pattern x1))
  | Ast_409.Parsetree.Ppat_variant (x0, x1) ->
      Ast_408.Parsetree.Ppat_variant
        ((copy_label x0), (Option.map copy_pattern x1))
  | Ast_409.Parsetree.Ppat_record (x0, x1) ->
      Ast_408.Parsetree.Ppat_record
        ((List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_loc copy_Longident_t x0), (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | Ast_409.Parsetree.Ppat_array x0 ->
      Ast_408.Parsetree.Ppat_array (List.map copy_pattern x0)
  | Ast_409.Parsetree.Ppat_or (x0, x1) ->
      Ast_408.Parsetree.Ppat_or ((copy_pattern x0), (copy_pattern x1))
  | Ast_409.Parsetree.Ppat_constraint (x0, x1) ->
      Ast_408.Parsetree.Ppat_constraint
        ((copy_pattern x0), (copy_core_type x1))
  | Ast_409.Parsetree.Ppat_type x0 ->
      Ast_408.Parsetree.Ppat_type (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Ppat_lazy x0 ->
      Ast_408.Parsetree.Ppat_lazy (copy_pattern x0)
  | Ast_409.Parsetree.Ppat_unpack x0 ->
      Ast_408.Parsetree.Ppat_unpack (copy_loc (fun x -> x) x0)
  | Ast_409.Parsetree.Ppat_exception x0 ->
      Ast_408.Parsetree.Ppat_exception (copy_pattern x0)
  | Ast_409.Parsetree.Ppat_extension x0 ->
      Ast_408.Parsetree.Ppat_extension (copy_extension x0)
  | Ast_409.Parsetree.Ppat_open (x0, x1) ->
      Ast_408.Parsetree.Ppat_open
        ((copy_loc copy_Longident_t x0), (copy_pattern x1))
and copy_core_type :
  Ast_409.Parsetree.core_type -> Ast_408.Parsetree.core_type =
  fun
    { Ast_409.Parsetree.ptyp_desc = ptyp_desc;
      Ast_409.Parsetree.ptyp_loc = ptyp_loc;
      Ast_409.Parsetree.ptyp_loc_stack = ptyp_loc_stack;
      Ast_409.Parsetree.ptyp_attributes = ptyp_attributes }
    ->
    {
      Ast_408.Parsetree.ptyp_desc = (copy_core_type_desc ptyp_desc);
      Ast_408.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      Ast_408.Parsetree.ptyp_loc_stack =
        (List.map copy_location ptyp_loc_stack);
      Ast_408.Parsetree.ptyp_attributes = (copy_attributes ptyp_attributes)
    }
and copy_core_type_desc :
  Ast_409.Parsetree.core_type_desc -> Ast_408.Parsetree.core_type_desc =
  function
  | Ast_409.Parsetree.Ptyp_any -> Ast_408.Parsetree.Ptyp_any
  | Ast_409.Parsetree.Ptyp_var x0 -> Ast_408.Parsetree.Ptyp_var x0
  | Ast_409.Parsetree.Ptyp_arrow (x0, x1, x2) ->
      Ast_408.Parsetree.Ptyp_arrow
        ((copy_arg_label x0), (copy_core_type x1), (copy_core_type x2))
  | Ast_409.Parsetree.Ptyp_tuple x0 ->
      Ast_408.Parsetree.Ptyp_tuple (List.map copy_core_type x0)
  | Ast_409.Parsetree.Ptyp_constr (x0, x1) ->
      Ast_408.Parsetree.Ptyp_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_409.Parsetree.Ptyp_object (x0, x1) ->
      Ast_408.Parsetree.Ptyp_object
        ((List.map copy_object_field x0), (copy_closed_flag x1))
  | Ast_409.Parsetree.Ptyp_class (x0, x1) ->
      Ast_408.Parsetree.Ptyp_class
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_409.Parsetree.Ptyp_alias (x0, x1) ->
      Ast_408.Parsetree.Ptyp_alias ((copy_core_type x0), x1)
  | Ast_409.Parsetree.Ptyp_variant (x0, x1, x2) ->
      Ast_408.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0), (copy_closed_flag x1),
          (Option.map (fun x -> List.map copy_label x) x2))
  | Ast_409.Parsetree.Ptyp_poly (x0, x1) ->
      Ast_408.Parsetree.Ptyp_poly
        ((List.map (fun x -> copy_loc (fun x -> x) x) x0),
          (copy_core_type x1))
  | Ast_409.Parsetree.Ptyp_package x0 ->
      Ast_408.Parsetree.Ptyp_package (copy_package_type x0)
  | Ast_409.Parsetree.Ptyp_extension x0 ->
      Ast_408.Parsetree.Ptyp_extension (copy_extension x0)
and copy_package_type :
  Ast_409.Parsetree.package_type -> Ast_408.Parsetree.package_type =
  fun x ->
    let (x0, x1) = x in
    ((copy_loc copy_Longident_t x0),
      (List.map
         (fun x ->
            let (x0, x1) = x in
            ((copy_loc copy_Longident_t x0), (copy_core_type x1))) x1))
and copy_row_field :
  Ast_409.Parsetree.row_field -> Ast_408.Parsetree.row_field =
  fun
    { Ast_409.Parsetree.prf_desc = prf_desc;
      Ast_409.Parsetree.prf_loc = prf_loc;
      Ast_409.Parsetree.prf_attributes = prf_attributes }
    ->
    {
      Ast_408.Parsetree.prf_desc = (copy_row_field_desc prf_desc);
      Ast_408.Parsetree.prf_loc = (copy_location prf_loc);
      Ast_408.Parsetree.prf_attributes = (copy_attributes prf_attributes)
    }
and copy_row_field_desc :
  Ast_409.Parsetree.row_field_desc -> Ast_408.Parsetree.row_field_desc =
  function
  | Ast_409.Parsetree.Rtag (x0, x1, x2) ->
      Ast_408.Parsetree.Rtag
        ((copy_loc copy_label x0), x1, (List.map copy_core_type x2))
  | Ast_409.Parsetree.Rinherit x0 ->
      Ast_408.Parsetree.Rinherit (copy_core_type x0)
and copy_object_field :
  Ast_409.Parsetree.object_field -> Ast_408.Parsetree.object_field =
  fun
    { Ast_409.Parsetree.pof_desc = pof_desc;
      Ast_409.Parsetree.pof_loc = pof_loc;
      Ast_409.Parsetree.pof_attributes = pof_attributes }
    ->
    {
      Ast_408.Parsetree.pof_desc = (copy_object_field_desc pof_desc);
      Ast_408.Parsetree.pof_loc = (copy_location pof_loc);
      Ast_408.Parsetree.pof_attributes = (copy_attributes pof_attributes)
    }
and copy_attributes :
  Ast_409.Parsetree.attributes -> Ast_408.Parsetree.attributes =
  fun x -> List.map copy_attribute x
and copy_attribute :
  Ast_409.Parsetree.attribute -> Ast_408.Parsetree.attribute =
  fun
    { Ast_409.Parsetree.attr_name = attr_name;
      Ast_409.Parsetree.attr_payload = attr_payload;
      Ast_409.Parsetree.attr_loc = attr_loc }
    ->
    {
      Ast_408.Parsetree.attr_name = (copy_loc (fun x -> x) attr_name);
      Ast_408.Parsetree.attr_payload = (copy_payload attr_payload);
      Ast_408.Parsetree.attr_loc = (copy_location attr_loc)
    }
and copy_payload : Ast_409.Parsetree.payload -> Ast_408.Parsetree.payload =
  function
  | Ast_409.Parsetree.PStr x0 -> Ast_408.Parsetree.PStr (copy_structure x0)
  | Ast_409.Parsetree.PSig x0 -> Ast_408.Parsetree.PSig (copy_signature x0)
  | Ast_409.Parsetree.PTyp x0 -> Ast_408.Parsetree.PTyp (copy_core_type x0)
  | Ast_409.Parsetree.PPat (x0, x1) ->
      Ast_408.Parsetree.PPat
        ((copy_pattern x0), (Option.map copy_expression x1))
and copy_structure :
  Ast_409.Parsetree.structure -> Ast_408.Parsetree.structure =
  fun x -> List.map copy_structure_item x
and copy_structure_item :
  Ast_409.Parsetree.structure_item -> Ast_408.Parsetree.structure_item =
  fun
    { Ast_409.Parsetree.pstr_desc = pstr_desc;
      Ast_409.Parsetree.pstr_loc = pstr_loc }
    ->
    {
      Ast_408.Parsetree.pstr_desc = (copy_structure_item_desc pstr_desc);
      Ast_408.Parsetree.pstr_loc = (copy_location pstr_loc)
    }
and copy_structure_item_desc :
  Ast_409.Parsetree.structure_item_desc ->
    Ast_408.Parsetree.structure_item_desc
  =
  function
  | Ast_409.Parsetree.Pstr_eval (x0, x1) ->
      Ast_408.Parsetree.Pstr_eval
        ((copy_expression x0), (copy_attributes x1))
  | Ast_409.Parsetree.Pstr_value (x0, x1) ->
      Ast_408.Parsetree.Pstr_value
        ((copy_rec_flag x0), (List.map copy_value_binding x1))
  | Ast_409.Parsetree.Pstr_primitive x0 ->
      Ast_408.Parsetree.Pstr_primitive (copy_value_description x0)
  | Ast_409.Parsetree.Pstr_type (x0, x1) ->
      Ast_408.Parsetree.Pstr_type
        ((copy_rec_flag x0), (List.map copy_type_declaration x1))
  | Ast_409.Parsetree.Pstr_typext x0 ->
      Ast_408.Parsetree.Pstr_typext (copy_type_extension x0)
  | Ast_409.Parsetree.Pstr_exception x0 ->
      Ast_408.Parsetree.Pstr_exception (copy_type_exception x0)
  | Ast_409.Parsetree.Pstr_module x0 ->
      Ast_408.Parsetree.Pstr_module (copy_module_binding x0)
  | Ast_409.Parsetree.Pstr_recmodule x0 ->
      Ast_408.Parsetree.Pstr_recmodule (List.map copy_module_binding x0)
  | Ast_409.Parsetree.Pstr_modtype x0 ->
      Ast_408.Parsetree.Pstr_modtype (copy_module_type_declaration x0)
  | Ast_409.Parsetree.Pstr_open x0 ->
      Ast_408.Parsetree.Pstr_open (copy_open_declaration x0)
  | Ast_409.Parsetree.Pstr_class x0 ->
      Ast_408.Parsetree.Pstr_class (List.map copy_class_declaration x0)
  | Ast_409.Parsetree.Pstr_class_type x0 ->
      Ast_408.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | Ast_409.Parsetree.Pstr_include x0 ->
      Ast_408.Parsetree.Pstr_include (copy_include_declaration x0)
  | Ast_409.Parsetree.Pstr_attribute x0 ->
      Ast_408.Parsetree.Pstr_attribute (copy_attribute x0)
  | Ast_409.Parsetree.Pstr_extension (x0, x1) ->
      Ast_408.Parsetree.Pstr_extension
        ((copy_extension x0), (copy_attributes x1))
and copy_include_declaration :
  Ast_409.Parsetree.include_declaration ->
    Ast_408.Parsetree.include_declaration
  = fun x -> copy_include_infos copy_module_expr x
and copy_class_declaration :
  Ast_409.Parsetree.class_declaration -> Ast_408.Parsetree.class_declaration
  = fun x -> copy_class_infos copy_class_expr x
and copy_class_expr :
  Ast_409.Parsetree.class_expr -> Ast_408.Parsetree.class_expr =
  fun
    { Ast_409.Parsetree.pcl_desc = pcl_desc;
      Ast_409.Parsetree.pcl_loc = pcl_loc;
      Ast_409.Parsetree.pcl_attributes = pcl_attributes }
    ->
    {
      Ast_408.Parsetree.pcl_desc = (copy_class_expr_desc pcl_desc);
      Ast_408.Parsetree.pcl_loc = (copy_location pcl_loc);
      Ast_408.Parsetree.pcl_attributes = (copy_attributes pcl_attributes)
    }
and copy_class_expr_desc :
  Ast_409.Parsetree.class_expr_desc -> Ast_408.Parsetree.class_expr_desc =
  function
  | Ast_409.Parsetree.Pcl_constr (x0, x1) ->
      Ast_408.Parsetree.Pcl_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_409.Parsetree.Pcl_structure x0 ->
      Ast_408.Parsetree.Pcl_structure (copy_class_structure x0)
  | Ast_409.Parsetree.Pcl_fun (x0, x1, x2, x3) ->
      Ast_408.Parsetree.Pcl_fun
        ((copy_arg_label x0), (Option.map copy_expression x1),
          (copy_pattern x2), (copy_class_expr x3))
  | Ast_409.Parsetree.Pcl_apply (x0, x1) ->
      Ast_408.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x ->
                let (x0, x1) = x in
                ((copy_arg_label x0), (copy_expression x1))) x1))
  | Ast_409.Parsetree.Pcl_let (x0, x1, x2) ->
      Ast_408.Parsetree.Pcl_let
        ((copy_rec_flag x0), (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | Ast_409.Parsetree.Pcl_constraint (x0, x1) ->
      Ast_408.Parsetree.Pcl_constraint
        ((copy_class_expr x0), (copy_class_type x1))
  | Ast_409.Parsetree.Pcl_extension x0 ->
      Ast_408.Parsetree.Pcl_extension (copy_extension x0)
  | Ast_409.Parsetree.Pcl_open (x0, x1) ->
      Ast_408.Parsetree.Pcl_open
        ((copy_open_description x0), (copy_class_expr x1))
and copy_class_structure :
  Ast_409.Parsetree.class_structure -> Ast_408.Parsetree.class_structure =
  fun
    { Ast_409.Parsetree.pcstr_self = pcstr_self;
      Ast_409.Parsetree.pcstr_fields = pcstr_fields }
    ->
    {
      Ast_408.Parsetree.pcstr_self = (copy_pattern pcstr_self);
      Ast_408.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }
and copy_class_field :
  Ast_409.Parsetree.class_field -> Ast_408.Parsetree.class_field =
  fun
    { Ast_409.Parsetree.pcf_desc = pcf_desc;
      Ast_409.Parsetree.pcf_loc = pcf_loc;
      Ast_409.Parsetree.pcf_attributes = pcf_attributes }
    ->
    {
      Ast_408.Parsetree.pcf_desc = (copy_class_field_desc pcf_desc);
      Ast_408.Parsetree.pcf_loc = (copy_location pcf_loc);
      Ast_408.Parsetree.pcf_attributes = (copy_attributes pcf_attributes)
    }
and copy_class_field_desc :
  Ast_409.Parsetree.class_field_desc -> Ast_408.Parsetree.class_field_desc =
  function
  | Ast_409.Parsetree.Pcf_inherit (x0, x1, x2) ->
      Ast_408.Parsetree.Pcf_inherit
        ((copy_override_flag x0), (copy_class_expr x1),
          (Option.map (fun x -> copy_loc (fun x -> x) x) x2))
  | Ast_409.Parsetree.Pcf_val x0 ->
      Ast_408.Parsetree.Pcf_val
        (let (x0, x1, x2) = x0 in
         ((copy_loc copy_label x0), (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | Ast_409.Parsetree.Pcf_method x0 ->
      Ast_408.Parsetree.Pcf_method
        (let (x0, x1, x2) = x0 in
         ((copy_loc copy_label x0), (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | Ast_409.Parsetree.Pcf_constraint x0 ->
      Ast_408.Parsetree.Pcf_constraint
        (let (x0, x1) = x0 in ((copy_core_type x0), (copy_core_type x1)))
  | Ast_409.Parsetree.Pcf_initializer x0 ->
      Ast_408.Parsetree.Pcf_initializer (copy_expression x0)
  | Ast_409.Parsetree.Pcf_attribute x0 ->
      Ast_408.Parsetree.Pcf_attribute (copy_attribute x0)
  | Ast_409.Parsetree.Pcf_extension x0 ->
      Ast_408.Parsetree.Pcf_extension (copy_extension x0)
and copy_class_field_kind :
  Ast_409.Parsetree.class_field_kind -> Ast_408.Parsetree.class_field_kind =
  function
  | Ast_409.Parsetree.Cfk_virtual x0 ->
      Ast_408.Parsetree.Cfk_virtual (copy_core_type x0)
  | Ast_409.Parsetree.Cfk_concrete (x0, x1) ->
      Ast_408.Parsetree.Cfk_concrete
        ((copy_override_flag x0), (copy_expression x1))
and copy_open_declaration :
  Ast_409.Parsetree.open_declaration -> Ast_408.Parsetree.open_declaration =
  fun x -> copy_open_infos copy_module_expr x
and copy_module_binding :
  Ast_409.Parsetree.module_binding -> Ast_408.Parsetree.module_binding =
  fun
    { Ast_409.Parsetree.pmb_name = pmb_name;
      Ast_409.Parsetree.pmb_expr = pmb_expr;
      Ast_409.Parsetree.pmb_attributes = pmb_attributes;
      Ast_409.Parsetree.pmb_loc = pmb_loc }
    ->
    {
      Ast_408.Parsetree.pmb_name = (copy_loc (fun x -> x) pmb_name);
      Ast_408.Parsetree.pmb_expr = (copy_module_expr pmb_expr);
      Ast_408.Parsetree.pmb_attributes = (copy_attributes pmb_attributes);
      Ast_408.Parsetree.pmb_loc = (copy_location pmb_loc)
    }
and copy_module_expr :
  Ast_409.Parsetree.module_expr -> Ast_408.Parsetree.module_expr =
  fun
    { Ast_409.Parsetree.pmod_desc = pmod_desc;
      Ast_409.Parsetree.pmod_loc = pmod_loc;
      Ast_409.Parsetree.pmod_attributes = pmod_attributes }
    ->
    {
      Ast_408.Parsetree.pmod_desc = (copy_module_expr_desc pmod_desc);
      Ast_408.Parsetree.pmod_loc = (copy_location pmod_loc);
      Ast_408.Parsetree.pmod_attributes = (copy_attributes pmod_attributes)
    }
and copy_module_expr_desc :
  Ast_409.Parsetree.module_expr_desc -> Ast_408.Parsetree.module_expr_desc =
  function
  | Ast_409.Parsetree.Pmod_ident x0 ->
      Ast_408.Parsetree.Pmod_ident (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Pmod_structure x0 ->
      Ast_408.Parsetree.Pmod_structure (copy_structure x0)
  | Ast_409.Parsetree.Pmod_functor (x0, x1, x2) ->
      Ast_408.Parsetree.Pmod_functor
        ((copy_loc (fun x -> x) x0), (Option.map copy_module_type x1),
          (copy_module_expr x2))
  | Ast_409.Parsetree.Pmod_apply (x0, x1) ->
      Ast_408.Parsetree.Pmod_apply
        ((copy_module_expr x0), (copy_module_expr x1))
  | Ast_409.Parsetree.Pmod_constraint (x0, x1) ->
      Ast_408.Parsetree.Pmod_constraint
        ((copy_module_expr x0), (copy_module_type x1))
  | Ast_409.Parsetree.Pmod_unpack x0 ->
      Ast_408.Parsetree.Pmod_unpack (copy_expression x0)
  | Ast_409.Parsetree.Pmod_extension x0 ->
      Ast_408.Parsetree.Pmod_extension (copy_extension x0)
and copy_module_type :
  Ast_409.Parsetree.module_type -> Ast_408.Parsetree.module_type =
  fun
    { Ast_409.Parsetree.pmty_desc = pmty_desc;
      Ast_409.Parsetree.pmty_loc = pmty_loc;
      Ast_409.Parsetree.pmty_attributes = pmty_attributes }
    ->
    {
      Ast_408.Parsetree.pmty_desc = (copy_module_type_desc pmty_desc);
      Ast_408.Parsetree.pmty_loc = (copy_location pmty_loc);
      Ast_408.Parsetree.pmty_attributes = (copy_attributes pmty_attributes)
    }
and copy_module_type_desc :
  Ast_409.Parsetree.module_type_desc -> Ast_408.Parsetree.module_type_desc =
  function
  | Ast_409.Parsetree.Pmty_ident x0 ->
      Ast_408.Parsetree.Pmty_ident (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Pmty_signature x0 ->
      Ast_408.Parsetree.Pmty_signature (copy_signature x0)
  | Ast_409.Parsetree.Pmty_functor (x0, x1, x2) ->
      Ast_408.Parsetree.Pmty_functor
        ((copy_loc (fun x -> x) x0), (Option.map copy_module_type x1),
          (copy_module_type x2))
  | Ast_409.Parsetree.Pmty_with (x0, x1) ->
      Ast_408.Parsetree.Pmty_with
        ((copy_module_type x0), (List.map copy_with_constraint x1))
  | Ast_409.Parsetree.Pmty_typeof x0 ->
      Ast_408.Parsetree.Pmty_typeof (copy_module_expr x0)
  | Ast_409.Parsetree.Pmty_extension x0 ->
      Ast_408.Parsetree.Pmty_extension (copy_extension x0)
  | Ast_409.Parsetree.Pmty_alias x0 ->
      Ast_408.Parsetree.Pmty_alias (copy_loc copy_Longident_t x0)
and copy_with_constraint :
  Ast_409.Parsetree.with_constraint -> Ast_408.Parsetree.with_constraint =
  function
  | Ast_409.Parsetree.Pwith_type (x0, x1) ->
      Ast_408.Parsetree.Pwith_type
        ((copy_loc copy_Longident_t x0), (copy_type_declaration x1))
  | Ast_409.Parsetree.Pwith_module (x0, x1) ->
      Ast_408.Parsetree.Pwith_module
        ((copy_loc copy_Longident_t x0), (copy_loc copy_Longident_t x1))
  | Ast_409.Parsetree.Pwith_typesubst (x0, x1) ->
      Ast_408.Parsetree.Pwith_typesubst
        ((copy_loc copy_Longident_t x0), (copy_type_declaration x1))
  | Ast_409.Parsetree.Pwith_modsubst (x0, x1) ->
      Ast_408.Parsetree.Pwith_modsubst
        ((copy_loc copy_Longident_t x0), (copy_loc copy_Longident_t x1))
and copy_signature :
  Ast_409.Parsetree.signature -> Ast_408.Parsetree.signature =
  fun x -> List.map copy_signature_item x
and copy_signature_item :
  Ast_409.Parsetree.signature_item -> Ast_408.Parsetree.signature_item =
  fun
    { Ast_409.Parsetree.psig_desc = psig_desc;
      Ast_409.Parsetree.psig_loc = psig_loc }
    ->
    {
      Ast_408.Parsetree.psig_desc = (copy_signature_item_desc psig_desc);
      Ast_408.Parsetree.psig_loc = (copy_location psig_loc)
    }
and copy_signature_item_desc :
  Ast_409.Parsetree.signature_item_desc ->
    Ast_408.Parsetree.signature_item_desc
  =
  function
  | Ast_409.Parsetree.Psig_value x0 ->
      Ast_408.Parsetree.Psig_value (copy_value_description x0)
  | Ast_409.Parsetree.Psig_type (x0, x1) ->
      Ast_408.Parsetree.Psig_type
        ((copy_rec_flag x0), (List.map copy_type_declaration x1))
  | Ast_409.Parsetree.Psig_typesubst x0 ->
      Ast_408.Parsetree.Psig_typesubst (List.map copy_type_declaration x0)
  | Ast_409.Parsetree.Psig_typext x0 ->
      Ast_408.Parsetree.Psig_typext (copy_type_extension x0)
  | Ast_409.Parsetree.Psig_exception x0 ->
      Ast_408.Parsetree.Psig_exception (copy_type_exception x0)
  | Ast_409.Parsetree.Psig_module x0 ->
      Ast_408.Parsetree.Psig_module (copy_module_declaration x0)
  | Ast_409.Parsetree.Psig_modsubst x0 ->
      Ast_408.Parsetree.Psig_modsubst (copy_module_substitution x0)
  | Ast_409.Parsetree.Psig_recmodule x0 ->
      Ast_408.Parsetree.Psig_recmodule (List.map copy_module_declaration x0)
  | Ast_409.Parsetree.Psig_modtype x0 ->
      Ast_408.Parsetree.Psig_modtype (copy_module_type_declaration x0)
  | Ast_409.Parsetree.Psig_open x0 ->
      Ast_408.Parsetree.Psig_open (copy_open_description x0)
  | Ast_409.Parsetree.Psig_include x0 ->
      Ast_408.Parsetree.Psig_include (copy_include_description x0)
  | Ast_409.Parsetree.Psig_class x0 ->
      Ast_408.Parsetree.Psig_class (List.map copy_class_description x0)
  | Ast_409.Parsetree.Psig_class_type x0 ->
      Ast_408.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | Ast_409.Parsetree.Psig_attribute x0 ->
      Ast_408.Parsetree.Psig_attribute (copy_attribute x0)
  | Ast_409.Parsetree.Psig_extension (x0, x1) ->
      Ast_408.Parsetree.Psig_extension
        ((copy_extension x0), (copy_attributes x1))
and copy_class_type_declaration :
  Ast_409.Parsetree.class_type_declaration ->
    Ast_408.Parsetree.class_type_declaration
  = fun x -> copy_class_infos copy_class_type x
and copy_class_description :
  Ast_409.Parsetree.class_description -> Ast_408.Parsetree.class_description
  = fun x -> copy_class_infos copy_class_type x
and copy_class_type :
  Ast_409.Parsetree.class_type -> Ast_408.Parsetree.class_type =
  fun
    { Ast_409.Parsetree.pcty_desc = pcty_desc;
      Ast_409.Parsetree.pcty_loc = pcty_loc;
      Ast_409.Parsetree.pcty_attributes = pcty_attributes }
    ->
    {
      Ast_408.Parsetree.pcty_desc = (copy_class_type_desc pcty_desc);
      Ast_408.Parsetree.pcty_loc = (copy_location pcty_loc);
      Ast_408.Parsetree.pcty_attributes = (copy_attributes pcty_attributes)
    }
and copy_class_type_desc :
  Ast_409.Parsetree.class_type_desc -> Ast_408.Parsetree.class_type_desc =
  function
  | Ast_409.Parsetree.Pcty_constr (x0, x1) ->
      Ast_408.Parsetree.Pcty_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_409.Parsetree.Pcty_signature x0 ->
      Ast_408.Parsetree.Pcty_signature (copy_class_signature x0)
  | Ast_409.Parsetree.Pcty_arrow (x0, x1, x2) ->
      Ast_408.Parsetree.Pcty_arrow
        ((copy_arg_label x0), (copy_core_type x1), (copy_class_type x2))
  | Ast_409.Parsetree.Pcty_extension x0 ->
      Ast_408.Parsetree.Pcty_extension (copy_extension x0)
  | Ast_409.Parsetree.Pcty_open (x0, x1) ->
      Ast_408.Parsetree.Pcty_open
        ((copy_open_description x0), (copy_class_type x1))
and copy_class_signature :
  Ast_409.Parsetree.class_signature -> Ast_408.Parsetree.class_signature =
  fun
    { Ast_409.Parsetree.pcsig_self = pcsig_self;
      Ast_409.Parsetree.pcsig_fields = pcsig_fields }
    ->
    {
      Ast_408.Parsetree.pcsig_self = (copy_core_type pcsig_self);
      Ast_408.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }
and copy_class_type_field :
  Ast_409.Parsetree.class_type_field -> Ast_408.Parsetree.class_type_field =
  fun
    { Ast_409.Parsetree.pctf_desc = pctf_desc;
      Ast_409.Parsetree.pctf_loc = pctf_loc;
      Ast_409.Parsetree.pctf_attributes = pctf_attributes }
    ->
    {
      Ast_408.Parsetree.pctf_desc = (copy_class_type_field_desc pctf_desc);
      Ast_408.Parsetree.pctf_loc = (copy_location pctf_loc);
      Ast_408.Parsetree.pctf_attributes = (copy_attributes pctf_attributes)
    }
and copy_class_type_field_desc :
  Ast_409.Parsetree.class_type_field_desc ->
    Ast_408.Parsetree.class_type_field_desc
  =
  function
  | Ast_409.Parsetree.Pctf_inherit x0 ->
      Ast_408.Parsetree.Pctf_inherit (copy_class_type x0)
  | Ast_409.Parsetree.Pctf_val x0 ->
      Ast_408.Parsetree.Pctf_val
        (let (x0, x1, x2, x3) = x0 in
         ((copy_loc copy_label x0), (copy_mutable_flag x1),
           (copy_virtual_flag x2), (copy_core_type x3)))
  | Ast_409.Parsetree.Pctf_method x0 ->
      Ast_408.Parsetree.Pctf_method
        (let (x0, x1, x2, x3) = x0 in
         ((copy_loc copy_label x0), (copy_private_flag x1),
           (copy_virtual_flag x2), (copy_core_type x3)))
  | Ast_409.Parsetree.Pctf_constraint x0 ->
      Ast_408.Parsetree.Pctf_constraint
        (let (x0, x1) = x0 in ((copy_core_type x0), (copy_core_type x1)))
  | Ast_409.Parsetree.Pctf_attribute x0 ->
      Ast_408.Parsetree.Pctf_attribute (copy_attribute x0)
  | Ast_409.Parsetree.Pctf_extension x0 ->
      Ast_408.Parsetree.Pctf_extension (copy_extension x0)
and copy_extension :
  Ast_409.Parsetree.extension -> Ast_408.Parsetree.extension =
  fun x ->
    let (x0, x1) = x in ((copy_loc (fun x -> x) x0), (copy_payload x1))
and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_409.Parsetree.class_infos -> 'g0 Ast_408.Parsetree.class_infos
  =
  fun f0 ->
    fun
      { Ast_409.Parsetree.pci_virt = pci_virt;
        Ast_409.Parsetree.pci_params = pci_params;
        Ast_409.Parsetree.pci_name = pci_name;
        Ast_409.Parsetree.pci_expr = pci_expr;
        Ast_409.Parsetree.pci_loc = pci_loc;
        Ast_409.Parsetree.pci_attributes = pci_attributes }
      ->
      {
        Ast_408.Parsetree.pci_virt = (copy_virtual_flag pci_virt);
        Ast_408.Parsetree.pci_params =
          (List.map
             (fun x ->
                let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
             pci_params);
        Ast_408.Parsetree.pci_name = (copy_loc (fun x -> x) pci_name);
        Ast_408.Parsetree.pci_expr = (f0 pci_expr);
        Ast_408.Parsetree.pci_loc = (copy_location pci_loc);
        Ast_408.Parsetree.pci_attributes = (copy_attributes pci_attributes)
      }
and copy_virtual_flag :
  Ast_409.Asttypes.virtual_flag -> Ast_408.Asttypes.virtual_flag =
  function
  | Ast_409.Asttypes.Virtual -> Ast_408.Asttypes.Virtual
  | Ast_409.Asttypes.Concrete -> Ast_408.Asttypes.Concrete
and copy_include_description :
  Ast_409.Parsetree.include_description ->
    Ast_408.Parsetree.include_description
  = fun x -> copy_include_infos copy_module_type x
and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_409.Parsetree.include_infos ->
        'g0 Ast_408.Parsetree.include_infos
  =
  fun f0 ->
    fun
      { Ast_409.Parsetree.pincl_mod = pincl_mod;
        Ast_409.Parsetree.pincl_loc = pincl_loc;
        Ast_409.Parsetree.pincl_attributes = pincl_attributes }
      ->
      {
        Ast_408.Parsetree.pincl_mod = (f0 pincl_mod);
        Ast_408.Parsetree.pincl_loc = (copy_location pincl_loc);
        Ast_408.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }
and copy_open_description :
  Ast_409.Parsetree.open_description -> Ast_408.Parsetree.open_description =
  fun x -> copy_open_infos (fun x -> copy_loc copy_Longident_t x) x
and copy_open_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_409.Parsetree.open_infos -> 'g0 Ast_408.Parsetree.open_infos
  =
  fun f0 ->
    fun
      { Ast_409.Parsetree.popen_expr = popen_expr;
        Ast_409.Parsetree.popen_override = popen_override;
        Ast_409.Parsetree.popen_loc = popen_loc;
        Ast_409.Parsetree.popen_attributes = popen_attributes }
      ->
      {
        Ast_408.Parsetree.popen_expr = (f0 popen_expr);
        Ast_408.Parsetree.popen_override =
          (copy_override_flag popen_override);
        Ast_408.Parsetree.popen_loc = (copy_location popen_loc);
        Ast_408.Parsetree.popen_attributes =
          (copy_attributes popen_attributes)
      }
and copy_override_flag :
  Ast_409.Asttypes.override_flag -> Ast_408.Asttypes.override_flag =
  function
  | Ast_409.Asttypes.Override -> Ast_408.Asttypes.Override
  | Ast_409.Asttypes.Fresh -> Ast_408.Asttypes.Fresh
and copy_module_type_declaration :
  Ast_409.Parsetree.module_type_declaration ->
    Ast_408.Parsetree.module_type_declaration
  =
  fun
    { Ast_409.Parsetree.pmtd_name = pmtd_name;
      Ast_409.Parsetree.pmtd_type = pmtd_type;
      Ast_409.Parsetree.pmtd_attributes = pmtd_attributes;
      Ast_409.Parsetree.pmtd_loc = pmtd_loc }
    ->
    {
      Ast_408.Parsetree.pmtd_name = (copy_loc (fun x -> x) pmtd_name);
      Ast_408.Parsetree.pmtd_type = (Option.map copy_module_type pmtd_type);
      Ast_408.Parsetree.pmtd_attributes = (copy_attributes pmtd_attributes);
      Ast_408.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }
and copy_module_substitution :
  Ast_409.Parsetree.module_substitution ->
    Ast_408.Parsetree.module_substitution
  =
  fun
    { Ast_409.Parsetree.pms_name = pms_name;
      Ast_409.Parsetree.pms_manifest = pms_manifest;
      Ast_409.Parsetree.pms_attributes = pms_attributes;
      Ast_409.Parsetree.pms_loc = pms_loc }
    ->
    {
      Ast_408.Parsetree.pms_name = (copy_loc (fun x -> x) pms_name);
      Ast_408.Parsetree.pms_manifest =
        (copy_loc copy_Longident_t pms_manifest);
      Ast_408.Parsetree.pms_attributes = (copy_attributes pms_attributes);
      Ast_408.Parsetree.pms_loc = (copy_location pms_loc)
    }
and copy_module_declaration :
  Ast_409.Parsetree.module_declaration ->
    Ast_408.Parsetree.module_declaration
  =
  fun
    { Ast_409.Parsetree.pmd_name = pmd_name;
      Ast_409.Parsetree.pmd_type = pmd_type;
      Ast_409.Parsetree.pmd_attributes = pmd_attributes;
      Ast_409.Parsetree.pmd_loc = pmd_loc }
    ->
    {
      Ast_408.Parsetree.pmd_name = (copy_loc (fun x -> x) pmd_name);
      Ast_408.Parsetree.pmd_type = (copy_module_type pmd_type);
      Ast_408.Parsetree.pmd_attributes = (copy_attributes pmd_attributes);
      Ast_408.Parsetree.pmd_loc = (copy_location pmd_loc)
    }
and copy_type_exception :
  Ast_409.Parsetree.type_exception -> Ast_408.Parsetree.type_exception =
  fun
    { Ast_409.Parsetree.ptyexn_constructor = ptyexn_constructor;
      Ast_409.Parsetree.ptyexn_loc = ptyexn_loc;
      Ast_409.Parsetree.ptyexn_attributes = ptyexn_attributes }
    ->
    {
      Ast_408.Parsetree.ptyexn_constructor =
        (copy_extension_constructor ptyexn_constructor);
      Ast_408.Parsetree.ptyexn_loc = (copy_location ptyexn_loc);
      Ast_408.Parsetree.ptyexn_attributes =
        (copy_attributes ptyexn_attributes)
    }
and copy_type_extension :
  Ast_409.Parsetree.type_extension -> Ast_408.Parsetree.type_extension =
  fun
    { Ast_409.Parsetree.ptyext_path = ptyext_path;
      Ast_409.Parsetree.ptyext_params = ptyext_params;
      Ast_409.Parsetree.ptyext_constructors = ptyext_constructors;
      Ast_409.Parsetree.ptyext_private = ptyext_private;
      Ast_409.Parsetree.ptyext_loc = ptyext_loc;
      Ast_409.Parsetree.ptyext_attributes = ptyext_attributes }
    ->
    {
      Ast_408.Parsetree.ptyext_path = (copy_loc copy_Longident_t ptyext_path);
      Ast_408.Parsetree.ptyext_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
           ptyext_params);
      Ast_408.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor ptyext_constructors);
      Ast_408.Parsetree.ptyext_private = (copy_private_flag ptyext_private);
      Ast_408.Parsetree.ptyext_loc = (copy_location ptyext_loc);
      Ast_408.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }
and copy_extension_constructor :
  Ast_409.Parsetree.extension_constructor ->
    Ast_408.Parsetree.extension_constructor
  =
  fun
    { Ast_409.Parsetree.pext_name = pext_name;
      Ast_409.Parsetree.pext_kind = pext_kind;
      Ast_409.Parsetree.pext_loc = pext_loc;
      Ast_409.Parsetree.pext_attributes = pext_attributes }
    ->
    {
      Ast_408.Parsetree.pext_name = (copy_loc (fun x -> x) pext_name);
      Ast_408.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      Ast_408.Parsetree.pext_loc = (copy_location pext_loc);
      Ast_408.Parsetree.pext_attributes = (copy_attributes pext_attributes)
    }
and copy_extension_constructor_kind :
  Ast_409.Parsetree.extension_constructor_kind ->
    Ast_408.Parsetree.extension_constructor_kind
  =
  function
  | Ast_409.Parsetree.Pext_decl (x0, x1) ->
      Ast_408.Parsetree.Pext_decl
        ((copy_constructor_arguments x0), (Option.map copy_core_type x1))
  | Ast_409.Parsetree.Pext_rebind x0 ->
      Ast_408.Parsetree.Pext_rebind (copy_loc copy_Longident_t x0)
and copy_type_declaration :
  Ast_409.Parsetree.type_declaration -> Ast_408.Parsetree.type_declaration =
  fun
    { Ast_409.Parsetree.ptype_name = ptype_name;
      Ast_409.Parsetree.ptype_params = ptype_params;
      Ast_409.Parsetree.ptype_cstrs = ptype_cstrs;
      Ast_409.Parsetree.ptype_kind = ptype_kind;
      Ast_409.Parsetree.ptype_private = ptype_private;
      Ast_409.Parsetree.ptype_manifest = ptype_manifest;
      Ast_409.Parsetree.ptype_attributes = ptype_attributes;
      Ast_409.Parsetree.ptype_loc = ptype_loc }
    ->
    {
      Ast_408.Parsetree.ptype_name = (copy_loc (fun x -> x) ptype_name);
      Ast_408.Parsetree.ptype_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
           ptype_params);
      Ast_408.Parsetree.ptype_cstrs =
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              ((copy_core_type x0), (copy_core_type x1), (copy_location x2)))
           ptype_cstrs);
      Ast_408.Parsetree.ptype_kind = (copy_type_kind ptype_kind);
      Ast_408.Parsetree.ptype_private = (copy_private_flag ptype_private);
      Ast_408.Parsetree.ptype_manifest =
        (Option.map copy_core_type ptype_manifest);
      Ast_408.Parsetree.ptype_attributes = (copy_attributes ptype_attributes);
      Ast_408.Parsetree.ptype_loc = (copy_location ptype_loc)
    }
and copy_private_flag :
  Ast_409.Asttypes.private_flag -> Ast_408.Asttypes.private_flag =
  function
  | Ast_409.Asttypes.Private -> Ast_408.Asttypes.Private
  | Ast_409.Asttypes.Public -> Ast_408.Asttypes.Public
and copy_type_kind :
  Ast_409.Parsetree.type_kind -> Ast_408.Parsetree.type_kind =
  function
  | Ast_409.Parsetree.Ptype_abstract -> Ast_408.Parsetree.Ptype_abstract
  | Ast_409.Parsetree.Ptype_variant x0 ->
      Ast_408.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | Ast_409.Parsetree.Ptype_record x0 ->
      Ast_408.Parsetree.Ptype_record (List.map copy_label_declaration x0)
  | Ast_409.Parsetree.Ptype_open -> Ast_408.Parsetree.Ptype_open
and copy_constructor_declaration :
  Ast_409.Parsetree.constructor_declaration ->
    Ast_408.Parsetree.constructor_declaration
  =
  fun
    { Ast_409.Parsetree.pcd_name = pcd_name;
      Ast_409.Parsetree.pcd_args = pcd_args;
      Ast_409.Parsetree.pcd_res = pcd_res;
      Ast_409.Parsetree.pcd_loc = pcd_loc;
      Ast_409.Parsetree.pcd_attributes = pcd_attributes }
    ->
    {
      Ast_408.Parsetree.pcd_name = (copy_loc (fun x -> x) pcd_name);
      Ast_408.Parsetree.pcd_args = (copy_constructor_arguments pcd_args);
      Ast_408.Parsetree.pcd_res = (Option.map copy_core_type pcd_res);
      Ast_408.Parsetree.pcd_loc = (copy_location pcd_loc);
      Ast_408.Parsetree.pcd_attributes = (copy_attributes pcd_attributes)
    }
and copy_constructor_arguments :
  Ast_409.Parsetree.constructor_arguments ->
    Ast_408.Parsetree.constructor_arguments
  =
  function
  | Ast_409.Parsetree.Pcstr_tuple x0 ->
      Ast_408.Parsetree.Pcstr_tuple (List.map copy_core_type x0)
  | Ast_409.Parsetree.Pcstr_record x0 ->
      Ast_408.Parsetree.Pcstr_record (List.map copy_label_declaration x0)
and copy_label_declaration :
  Ast_409.Parsetree.label_declaration -> Ast_408.Parsetree.label_declaration
  =
  fun
    { Ast_409.Parsetree.pld_name = pld_name;
      Ast_409.Parsetree.pld_mutable = pld_mutable;
      Ast_409.Parsetree.pld_type = pld_type;
      Ast_409.Parsetree.pld_loc = pld_loc;
      Ast_409.Parsetree.pld_attributes = pld_attributes }
    ->
    {
      Ast_408.Parsetree.pld_name = (copy_loc (fun x -> x) pld_name);
      Ast_408.Parsetree.pld_mutable = (copy_mutable_flag pld_mutable);
      Ast_408.Parsetree.pld_type = (copy_core_type pld_type);
      Ast_408.Parsetree.pld_loc = (copy_location pld_loc);
      Ast_408.Parsetree.pld_attributes = (copy_attributes pld_attributes)
    }
and copy_mutable_flag :
  Ast_409.Asttypes.mutable_flag -> Ast_408.Asttypes.mutable_flag =
  function
  | Ast_409.Asttypes.Immutable -> Ast_408.Asttypes.Immutable
  | Ast_409.Asttypes.Mutable -> Ast_408.Asttypes.Mutable
and copy_variance : Ast_409.Asttypes.variance -> Ast_408.Asttypes.variance =
  function
  | Ast_409.Asttypes.Covariant -> Ast_408.Asttypes.Covariant
  | Ast_409.Asttypes.Contravariant -> Ast_408.Asttypes.Contravariant
  | Ast_409.Asttypes.Invariant -> Ast_408.Asttypes.Invariant
and copy_value_description :
  Ast_409.Parsetree.value_description -> Ast_408.Parsetree.value_description
  =
  fun
    { Ast_409.Parsetree.pval_name = pval_name;
      Ast_409.Parsetree.pval_type = pval_type;
      Ast_409.Parsetree.pval_prim = pval_prim;
      Ast_409.Parsetree.pval_attributes = pval_attributes;
      Ast_409.Parsetree.pval_loc = pval_loc }
    ->
    {
      Ast_408.Parsetree.pval_name = (copy_loc (fun x -> x) pval_name);
      Ast_408.Parsetree.pval_type = (copy_core_type pval_type);
      Ast_408.Parsetree.pval_prim = (List.map (fun x -> x) pval_prim);
      Ast_408.Parsetree.pval_attributes = (copy_attributes pval_attributes);
      Ast_408.Parsetree.pval_loc = (copy_location pval_loc)
    }
and copy_object_field_desc :
  Ast_409.Parsetree.object_field_desc -> Ast_408.Parsetree.object_field_desc
  =
  function
  | Ast_409.Parsetree.Otag (x0, x1) ->
      Ast_408.Parsetree.Otag ((copy_loc copy_label x0), (copy_core_type x1))
  | Ast_409.Parsetree.Oinherit x0 ->
      Ast_408.Parsetree.Oinherit (copy_core_type x0)
and copy_arg_label : Ast_409.Asttypes.arg_label -> Ast_408.Asttypes.arg_label
  =
  function
  | Ast_409.Asttypes.Nolabel -> Ast_408.Asttypes.Nolabel
  | Ast_409.Asttypes.Labelled x0 -> Ast_408.Asttypes.Labelled x0
  | Ast_409.Asttypes.Optional x0 -> Ast_408.Asttypes.Optional x0
and copy_closed_flag :
  Ast_409.Asttypes.closed_flag -> Ast_408.Asttypes.closed_flag =
  function
  | Ast_409.Asttypes.Closed -> Ast_408.Asttypes.Closed
  | Ast_409.Asttypes.Open -> Ast_408.Asttypes.Open
and copy_label : Ast_409.Asttypes.label -> Ast_408.Asttypes.label =
  fun x -> x
and copy_rec_flag : Ast_409.Asttypes.rec_flag -> Ast_408.Asttypes.rec_flag =
  function
  | Ast_409.Asttypes.Nonrecursive -> Ast_408.Asttypes.Nonrecursive
  | Ast_409.Asttypes.Recursive -> Ast_408.Asttypes.Recursive
and copy_constant : Ast_409.Parsetree.constant -> Ast_408.Parsetree.constant
  =
  function
  | Ast_409.Parsetree.Pconst_integer (x0, x1) ->
      Ast_408.Parsetree.Pconst_integer (x0, (Option.map (fun x -> x) x1))
  | Ast_409.Parsetree.Pconst_char x0 -> Ast_408.Parsetree.Pconst_char x0
  | Ast_409.Parsetree.Pconst_string (x0, x1) ->
      Ast_408.Parsetree.Pconst_string (x0, (Option.map (fun x -> x) x1))
  | Ast_409.Parsetree.Pconst_float (x0, x1) ->
      Ast_408.Parsetree.Pconst_float (x0, (Option.map (fun x -> x) x1))
and copy_Longident_t : Ast_409.Longident.t -> Ast_408.Longident.t =
  function
  | Ast_409.Longident.Lident x0 -> Ast_408.Longident.Lident x0
  | Ast_409.Longident.Ldot (x0, x1) ->
      Ast_408.Longident.Ldot ((copy_Longident_t x0), x1)
  | Ast_409.Longident.Lapply (x0, x1) ->
      Ast_408.Longident.Lapply ((copy_Longident_t x0), (copy_Longident_t x1))
and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 Ast_409.Asttypes.loc -> 'g0 Ast_408.Asttypes.loc
  =
  fun f0 ->
    fun { Ast_409.Asttypes.txt = txt; Ast_409.Asttypes.loc = loc } ->
      {
        Ast_408.Asttypes.txt = (f0 txt);
        Ast_408.Asttypes.loc = (copy_location loc)
      }
and copy_location : Ast_409.Location.t -> Ast_408.Location.t =
  fun
    { Ast_409.Location.loc_start = loc_start;
      Ast_409.Location.loc_end = loc_end;
      Ast_409.Location.loc_ghost = loc_ghost }
    ->
    {
      Ast_408.Location.loc_start = (copy_position loc_start);
      Ast_408.Location.loc_end = (copy_position loc_end);
      Ast_408.Location.loc_ghost = loc_ghost
    }
and copy_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
    ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }

end
module Migrate_parsetree_408_409
= struct
#1 "migrate_parsetree_408_409.ml"
# 1 "src/migrate_parsetree_408_409.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_408_409_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload";
    "binding_op"; "module_substitution"; "open_declaration"; "type_exception"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     binding_op;
     module_substitution;
     open_declaration;
     type_exception;
     (*$*)
   } as mapper) ->
  let module Def = Migrate_parsetree_def in
  let module R = Migrate_parsetree_409_408_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    binding_op = (fun _ x -> copy_binding_op (binding_op mapper (R.copy_binding_op x)));
    module_substitution = (fun _ x -> copy_module_substitution (module_substitution mapper (R.copy_module_substitution x)));
    open_declaration = (fun _ x -> copy_open_declaration (open_declaration mapper (R.copy_open_declaration x)));
    type_exception = (fun _ x -> copy_type_exception (type_exception mapper (R.copy_type_exception x)));
    (*$*)
  }

end
module Migrate_parsetree_409_408
= struct
#1 "migrate_parsetree_409_408.ml"
# 1 "src/migrate_parsetree_409_408.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_409_408_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload";
    "binding_op"; "module_substitution"; "open_declaration"; "type_exception"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     binding_op;
     module_substitution;
     open_declaration;
     type_exception;
     (*$*)
   } as mapper) ->
  let module Def = Migrate_parsetree_def in
  let module R = Migrate_parsetree_408_409_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    binding_op = (fun _ x -> copy_binding_op (binding_op mapper (R.copy_binding_op x)));
    module_substitution = (fun _ x -> copy_module_substitution (module_substitution mapper (R.copy_module_substitution x)));
    open_declaration = (fun _ x -> copy_open_declaration (open_declaration mapper (R.copy_open_declaration x)));
    type_exception = (fun _ x -> copy_type_exception (type_exception mapper (R.copy_type_exception x)));
    (*$*)
  }

end
module Migrate_parsetree_409_410_migrate
= struct
#1 "migrate_parsetree_409_410_migrate.ml"
# 1 "src/migrate_parsetree_409_410_migrate.ml"
module From = Ast_409
module To = Ast_410
let map_option f x =
  match x with
  | None -> None
  | Some x -> Some (f x)
let rec copy_out_type_extension :
  Ast_409.Outcometree.out_type_extension ->
  Ast_410.Outcometree.out_type_extension
  =
  fun
    { Ast_409.Outcometree.otyext_name = otyext_name;
      Ast_409.Outcometree.otyext_params = otyext_params;
      Ast_409.Outcometree.otyext_constructors = otyext_constructors;
      Ast_409.Outcometree.otyext_private = otyext_private }
    ->
      {
        Ast_410.Outcometree.otyext_name = otyext_name;
        Ast_410.Outcometree.otyext_params =
          (List.map (fun x -> x) otyext_params);
        Ast_410.Outcometree.otyext_constructors =
          (List.map
             (fun x ->
                let (x0, x1, x2) = x in
                (x0, (List.map copy_out_type x1),
                 (map_option copy_out_type x2))) otyext_constructors);
        Ast_410.Outcometree.otyext_private = (copy_private_flag otyext_private)
      }
and copy_out_phrase :
  Ast_409.Outcometree.out_phrase -> Ast_410.Outcometree.out_phrase =
  function
  | Ast_409.Outcometree.Ophr_eval (x0, x1) ->
      Ast_410.Outcometree.Ophr_eval ((copy_out_value x0), (copy_out_type x1))
  | Ast_409.Outcometree.Ophr_signature x0 ->
      Ast_410.Outcometree.Ophr_signature
        (List.map
           (fun x ->
              let (x0, x1) = x in
              ((copy_out_sig_item x0), (map_option copy_out_value x1))) x0)
  | Ast_409.Outcometree.Ophr_exception x0 ->
      Ast_410.Outcometree.Ophr_exception
        (let (x0, x1) = x0 in (x0, (copy_out_value x1)))
and copy_out_sig_item :
  Ast_409.Outcometree.out_sig_item -> Ast_410.Outcometree.out_sig_item =
  function
  | Ast_409.Outcometree.Osig_class (x0, x1, x2, x3, x4) ->
      Ast_410.Outcometree.Osig_class
        (x0, x1,
         (List.map
            (fun x ->
               let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1)))) x2),
         (copy_out_class_type x3), (copy_out_rec_status x4))
  | Ast_409.Outcometree.Osig_class_type (x0, x1, x2, x3, x4) ->
      Ast_410.Outcometree.Osig_class_type
        (x0, x1,
         (List.map
            (fun x ->
               let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1)))) x2),
         (copy_out_class_type x3), (copy_out_rec_status x4))
  | Ast_409.Outcometree.Osig_typext (x0, x1) ->
      Ast_410.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0), (copy_out_ext_status x1))
  | Ast_409.Outcometree.Osig_modtype (x0, x1) ->
      Ast_410.Outcometree.Osig_modtype (x0, (copy_out_module_type x1))
  | Ast_409.Outcometree.Osig_module (x0, x1, x2) ->
      Ast_410.Outcometree.Osig_module
        (x0, (copy_out_module_type x1), (copy_out_rec_status x2))
  | Ast_409.Outcometree.Osig_type (x0, x1) ->
      Ast_410.Outcometree.Osig_type
        ((copy_out_type_decl x0), (copy_out_rec_status x1))
  | Ast_409.Outcometree.Osig_value x0 ->
      Ast_410.Outcometree.Osig_value (copy_out_val_decl x0)
  | Ast_409.Outcometree.Osig_ellipsis -> Ast_410.Outcometree.Osig_ellipsis
and copy_out_val_decl :
  Ast_409.Outcometree.out_val_decl -> Ast_410.Outcometree.out_val_decl =
  fun
    { Ast_409.Outcometree.oval_name = oval_name;
      Ast_409.Outcometree.oval_type = oval_type;
      Ast_409.Outcometree.oval_prims = oval_prims;
      Ast_409.Outcometree.oval_attributes = oval_attributes }
    ->
      {
        Ast_410.Outcometree.oval_name = oval_name;
        Ast_410.Outcometree.oval_type = (copy_out_type oval_type);
        Ast_410.Outcometree.oval_prims = (List.map (fun x -> x) oval_prims);
        Ast_410.Outcometree.oval_attributes =
          (List.map copy_out_attribute oval_attributes)
      }
and copy_out_type_decl :
  Ast_409.Outcometree.out_type_decl -> Ast_410.Outcometree.out_type_decl =
  fun
    { Ast_409.Outcometree.otype_name = otype_name;
      Ast_409.Outcometree.otype_params = otype_params;
      Ast_409.Outcometree.otype_type = otype_type;
      Ast_409.Outcometree.otype_private = otype_private;
      Ast_409.Outcometree.otype_immediate = otype_immediate;
      Ast_409.Outcometree.otype_unboxed = otype_unboxed;
      Ast_409.Outcometree.otype_cstrs = otype_cstrs }
    ->
      {
        Ast_410.Outcometree.otype_name = otype_name;
        Ast_410.Outcometree.otype_params =
          (List.map
             (fun x ->
                let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1))))
             otype_params);
        Ast_410.Outcometree.otype_type = (copy_out_type otype_type);
        Ast_410.Outcometree.otype_private = (copy_private_flag otype_private);
        Ast_410.Outcometree.otype_immediate = (if otype_immediate then Always else Unknown);
        Ast_410.Outcometree.otype_unboxed = otype_unboxed;
        Ast_410.Outcometree.otype_cstrs =
          (List.map
             (fun x ->
                let (x0, x1) = x in ((copy_out_type x0), (copy_out_type x1)))
             otype_cstrs)
      }
and copy_out_module_type :
  Ast_409.Outcometree.out_module_type -> Ast_410.Outcometree.out_module_type
  =
  function
  | Ast_409.Outcometree.Omty_abstract -> Ast_410.Outcometree.Omty_abstract
  | Ast_409.Outcometree.Omty_functor (x0, x1, x2) ->
      Ast_410.Outcometree.Omty_functor
        ((match x0, x1 with
            | "*", None -> None
            | "_", Some mt -> Some (None, copy_out_module_type mt)
            | s, Some mt -> Some (Some s, copy_out_module_type mt)
            |_ -> assert false),
         copy_out_module_type x2)
  | Ast_409.Outcometree.Omty_ident x0 ->
      Ast_410.Outcometree.Omty_ident (copy_out_ident x0)
  | Ast_409.Outcometree.Omty_signature x0 ->
      Ast_410.Outcometree.Omty_signature (List.map copy_out_sig_item x0)
  | Ast_409.Outcometree.Omty_alias x0 ->
      Ast_410.Outcometree.Omty_alias (copy_out_ident x0)
and copy_out_ext_status :
  Ast_409.Outcometree.out_ext_status -> Ast_410.Outcometree.out_ext_status =
  function
  | Ast_409.Outcometree.Oext_first -> Ast_410.Outcometree.Oext_first
  | Ast_409.Outcometree.Oext_next -> Ast_410.Outcometree.Oext_next
  | Ast_409.Outcometree.Oext_exception -> Ast_410.Outcometree.Oext_exception
and copy_out_extension_constructor :
  Ast_409.Outcometree.out_extension_constructor ->
  Ast_410.Outcometree.out_extension_constructor
  =
  fun
    { Ast_409.Outcometree.oext_name = oext_name;
      Ast_409.Outcometree.oext_type_name = oext_type_name;
      Ast_409.Outcometree.oext_type_params = oext_type_params;
      Ast_409.Outcometree.oext_args = oext_args;
      Ast_409.Outcometree.oext_ret_type = oext_ret_type;
      Ast_409.Outcometree.oext_private = oext_private }
    ->
      {
        Ast_410.Outcometree.oext_name = oext_name;
        Ast_410.Outcometree.oext_type_name = oext_type_name;
        Ast_410.Outcometree.oext_type_params =
          (List.map (fun x -> x) oext_type_params);
        Ast_410.Outcometree.oext_args = (List.map copy_out_type oext_args);
        Ast_410.Outcometree.oext_ret_type =
          (map_option copy_out_type oext_ret_type);
        Ast_410.Outcometree.oext_private = (copy_private_flag oext_private)
      }
and copy_out_rec_status :
  Ast_409.Outcometree.out_rec_status -> Ast_410.Outcometree.out_rec_status =
  function
  | Ast_409.Outcometree.Orec_not -> Ast_410.Outcometree.Orec_not
  | Ast_409.Outcometree.Orec_first -> Ast_410.Outcometree.Orec_first
  | Ast_409.Outcometree.Orec_next -> Ast_410.Outcometree.Orec_next
and copy_out_class_type :
  Ast_409.Outcometree.out_class_type -> Ast_410.Outcometree.out_class_type =
  function
  | Ast_409.Outcometree.Octy_constr (x0, x1) ->
      Ast_410.Outcometree.Octy_constr
        ((copy_out_ident x0), (List.map copy_out_type x1))
  | Ast_409.Outcometree.Octy_arrow (x0, x1, x2) ->
      Ast_410.Outcometree.Octy_arrow
        (x0, (copy_out_type x1), (copy_out_class_type x2))
  | Ast_409.Outcometree.Octy_signature (x0, x1) ->
      Ast_410.Outcometree.Octy_signature
        ((map_option copy_out_type x0),
         (List.map copy_out_class_sig_item x1))
and copy_out_class_sig_item :
  Ast_409.Outcometree.out_class_sig_item ->
  Ast_410.Outcometree.out_class_sig_item
  =
  function
  | Ast_409.Outcometree.Ocsg_constraint (x0, x1) ->
      Ast_410.Outcometree.Ocsg_constraint
        ((copy_out_type x0), (copy_out_type x1))
  | Ast_409.Outcometree.Ocsg_method (x0, x1, x2, x3) ->
      Ast_410.Outcometree.Ocsg_method (x0, x1, x2, (copy_out_type x3))
  | Ast_409.Outcometree.Ocsg_value (x0, x1, x2, x3) ->
      Ast_410.Outcometree.Ocsg_value (x0, x1, x2, (copy_out_type x3))
and copy_out_type :
  Ast_409.Outcometree.out_type -> Ast_410.Outcometree.out_type =
  function
  | Ast_409.Outcometree.Otyp_abstract -> Ast_410.Outcometree.Otyp_abstract
  | Ast_409.Outcometree.Otyp_open -> Ast_410.Outcometree.Otyp_open
  | Ast_409.Outcometree.Otyp_alias (x0, x1) ->
      Ast_410.Outcometree.Otyp_alias ((copy_out_type x0), x1)
  | Ast_409.Outcometree.Otyp_arrow (x0, x1, x2) ->
      Ast_410.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1), (copy_out_type x2))
  | Ast_409.Outcometree.Otyp_class (x0, x1, x2) ->
      Ast_410.Outcometree.Otyp_class
        (x0, (copy_out_ident x1), (List.map copy_out_type x2))
  | Ast_409.Outcometree.Otyp_constr (x0, x1) ->
      Ast_410.Outcometree.Otyp_constr
        ((copy_out_ident x0), (List.map copy_out_type x1))
  | Ast_409.Outcometree.Otyp_manifest (x0, x1) ->
      Ast_410.Outcometree.Otyp_manifest
        ((copy_out_type x0), (copy_out_type x1))
  | Ast_409.Outcometree.Otyp_object (x0, x1) ->
      Ast_410.Outcometree.Otyp_object
        ((List.map (fun x -> let (x0, x1) = x in (x0, (copy_out_type x1))) x0),
         (map_option (fun x -> x) x1))
  | Ast_409.Outcometree.Otyp_record x0 ->
      Ast_410.Outcometree.Otyp_record
        (List.map
           (fun x -> let (x0, x1, x2) = x in (x0, x1, (copy_out_type x2))) x0)
  | Ast_409.Outcometree.Otyp_stuff x0 -> Ast_410.Outcometree.Otyp_stuff x0
  | Ast_409.Outcometree.Otyp_sum x0 ->
      Ast_410.Outcometree.Otyp_sum
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              (x0, (List.map copy_out_type x1),
               (map_option copy_out_type x2))) x0)
  | Ast_409.Outcometree.Otyp_tuple x0 ->
      Ast_410.Outcometree.Otyp_tuple (List.map copy_out_type x0)
  | Ast_409.Outcometree.Otyp_var (x0, x1) ->
      Ast_410.Outcometree.Otyp_var (x0, x1)
  | Ast_409.Outcometree.Otyp_variant (x0, x1, x2, x3) ->
      Ast_410.Outcometree.Otyp_variant
        (x0, (copy_out_variant x1), x2,
         (map_option (fun x -> List.map (fun x -> x) x) x3))
  | Ast_409.Outcometree.Otyp_poly (x0, x1) ->
      Ast_410.Outcometree.Otyp_poly
        ((List.map (fun x -> x) x0), (copy_out_type x1))
  | Ast_409.Outcometree.Otyp_module (x0, x1, x2) ->
      Ast_410.Outcometree.Otyp_module
        ((copy_out_ident x0), (List.map (fun x -> x) x1),
         (List.map copy_out_type x2))
  | Ast_409.Outcometree.Otyp_attribute (x0, x1) ->
      Ast_410.Outcometree.Otyp_attribute
        ((copy_out_type x0), (copy_out_attribute x1))
and copy_out_attribute :
  Ast_409.Outcometree.out_attribute -> Ast_410.Outcometree.out_attribute =
  fun { Ast_409.Outcometree.oattr_name = oattr_name } ->
  { Ast_410.Outcometree.oattr_name = oattr_name }
and copy_out_variant :
  Ast_409.Outcometree.out_variant -> Ast_410.Outcometree.out_variant =
  function
  | Ast_409.Outcometree.Ovar_fields x0 ->
      Ast_410.Outcometree.Ovar_fields
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in (x0, x1, (List.map copy_out_type x2)))
           x0)
  | Ast_409.Outcometree.Ovar_typ x0 ->
      Ast_410.Outcometree.Ovar_typ (copy_out_type x0)
and copy_out_value :
  Ast_409.Outcometree.out_value -> Ast_410.Outcometree.out_value =
  function
  | Ast_409.Outcometree.Oval_array x0 ->
      Ast_410.Outcometree.Oval_array (List.map copy_out_value x0)
  | Ast_409.Outcometree.Oval_char x0 -> Ast_410.Outcometree.Oval_char x0
  | Ast_409.Outcometree.Oval_constr (x0, x1) ->
      Ast_410.Outcometree.Oval_constr
        ((copy_out_ident x0), (List.map copy_out_value x1))
  | Ast_409.Outcometree.Oval_ellipsis -> Ast_410.Outcometree.Oval_ellipsis
  | Ast_409.Outcometree.Oval_float x0 -> Ast_410.Outcometree.Oval_float x0
  | Ast_409.Outcometree.Oval_int x0 -> Ast_410.Outcometree.Oval_int x0
  | Ast_409.Outcometree.Oval_int32 x0 -> Ast_410.Outcometree.Oval_int32 x0
  | Ast_409.Outcometree.Oval_int64 x0 -> Ast_410.Outcometree.Oval_int64 x0
  | Ast_409.Outcometree.Oval_nativeint x0 ->
      Ast_410.Outcometree.Oval_nativeint x0
  | Ast_409.Outcometree.Oval_list x0 ->
      Ast_410.Outcometree.Oval_list (List.map copy_out_value x0)
  | Ast_409.Outcometree.Oval_printer x0 ->
      Ast_410.Outcometree.Oval_printer x0
  | Ast_409.Outcometree.Oval_record x0 ->
      Ast_410.Outcometree.Oval_record
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_out_ident x0), (copy_out_value x1)))
           x0)
  | Ast_409.Outcometree.Oval_string (x0, x1, x2) ->
      Ast_410.Outcometree.Oval_string (x0, x1, (copy_out_string x2))
  | Ast_409.Outcometree.Oval_stuff x0 -> Ast_410.Outcometree.Oval_stuff x0
  | Ast_409.Outcometree.Oval_tuple x0 ->
      Ast_410.Outcometree.Oval_tuple (List.map copy_out_value x0)
  | Ast_409.Outcometree.Oval_variant (x0, x1) ->
      Ast_410.Outcometree.Oval_variant (x0, (map_option copy_out_value x1))
and copy_out_string :
  Ast_409.Outcometree.out_string -> Ast_410.Outcometree.out_string =
  function
  | Ast_409.Outcometree.Ostr_string -> Ast_410.Outcometree.Ostr_string
  | Ast_409.Outcometree.Ostr_bytes -> Ast_410.Outcometree.Ostr_bytes
and copy_out_ident :
  Ast_409.Outcometree.out_ident -> Ast_410.Outcometree.out_ident =
  function
  | Ast_409.Outcometree.Oide_apply (x0, x1) ->
      Ast_410.Outcometree.Oide_apply
        ((copy_out_ident x0), (copy_out_ident x1))
  | Ast_409.Outcometree.Oide_dot (x0, x1) ->
      Ast_410.Outcometree.Oide_dot ((copy_out_ident x0), x1)
  | Ast_409.Outcometree.Oide_ident x0 ->
      Ast_410.Outcometree.Oide_ident (copy_out_name x0)
and copy_out_name :
  Ast_409.Outcometree.out_name -> Ast_410.Outcometree.out_name =
  fun { Ast_409.Outcometree.printed_name = printed_name } ->
  { Ast_410.Outcometree.printed_name = printed_name }
and copy_toplevel_phrase :
  Ast_409.Parsetree.toplevel_phrase -> Ast_410.Parsetree.toplevel_phrase =
  function
  | Ast_409.Parsetree.Ptop_def x0 ->
      Ast_410.Parsetree.Ptop_def (copy_structure x0)
  | Ast_409.Parsetree.Ptop_dir x0 ->
      Ast_410.Parsetree.Ptop_dir (copy_toplevel_directive x0)
and copy_toplevel_directive :
  Ast_409.Parsetree.toplevel_directive ->
  Ast_410.Parsetree.toplevel_directive
  =
  fun
    { Ast_409.Parsetree.pdir_name = pdir_name;
      Ast_409.Parsetree.pdir_arg = pdir_arg;
      Ast_409.Parsetree.pdir_loc = pdir_loc }
    ->
      {
        Ast_410.Parsetree.pdir_name = (copy_loc (fun x -> x) pdir_name);
        Ast_410.Parsetree.pdir_arg =
          (map_option copy_directive_argument pdir_arg);
        Ast_410.Parsetree.pdir_loc = (copy_location pdir_loc)
      }
and copy_directive_argument :
  Ast_409.Parsetree.directive_argument ->
  Ast_410.Parsetree.directive_argument
  =
  fun
    { Ast_409.Parsetree.pdira_desc = pdira_desc;
      Ast_409.Parsetree.pdira_loc = pdira_loc }
    ->
      {
        Ast_410.Parsetree.pdira_desc =
          (copy_directive_argument_desc pdira_desc);
        Ast_410.Parsetree.pdira_loc = (copy_location pdira_loc)
      }
and copy_directive_argument_desc :
  Ast_409.Parsetree.directive_argument_desc ->
  Ast_410.Parsetree.directive_argument_desc
  =
  function
  | Ast_409.Parsetree.Pdir_string x0 -> Ast_410.Parsetree.Pdir_string x0
  | Ast_409.Parsetree.Pdir_int (x0, x1) ->
      Ast_410.Parsetree.Pdir_int (x0, (map_option (fun x -> x) x1))
  | Ast_409.Parsetree.Pdir_ident x0 ->
      Ast_410.Parsetree.Pdir_ident (copy_Longident_t x0)
  | Ast_409.Parsetree.Pdir_bool x0 -> Ast_410.Parsetree.Pdir_bool x0
and copy_expression :
  Ast_409.Parsetree.expression -> Ast_410.Parsetree.expression =
  fun
    { Ast_409.Parsetree.pexp_desc = pexp_desc;
      Ast_409.Parsetree.pexp_loc = pexp_loc;
      Ast_409.Parsetree.pexp_loc_stack = pexp_loc_stack;
      Ast_409.Parsetree.pexp_attributes = pexp_attributes }
    ->
      {
        Ast_410.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
        Ast_410.Parsetree.pexp_loc = (copy_location pexp_loc);
        Ast_410.Parsetree.pexp_loc_stack =
          (List.map copy_location pexp_loc_stack);
        Ast_410.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
      }
and copy_expression_desc :
  Ast_409.Parsetree.expression_desc -> Ast_410.Parsetree.expression_desc =
  function
  | Ast_409.Parsetree.Pexp_ident x0 ->
      Ast_410.Parsetree.Pexp_ident (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Pexp_constant x0 ->
      Ast_410.Parsetree.Pexp_constant (copy_constant x0)
  | Ast_409.Parsetree.Pexp_let (x0, x1, x2) ->
      Ast_410.Parsetree.Pexp_let
        ((copy_rec_flag x0), (List.map copy_value_binding x1),
         (copy_expression x2))
  | Ast_409.Parsetree.Pexp_function x0 ->
      Ast_410.Parsetree.Pexp_function (copy_cases x0)
  | Ast_409.Parsetree.Pexp_fun (x0, x1, x2, x3) ->
      Ast_410.Parsetree.Pexp_fun
        ((copy_arg_label x0), (map_option copy_expression x1),
         (copy_pattern x2), (copy_expression x3))
  | Ast_409.Parsetree.Pexp_apply (x0, x1) ->
      Ast_410.Parsetree.Pexp_apply
        ((copy_expression x0),
         (List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_arg_label x0), (copy_expression x1))) x1))
  | Ast_409.Parsetree.Pexp_match (x0, x1) ->
      Ast_410.Parsetree.Pexp_match ((copy_expression x0), (copy_cases x1))
  | Ast_409.Parsetree.Pexp_try (x0, x1) ->
      Ast_410.Parsetree.Pexp_try ((copy_expression x0), (copy_cases x1))
  | Ast_409.Parsetree.Pexp_tuple x0 ->
      Ast_410.Parsetree.Pexp_tuple (List.map copy_expression x0)
  | Ast_409.Parsetree.Pexp_construct (x0, x1) ->
      Ast_410.Parsetree.Pexp_construct
        ((copy_loc copy_Longident_t x0), (map_option copy_expression x1))
  | Ast_409.Parsetree.Pexp_variant (x0, x1) ->
      Ast_410.Parsetree.Pexp_variant
        ((copy_label x0), (map_option copy_expression x1))
  | Ast_409.Parsetree.Pexp_record (x0, x1) ->
      Ast_410.Parsetree.Pexp_record
        ((List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_loc copy_Longident_t x0), (copy_expression x1))) x0),
         (map_option copy_expression x1))
  | Ast_409.Parsetree.Pexp_field (x0, x1) ->
      Ast_410.Parsetree.Pexp_field
        ((copy_expression x0), (copy_loc copy_Longident_t x1))
  | Ast_409.Parsetree.Pexp_setfield (x0, x1, x2) ->
      Ast_410.Parsetree.Pexp_setfield
        ((copy_expression x0), (copy_loc copy_Longident_t x1),
         (copy_expression x2))
  | Ast_409.Parsetree.Pexp_array x0 ->
      Ast_410.Parsetree.Pexp_array (List.map copy_expression x0)
  | Ast_409.Parsetree.Pexp_ifthenelse (x0, x1, x2) ->
      Ast_410.Parsetree.Pexp_ifthenelse
        ((copy_expression x0), (copy_expression x1),
         (map_option copy_expression x2))
  | Ast_409.Parsetree.Pexp_sequence (x0, x1) ->
      Ast_410.Parsetree.Pexp_sequence
        ((copy_expression x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_while (x0, x1) ->
      Ast_410.Parsetree.Pexp_while
        ((copy_expression x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_for (x0, x1, x2, x3, x4) ->
      Ast_410.Parsetree.Pexp_for
        ((copy_pattern x0), (copy_expression x1), (copy_expression x2),
         (copy_direction_flag x3), (copy_expression x4))
  | Ast_409.Parsetree.Pexp_constraint (x0, x1) ->
      Ast_410.Parsetree.Pexp_constraint
        ((copy_expression x0), (copy_core_type x1))
  | Ast_409.Parsetree.Pexp_coerce (x0, x1, x2) ->
      Ast_410.Parsetree.Pexp_coerce
        ((copy_expression x0), (map_option copy_core_type x1),
         (copy_core_type x2))
  | Ast_409.Parsetree.Pexp_send (x0, x1) ->
      Ast_410.Parsetree.Pexp_send
        ((copy_expression x0), (copy_loc copy_label x1))
  | Ast_409.Parsetree.Pexp_new x0 ->
      Ast_410.Parsetree.Pexp_new (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Pexp_setinstvar (x0, x1) ->
      Ast_410.Parsetree.Pexp_setinstvar
        ((copy_loc copy_label x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_override x0 ->
      Ast_410.Parsetree.Pexp_override
        (List.map
           (fun x ->
              let (x0, x1) = x in
              ((copy_loc copy_label x0), (copy_expression x1))) x0)
  | Ast_409.Parsetree.Pexp_letmodule (x0, x1, x2) ->
      Ast_410.Parsetree.Pexp_letmodule
        ((copy_loc (fun x -> Some x) x0), (copy_module_expr x1),
         (copy_expression x2))
  | Ast_409.Parsetree.Pexp_letexception (x0, x1) ->
      Ast_410.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_assert x0 ->
      Ast_410.Parsetree.Pexp_assert (copy_expression x0)
  | Ast_409.Parsetree.Pexp_lazy x0 ->
      Ast_410.Parsetree.Pexp_lazy (copy_expression x0)
  | Ast_409.Parsetree.Pexp_poly (x0, x1) ->
      Ast_410.Parsetree.Pexp_poly
        ((copy_expression x0), (map_option copy_core_type x1))
  | Ast_409.Parsetree.Pexp_object x0 ->
      Ast_410.Parsetree.Pexp_object (copy_class_structure x0)
  | Ast_409.Parsetree.Pexp_newtype (x0, x1) ->
      Ast_410.Parsetree.Pexp_newtype
        ((copy_loc (fun x -> x) x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_pack x0 ->
      Ast_410.Parsetree.Pexp_pack (copy_module_expr x0)
  | Ast_409.Parsetree.Pexp_open (x0, x1) ->
      Ast_410.Parsetree.Pexp_open
        ((copy_open_declaration x0), (copy_expression x1))
  | Ast_409.Parsetree.Pexp_letop x0 ->
      Ast_410.Parsetree.Pexp_letop (copy_letop x0)
  | Ast_409.Parsetree.Pexp_extension x0 ->
      Ast_410.Parsetree.Pexp_extension (copy_extension x0)
  | Ast_409.Parsetree.Pexp_unreachable -> Ast_410.Parsetree.Pexp_unreachable
and copy_letop : Ast_409.Parsetree.letop -> Ast_410.Parsetree.letop =
  fun
    { Ast_409.Parsetree.let_ = let_; Ast_409.Parsetree.ands = ands;
      Ast_409.Parsetree.body = body }
    ->
      {
        Ast_410.Parsetree.let_ = (copy_binding_op let_);
        Ast_410.Parsetree.ands = (List.map copy_binding_op ands);
        Ast_410.Parsetree.body = (copy_expression body)
      }
and copy_binding_op :
  Ast_409.Parsetree.binding_op -> Ast_410.Parsetree.binding_op =
  fun
    { Ast_409.Parsetree.pbop_op = pbop_op;
      Ast_409.Parsetree.pbop_pat = pbop_pat;
      Ast_409.Parsetree.pbop_exp = pbop_exp;
      Ast_409.Parsetree.pbop_loc = pbop_loc }
    ->
      {
        Ast_410.Parsetree.pbop_op = (copy_loc (fun x -> x) pbop_op);
        Ast_410.Parsetree.pbop_pat = (copy_pattern pbop_pat);
        Ast_410.Parsetree.pbop_exp = (copy_expression pbop_exp);
        Ast_410.Parsetree.pbop_loc = (copy_location pbop_loc)
      }
and copy_direction_flag :
  Ast_409.Asttypes.direction_flag -> Ast_410.Asttypes.direction_flag =
  function
  | Ast_409.Asttypes.Upto -> Ast_410.Asttypes.Upto
  | Ast_409.Asttypes.Downto -> Ast_410.Asttypes.Downto
and copy_cases : Ast_409.Parsetree.cases -> Ast_410.Parsetree.case list =
  fun x -> List.map copy_case x
and copy_case : Ast_409.Parsetree.case -> Ast_410.Parsetree.case =
  fun
    { Ast_409.Parsetree.pc_lhs = pc_lhs;
      Ast_409.Parsetree.pc_guard = pc_guard;
      Ast_409.Parsetree.pc_rhs = pc_rhs }
    ->
      {
        Ast_410.Parsetree.pc_lhs = (copy_pattern pc_lhs);
        Ast_410.Parsetree.pc_guard = (map_option copy_expression pc_guard);
        Ast_410.Parsetree.pc_rhs = (copy_expression pc_rhs)
      }
and copy_value_binding :
  Ast_409.Parsetree.value_binding -> Ast_410.Parsetree.value_binding =
  fun
    { Ast_409.Parsetree.pvb_pat = pvb_pat;
      Ast_409.Parsetree.pvb_expr = pvb_expr;
      Ast_409.Parsetree.pvb_attributes = pvb_attributes;
      Ast_409.Parsetree.pvb_loc = pvb_loc }
    ->
      {
        Ast_410.Parsetree.pvb_pat = (copy_pattern pvb_pat);
        Ast_410.Parsetree.pvb_expr = (copy_expression pvb_expr);
        Ast_410.Parsetree.pvb_attributes = (copy_attributes pvb_attributes);
        Ast_410.Parsetree.pvb_loc = (copy_location pvb_loc)
      }
and copy_pattern : Ast_409.Parsetree.pattern -> Ast_410.Parsetree.pattern =
  fun
    { Ast_409.Parsetree.ppat_desc = ppat_desc;
      Ast_409.Parsetree.ppat_loc = ppat_loc;
      Ast_409.Parsetree.ppat_loc_stack = ppat_loc_stack;
      Ast_409.Parsetree.ppat_attributes = ppat_attributes }
    ->
      {
        Ast_410.Parsetree.ppat_desc = (copy_pattern_desc ppat_desc);
        Ast_410.Parsetree.ppat_loc = (copy_location ppat_loc);
        Ast_410.Parsetree.ppat_loc_stack =
          (List.map copy_location ppat_loc_stack);
        Ast_410.Parsetree.ppat_attributes = (copy_attributes ppat_attributes)
      }
and copy_pattern_desc :
  Ast_409.Parsetree.pattern_desc -> Ast_410.Parsetree.pattern_desc =
  function
  | Ast_409.Parsetree.Ppat_any -> Ast_410.Parsetree.Ppat_any
  | Ast_409.Parsetree.Ppat_var x0 ->
      Ast_410.Parsetree.Ppat_var (copy_loc (fun x -> x) x0)
  | Ast_409.Parsetree.Ppat_alias (x0, x1) ->
      Ast_410.Parsetree.Ppat_alias
        ((copy_pattern x0), (copy_loc (fun x -> x) x1))
  | Ast_409.Parsetree.Ppat_constant x0 ->
      Ast_410.Parsetree.Ppat_constant (copy_constant x0)
  | Ast_409.Parsetree.Ppat_interval (x0, x1) ->
      Ast_410.Parsetree.Ppat_interval
        ((copy_constant x0), (copy_constant x1))
  | Ast_409.Parsetree.Ppat_tuple x0 ->
      Ast_410.Parsetree.Ppat_tuple (List.map copy_pattern x0)
  | Ast_409.Parsetree.Ppat_construct (x0, x1) ->
      Ast_410.Parsetree.Ppat_construct
        ((copy_loc copy_Longident_t x0), (map_option copy_pattern x1))
  | Ast_409.Parsetree.Ppat_variant (x0, x1) ->
      Ast_410.Parsetree.Ppat_variant
        ((copy_label x0), (map_option copy_pattern x1))
  | Ast_409.Parsetree.Ppat_record (x0, x1) ->
      Ast_410.Parsetree.Ppat_record
        ((List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_loc copy_Longident_t x0), (copy_pattern x1))) x0),
         (copy_closed_flag x1))
  | Ast_409.Parsetree.Ppat_array x0 ->
      Ast_410.Parsetree.Ppat_array (List.map copy_pattern x0)
  | Ast_409.Parsetree.Ppat_or (x0, x1) ->
      Ast_410.Parsetree.Ppat_or ((copy_pattern x0), (copy_pattern x1))
  | Ast_409.Parsetree.Ppat_constraint (x0, x1) ->
      Ast_410.Parsetree.Ppat_constraint
        ((copy_pattern x0), (copy_core_type x1))
  | Ast_409.Parsetree.Ppat_type x0 ->
      Ast_410.Parsetree.Ppat_type (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Ppat_lazy x0 ->
      Ast_410.Parsetree.Ppat_lazy (copy_pattern x0)
  | Ast_409.Parsetree.Ppat_unpack x0 ->
      Ast_410.Parsetree.Ppat_unpack (copy_loc (fun x -> Some x) x0)
  | Ast_409.Parsetree.Ppat_exception x0 ->
      Ast_410.Parsetree.Ppat_exception (copy_pattern x0)
  | Ast_409.Parsetree.Ppat_extension x0 ->
      Ast_410.Parsetree.Ppat_extension (copy_extension x0)
  | Ast_409.Parsetree.Ppat_open (x0, x1) ->
      Ast_410.Parsetree.Ppat_open
        ((copy_loc copy_Longident_t x0), (copy_pattern x1))
and copy_core_type :
  Ast_409.Parsetree.core_type -> Ast_410.Parsetree.core_type =
  fun
    { Ast_409.Parsetree.ptyp_desc = ptyp_desc;
      Ast_409.Parsetree.ptyp_loc = ptyp_loc;
      Ast_409.Parsetree.ptyp_loc_stack = ptyp_loc_stack;
      Ast_409.Parsetree.ptyp_attributes = ptyp_attributes }
    ->
      {
        Ast_410.Parsetree.ptyp_desc = (copy_core_type_desc ptyp_desc);
        Ast_410.Parsetree.ptyp_loc = (copy_location ptyp_loc);
        Ast_410.Parsetree.ptyp_loc_stack =
          (List.map copy_location ptyp_loc_stack);
        Ast_410.Parsetree.ptyp_attributes = (copy_attributes ptyp_attributes)
      }
and copy_core_type_desc :
  Ast_409.Parsetree.core_type_desc -> Ast_410.Parsetree.core_type_desc =
  function
  | Ast_409.Parsetree.Ptyp_any -> Ast_410.Parsetree.Ptyp_any
  | Ast_409.Parsetree.Ptyp_var x0 -> Ast_410.Parsetree.Ptyp_var x0
  | Ast_409.Parsetree.Ptyp_arrow (x0, x1, x2) ->
      Ast_410.Parsetree.Ptyp_arrow
        ((copy_arg_label x0), (copy_core_type x1), (copy_core_type x2))
  | Ast_409.Parsetree.Ptyp_tuple x0 ->
      Ast_410.Parsetree.Ptyp_tuple (List.map copy_core_type x0)
  | Ast_409.Parsetree.Ptyp_constr (x0, x1) ->
      Ast_410.Parsetree.Ptyp_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_409.Parsetree.Ptyp_object (x0, x1) ->
      Ast_410.Parsetree.Ptyp_object
        ((List.map copy_object_field x0), (copy_closed_flag x1))
  | Ast_409.Parsetree.Ptyp_class (x0, x1) ->
      Ast_410.Parsetree.Ptyp_class
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_409.Parsetree.Ptyp_alias (x0, x1) ->
      Ast_410.Parsetree.Ptyp_alias ((copy_core_type x0), x1)
  | Ast_409.Parsetree.Ptyp_variant (x0, x1, x2) ->
      Ast_410.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0), (copy_closed_flag x1),
         (map_option (fun x -> List.map copy_label x) x2))
  | Ast_409.Parsetree.Ptyp_poly (x0, x1) ->
      Ast_410.Parsetree.Ptyp_poly
        ((List.map (fun x -> copy_loc (fun x -> x) x) x0),
         (copy_core_type x1))
  | Ast_409.Parsetree.Ptyp_package x0 ->
      Ast_410.Parsetree.Ptyp_package (copy_package_type x0)
  | Ast_409.Parsetree.Ptyp_extension x0 ->
      Ast_410.Parsetree.Ptyp_extension (copy_extension x0)
and copy_package_type :
  Ast_409.Parsetree.package_type -> Ast_410.Parsetree.package_type =
  fun x ->
  let (x0, x1) = x in
  ((copy_loc copy_Longident_t x0),
   (List.map
      (fun x ->
         let (x0, x1) = x in
         ((copy_loc copy_Longident_t x0), (copy_core_type x1))) x1))
and copy_row_field :
  Ast_409.Parsetree.row_field -> Ast_410.Parsetree.row_field =
  fun
    { Ast_409.Parsetree.prf_desc = prf_desc;
      Ast_409.Parsetree.prf_loc = prf_loc;
      Ast_409.Parsetree.prf_attributes = prf_attributes }
    ->
      {
        Ast_410.Parsetree.prf_desc = (copy_row_field_desc prf_desc);
        Ast_410.Parsetree.prf_loc = (copy_location prf_loc);
        Ast_410.Parsetree.prf_attributes = (copy_attributes prf_attributes)
      }
and copy_row_field_desc :
  Ast_409.Parsetree.row_field_desc -> Ast_410.Parsetree.row_field_desc =
  function
  | Ast_409.Parsetree.Rtag (x0, x1, x2) ->
      Ast_410.Parsetree.Rtag
        ((copy_loc copy_label x0), x1, (List.map copy_core_type x2))
  | Ast_409.Parsetree.Rinherit x0 ->
      Ast_410.Parsetree.Rinherit (copy_core_type x0)
and copy_object_field :
  Ast_409.Parsetree.object_field -> Ast_410.Parsetree.object_field =
  fun
    { Ast_409.Parsetree.pof_desc = pof_desc;
      Ast_409.Parsetree.pof_loc = pof_loc;
      Ast_409.Parsetree.pof_attributes = pof_attributes }
    ->
      {
        Ast_410.Parsetree.pof_desc = (copy_object_field_desc pof_desc);
        Ast_410.Parsetree.pof_loc = (copy_location pof_loc);
        Ast_410.Parsetree.pof_attributes = (copy_attributes pof_attributes)
      }
and copy_attributes :
  Ast_409.Parsetree.attributes -> Ast_410.Parsetree.attributes =
  fun x -> List.map copy_attribute x
and copy_attribute :
  Ast_409.Parsetree.attribute -> Ast_410.Parsetree.attribute =
  fun
    { Ast_409.Parsetree.attr_name = attr_name;
      Ast_409.Parsetree.attr_payload = attr_payload;
      Ast_409.Parsetree.attr_loc = attr_loc }
    ->
      {
        Ast_410.Parsetree.attr_name = (copy_loc (fun x -> x) attr_name);
        Ast_410.Parsetree.attr_payload = (copy_payload attr_payload);
        Ast_410.Parsetree.attr_loc = (copy_location attr_loc)
      }
and copy_payload : Ast_409.Parsetree.payload -> Ast_410.Parsetree.payload =
  function
  | Ast_409.Parsetree.PStr x0 -> Ast_410.Parsetree.PStr (copy_structure x0)
  | Ast_409.Parsetree.PSig x0 -> Ast_410.Parsetree.PSig (copy_signature x0)
  | Ast_409.Parsetree.PTyp x0 -> Ast_410.Parsetree.PTyp (copy_core_type x0)
  | Ast_409.Parsetree.PPat (x0, x1) ->
      Ast_410.Parsetree.PPat
        ((copy_pattern x0), (map_option copy_expression x1))
and copy_structure :
  Ast_409.Parsetree.structure -> Ast_410.Parsetree.structure =
  fun x -> List.map copy_structure_item x
and copy_structure_item :
  Ast_409.Parsetree.structure_item -> Ast_410.Parsetree.structure_item =
  fun
    { Ast_409.Parsetree.pstr_desc = pstr_desc;
      Ast_409.Parsetree.pstr_loc = pstr_loc }
    ->
      {
        Ast_410.Parsetree.pstr_desc = (copy_structure_item_desc pstr_desc);
        Ast_410.Parsetree.pstr_loc = (copy_location pstr_loc)
      }
and copy_structure_item_desc :
  Ast_409.Parsetree.structure_item_desc ->
  Ast_410.Parsetree.structure_item_desc
  =
  function
  | Ast_409.Parsetree.Pstr_eval (x0, x1) ->
      Ast_410.Parsetree.Pstr_eval
        ((copy_expression x0), (copy_attributes x1))
  | Ast_409.Parsetree.Pstr_value (x0, x1) ->
      Ast_410.Parsetree.Pstr_value
        ((copy_rec_flag x0), (List.map copy_value_binding x1))
  | Ast_409.Parsetree.Pstr_primitive x0 ->
      Ast_410.Parsetree.Pstr_primitive (copy_value_description x0)
  | Ast_409.Parsetree.Pstr_type (x0, x1) ->
      Ast_410.Parsetree.Pstr_type
        ((copy_rec_flag x0), (List.map copy_type_declaration x1))
  | Ast_409.Parsetree.Pstr_typext x0 ->
      Ast_410.Parsetree.Pstr_typext (copy_type_extension x0)
  | Ast_409.Parsetree.Pstr_exception x0 ->
      Ast_410.Parsetree.Pstr_exception (copy_type_exception x0)
  | Ast_409.Parsetree.Pstr_module x0 ->
      Ast_410.Parsetree.Pstr_module (copy_module_binding x0)
  | Ast_409.Parsetree.Pstr_recmodule x0 ->
      Ast_410.Parsetree.Pstr_recmodule (List.map copy_module_binding x0)
  | Ast_409.Parsetree.Pstr_modtype x0 ->
      Ast_410.Parsetree.Pstr_modtype (copy_module_type_declaration x0)
  | Ast_409.Parsetree.Pstr_open x0 ->
      Ast_410.Parsetree.Pstr_open (copy_open_declaration x0)
  | Ast_409.Parsetree.Pstr_class x0 ->
      Ast_410.Parsetree.Pstr_class (List.map copy_class_declaration x0)
  | Ast_409.Parsetree.Pstr_class_type x0 ->
      Ast_410.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | Ast_409.Parsetree.Pstr_include x0 ->
      Ast_410.Parsetree.Pstr_include (copy_include_declaration x0)
  | Ast_409.Parsetree.Pstr_attribute x0 ->
      Ast_410.Parsetree.Pstr_attribute (copy_attribute x0)
  | Ast_409.Parsetree.Pstr_extension (x0, x1) ->
      Ast_410.Parsetree.Pstr_extension
        ((copy_extension x0), (copy_attributes x1))
and copy_include_declaration :
  Ast_409.Parsetree.include_declaration ->
  Ast_410.Parsetree.include_declaration
  = fun x -> copy_include_infos copy_module_expr x
and copy_class_declaration :
  Ast_409.Parsetree.class_declaration -> Ast_410.Parsetree.class_declaration
  = fun x -> copy_class_infos copy_class_expr x
and copy_class_expr :
  Ast_409.Parsetree.class_expr -> Ast_410.Parsetree.class_expr =
  fun
    { Ast_409.Parsetree.pcl_desc = pcl_desc;
      Ast_409.Parsetree.pcl_loc = pcl_loc;
      Ast_409.Parsetree.pcl_attributes = pcl_attributes }
    ->
      {
        Ast_410.Parsetree.pcl_desc = (copy_class_expr_desc pcl_desc);
        Ast_410.Parsetree.pcl_loc = (copy_location pcl_loc);
        Ast_410.Parsetree.pcl_attributes = (copy_attributes pcl_attributes)
      }
and copy_class_expr_desc :
  Ast_409.Parsetree.class_expr_desc -> Ast_410.Parsetree.class_expr_desc =
  function
  | Ast_409.Parsetree.Pcl_constr (x0, x1) ->
      Ast_410.Parsetree.Pcl_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_409.Parsetree.Pcl_structure x0 ->
      Ast_410.Parsetree.Pcl_structure (copy_class_structure x0)
  | Ast_409.Parsetree.Pcl_fun (x0, x1, x2, x3) ->
      Ast_410.Parsetree.Pcl_fun
        ((copy_arg_label x0), (map_option copy_expression x1),
         (copy_pattern x2), (copy_class_expr x3))
  | Ast_409.Parsetree.Pcl_apply (x0, x1) ->
      Ast_410.Parsetree.Pcl_apply
        ((copy_class_expr x0),
         (List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_arg_label x0), (copy_expression x1))) x1))
  | Ast_409.Parsetree.Pcl_let (x0, x1, x2) ->
      Ast_410.Parsetree.Pcl_let
        ((copy_rec_flag x0), (List.map copy_value_binding x1),
         (copy_class_expr x2))
  | Ast_409.Parsetree.Pcl_constraint (x0, x1) ->
      Ast_410.Parsetree.Pcl_constraint
        ((copy_class_expr x0), (copy_class_type x1))
  | Ast_409.Parsetree.Pcl_extension x0 ->
      Ast_410.Parsetree.Pcl_extension (copy_extension x0)
  | Ast_409.Parsetree.Pcl_open (x0, x1) ->
      Ast_410.Parsetree.Pcl_open
        ((copy_open_description x0), (copy_class_expr x1))
and copy_class_structure :
  Ast_409.Parsetree.class_structure -> Ast_410.Parsetree.class_structure =
  fun
    { Ast_409.Parsetree.pcstr_self = pcstr_self;
      Ast_409.Parsetree.pcstr_fields = pcstr_fields }
    ->
      {
        Ast_410.Parsetree.pcstr_self = (copy_pattern pcstr_self);
        Ast_410.Parsetree.pcstr_fields =
          (List.map copy_class_field pcstr_fields)
      }
and copy_class_field :
  Ast_409.Parsetree.class_field -> Ast_410.Parsetree.class_field =
  fun
    { Ast_409.Parsetree.pcf_desc = pcf_desc;
      Ast_409.Parsetree.pcf_loc = pcf_loc;
      Ast_409.Parsetree.pcf_attributes = pcf_attributes }
    ->
      {
        Ast_410.Parsetree.pcf_desc = (copy_class_field_desc pcf_desc);
        Ast_410.Parsetree.pcf_loc = (copy_location pcf_loc);
        Ast_410.Parsetree.pcf_attributes = (copy_attributes pcf_attributes)
      }
and copy_class_field_desc :
  Ast_409.Parsetree.class_field_desc -> Ast_410.Parsetree.class_field_desc =
  function
  | Ast_409.Parsetree.Pcf_inherit (x0, x1, x2) ->
      Ast_410.Parsetree.Pcf_inherit
        ((copy_override_flag x0), (copy_class_expr x1),
         (map_option (fun x -> copy_loc (fun x -> x) x) x2))
  | Ast_409.Parsetree.Pcf_val x0 ->
      Ast_410.Parsetree.Pcf_val
        (let (x0, x1, x2) = x0 in
         ((copy_loc copy_label x0), (copy_mutable_flag x1),
          (copy_class_field_kind x2)))
  | Ast_409.Parsetree.Pcf_method x0 ->
      Ast_410.Parsetree.Pcf_method
        (let (x0, x1, x2) = x0 in
         ((copy_loc copy_label x0), (copy_private_flag x1),
          (copy_class_field_kind x2)))
  | Ast_409.Parsetree.Pcf_constraint x0 ->
      Ast_410.Parsetree.Pcf_constraint
        (let (x0, x1) = x0 in ((copy_core_type x0), (copy_core_type x1)))
  | Ast_409.Parsetree.Pcf_initializer x0 ->
      Ast_410.Parsetree.Pcf_initializer (copy_expression x0)
  | Ast_409.Parsetree.Pcf_attribute x0 ->
      Ast_410.Parsetree.Pcf_attribute (copy_attribute x0)
  | Ast_409.Parsetree.Pcf_extension x0 ->
      Ast_410.Parsetree.Pcf_extension (copy_extension x0)
and copy_class_field_kind :
  Ast_409.Parsetree.class_field_kind -> Ast_410.Parsetree.class_field_kind =
  function
  | Ast_409.Parsetree.Cfk_virtual x0 ->
      Ast_410.Parsetree.Cfk_virtual (copy_core_type x0)
  | Ast_409.Parsetree.Cfk_concrete (x0, x1) ->
      Ast_410.Parsetree.Cfk_concrete
        ((copy_override_flag x0), (copy_expression x1))
and copy_open_declaration :
  Ast_409.Parsetree.open_declaration -> Ast_410.Parsetree.open_declaration =
  fun x -> copy_open_infos copy_module_expr x
and copy_module_binding :
  Ast_409.Parsetree.module_binding -> Ast_410.Parsetree.module_binding =
  fun
    { Ast_409.Parsetree.pmb_name = pmb_name;
      Ast_409.Parsetree.pmb_expr = pmb_expr;
      Ast_409.Parsetree.pmb_attributes = pmb_attributes;
      Ast_409.Parsetree.pmb_loc = pmb_loc }
    ->
      {
        Ast_410.Parsetree.pmb_name = (copy_loc (fun x -> Some x) pmb_name);
        Ast_410.Parsetree.pmb_expr = (copy_module_expr pmb_expr);
        Ast_410.Parsetree.pmb_attributes = (copy_attributes pmb_attributes);
        Ast_410.Parsetree.pmb_loc = (copy_location pmb_loc)
      }
and copy_module_expr :
  Ast_409.Parsetree.module_expr -> Ast_410.Parsetree.module_expr =
  fun
    { Ast_409.Parsetree.pmod_desc = pmod_desc;
      Ast_409.Parsetree.pmod_loc = pmod_loc;
      Ast_409.Parsetree.pmod_attributes = pmod_attributes }
    ->
      {
        Ast_410.Parsetree.pmod_desc = (copy_module_expr_desc pmod_desc);
        Ast_410.Parsetree.pmod_loc = (copy_location pmod_loc);
        Ast_410.Parsetree.pmod_attributes = (copy_attributes pmod_attributes)
      }
and copy_module_expr_desc :
  Ast_409.Parsetree.module_expr_desc -> Ast_410.Parsetree.module_expr_desc =
  function
  | Ast_409.Parsetree.Pmod_ident x0 ->
      Ast_410.Parsetree.Pmod_ident (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Pmod_structure x0 ->
      Ast_410.Parsetree.Pmod_structure (copy_structure x0)
  | Ast_409.Parsetree.Pmod_functor (x0, x1, x2) ->
      Ast_410.Parsetree.Pmod_functor
        ((match x0.txt, x1 with
            | "*", None -> Unit
            | "_", Some mt -> Named (copy_loc (fun _ -> None) x0, copy_module_type mt)
            | _, Some mt -> Named (copy_loc (fun x -> Some x) x0, copy_module_type mt)
            |_ -> assert false),
         (copy_module_expr x2))
  | Ast_409.Parsetree.Pmod_apply (x0, x1) ->
      Ast_410.Parsetree.Pmod_apply
        ((copy_module_expr x0), (copy_module_expr x1))
  | Ast_409.Parsetree.Pmod_constraint (x0, x1) ->
      Ast_410.Parsetree.Pmod_constraint
        ((copy_module_expr x0), (copy_module_type x1))
  | Ast_409.Parsetree.Pmod_unpack x0 ->
      Ast_410.Parsetree.Pmod_unpack (copy_expression x0)
  | Ast_409.Parsetree.Pmod_extension x0 ->
      Ast_410.Parsetree.Pmod_extension (copy_extension x0)
and copy_module_type :
  Ast_409.Parsetree.module_type -> Ast_410.Parsetree.module_type =
  fun
    { Ast_409.Parsetree.pmty_desc = pmty_desc;
      Ast_409.Parsetree.pmty_loc = pmty_loc;
      Ast_409.Parsetree.pmty_attributes = pmty_attributes }
    ->
      {
        Ast_410.Parsetree.pmty_desc = (copy_module_type_desc pmty_desc);
        Ast_410.Parsetree.pmty_loc = (copy_location pmty_loc);
        Ast_410.Parsetree.pmty_attributes = (copy_attributes pmty_attributes)
      }
and copy_module_type_desc :
  Ast_409.Parsetree.module_type_desc -> Ast_410.Parsetree.module_type_desc =
  function
  | Ast_409.Parsetree.Pmty_ident x0 ->
      Ast_410.Parsetree.Pmty_ident (copy_loc copy_Longident_t x0)
  | Ast_409.Parsetree.Pmty_signature x0 ->
      Ast_410.Parsetree.Pmty_signature (copy_signature x0)
  | Ast_409.Parsetree.Pmty_functor (x0, x1, x2) ->
      Ast_410.Parsetree.Pmty_functor
        ((match x0.txt, x1 with
            | "*", None -> Unit
            | "_", Some mt -> Named (copy_loc (fun _ -> None) x0, copy_module_type mt)
            | _, Some mt -> Named (copy_loc (fun x -> Some x) x0, copy_module_type mt)
            |_ -> assert false),
         (copy_module_type x2))
  | Ast_409.Parsetree.Pmty_with (x0, x1) ->
      Ast_410.Parsetree.Pmty_with
        ((copy_module_type x0), (List.map copy_with_constraint x1))
  | Ast_409.Parsetree.Pmty_typeof x0 ->
      Ast_410.Parsetree.Pmty_typeof (copy_module_expr x0)
  | Ast_409.Parsetree.Pmty_extension x0 ->
      Ast_410.Parsetree.Pmty_extension (copy_extension x0)
  | Ast_409.Parsetree.Pmty_alias x0 ->
      Ast_410.Parsetree.Pmty_alias (copy_loc copy_Longident_t x0)
and copy_with_constraint :
  Ast_409.Parsetree.with_constraint -> Ast_410.Parsetree.with_constraint =
  function
  | Ast_409.Parsetree.Pwith_type (x0, x1) ->
      Ast_410.Parsetree.Pwith_type
        ((copy_loc copy_Longident_t x0), (copy_type_declaration x1))
  | Ast_409.Parsetree.Pwith_module (x0, x1) ->
      Ast_410.Parsetree.Pwith_module
        ((copy_loc copy_Longident_t x0), (copy_loc copy_Longident_t x1))
  | Ast_409.Parsetree.Pwith_typesubst (x0, x1) ->
      Ast_410.Parsetree.Pwith_typesubst
        ((copy_loc copy_Longident_t x0), (copy_type_declaration x1))
  | Ast_409.Parsetree.Pwith_modsubst (x0, x1) ->
      Ast_410.Parsetree.Pwith_modsubst
        ((copy_loc copy_Longident_t x0), (copy_loc copy_Longident_t x1))
and copy_signature :
  Ast_409.Parsetree.signature -> Ast_410.Parsetree.signature =
  fun x -> List.map copy_signature_item x
and copy_signature_item :
  Ast_409.Parsetree.signature_item -> Ast_410.Parsetree.signature_item =
  fun
    { Ast_409.Parsetree.psig_desc = psig_desc;
      Ast_409.Parsetree.psig_loc = psig_loc }
    ->
      {
        Ast_410.Parsetree.psig_desc = (copy_signature_item_desc psig_desc);
        Ast_410.Parsetree.psig_loc = (copy_location psig_loc)
      }
and copy_signature_item_desc :
  Ast_409.Parsetree.signature_item_desc ->
  Ast_410.Parsetree.signature_item_desc
  =
  function
  | Ast_409.Parsetree.Psig_value x0 ->
      Ast_410.Parsetree.Psig_value (copy_value_description x0)
  | Ast_409.Parsetree.Psig_type (x0, x1) ->
      Ast_410.Parsetree.Psig_type
        ((copy_rec_flag x0), (List.map copy_type_declaration x1))
  | Ast_409.Parsetree.Psig_typesubst x0 ->
      Ast_410.Parsetree.Psig_typesubst (List.map copy_type_declaration x0)
  | Ast_409.Parsetree.Psig_typext x0 ->
      Ast_410.Parsetree.Psig_typext (copy_type_extension x0)
  | Ast_409.Parsetree.Psig_exception x0 ->
      Ast_410.Parsetree.Psig_exception (copy_type_exception x0)
  | Ast_409.Parsetree.Psig_module x0 ->
      Ast_410.Parsetree.Psig_module (copy_module_declaration x0)
  | Ast_409.Parsetree.Psig_modsubst x0 ->
      Ast_410.Parsetree.Psig_modsubst (copy_module_substitution x0)
  | Ast_409.Parsetree.Psig_recmodule x0 ->
      Ast_410.Parsetree.Psig_recmodule (List.map copy_module_declaration x0)
  | Ast_409.Parsetree.Psig_modtype x0 ->
      Ast_410.Parsetree.Psig_modtype (copy_module_type_declaration x0)
  | Ast_409.Parsetree.Psig_open x0 ->
      Ast_410.Parsetree.Psig_open (copy_open_description x0)
  | Ast_409.Parsetree.Psig_include x0 ->
      Ast_410.Parsetree.Psig_include (copy_include_description x0)
  | Ast_409.Parsetree.Psig_class x0 ->
      Ast_410.Parsetree.Psig_class (List.map copy_class_description x0)
  | Ast_409.Parsetree.Psig_class_type x0 ->
      Ast_410.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | Ast_409.Parsetree.Psig_attribute x0 ->
      Ast_410.Parsetree.Psig_attribute (copy_attribute x0)
  | Ast_409.Parsetree.Psig_extension (x0, x1) ->
      Ast_410.Parsetree.Psig_extension
        ((copy_extension x0), (copy_attributes x1))
and copy_class_type_declaration :
  Ast_409.Parsetree.class_type_declaration ->
  Ast_410.Parsetree.class_type_declaration
  = fun x -> copy_class_infos copy_class_type x
and copy_class_description :
  Ast_409.Parsetree.class_description -> Ast_410.Parsetree.class_description
  = fun x -> copy_class_infos copy_class_type x
and copy_class_type :
  Ast_409.Parsetree.class_type -> Ast_410.Parsetree.class_type =
  fun
    { Ast_409.Parsetree.pcty_desc = pcty_desc;
      Ast_409.Parsetree.pcty_loc = pcty_loc;
      Ast_409.Parsetree.pcty_attributes = pcty_attributes }
    ->
      {
        Ast_410.Parsetree.pcty_desc = (copy_class_type_desc pcty_desc);
        Ast_410.Parsetree.pcty_loc = (copy_location pcty_loc);
        Ast_410.Parsetree.pcty_attributes = (copy_attributes pcty_attributes)
      }
and copy_class_type_desc :
  Ast_409.Parsetree.class_type_desc -> Ast_410.Parsetree.class_type_desc =
  function
  | Ast_409.Parsetree.Pcty_constr (x0, x1) ->
      Ast_410.Parsetree.Pcty_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_409.Parsetree.Pcty_signature x0 ->
      Ast_410.Parsetree.Pcty_signature (copy_class_signature x0)
  | Ast_409.Parsetree.Pcty_arrow (x0, x1, x2) ->
      Ast_410.Parsetree.Pcty_arrow
        ((copy_arg_label x0), (copy_core_type x1), (copy_class_type x2))
  | Ast_409.Parsetree.Pcty_extension x0 ->
      Ast_410.Parsetree.Pcty_extension (copy_extension x0)
  | Ast_409.Parsetree.Pcty_open (x0, x1) ->
      Ast_410.Parsetree.Pcty_open
        ((copy_open_description x0), (copy_class_type x1))
and copy_class_signature :
  Ast_409.Parsetree.class_signature -> Ast_410.Parsetree.class_signature =
  fun
    { Ast_409.Parsetree.pcsig_self = pcsig_self;
      Ast_409.Parsetree.pcsig_fields = pcsig_fields }
    ->
      {
        Ast_410.Parsetree.pcsig_self = (copy_core_type pcsig_self);
        Ast_410.Parsetree.pcsig_fields =
          (List.map copy_class_type_field pcsig_fields)
      }
and copy_class_type_field :
  Ast_409.Parsetree.class_type_field -> Ast_410.Parsetree.class_type_field =
  fun
    { Ast_409.Parsetree.pctf_desc = pctf_desc;
      Ast_409.Parsetree.pctf_loc = pctf_loc;
      Ast_409.Parsetree.pctf_attributes = pctf_attributes }
    ->
      {
        Ast_410.Parsetree.pctf_desc = (copy_class_type_field_desc pctf_desc);
        Ast_410.Parsetree.pctf_loc = (copy_location pctf_loc);
        Ast_410.Parsetree.pctf_attributes = (copy_attributes pctf_attributes)
      }
and copy_class_type_field_desc :
  Ast_409.Parsetree.class_type_field_desc ->
  Ast_410.Parsetree.class_type_field_desc
  =
  function
  | Ast_409.Parsetree.Pctf_inherit x0 ->
      Ast_410.Parsetree.Pctf_inherit (copy_class_type x0)
  | Ast_409.Parsetree.Pctf_val x0 ->
      Ast_410.Parsetree.Pctf_val
        (let (x0, x1, x2, x3) = x0 in
         ((copy_loc copy_label x0), (copy_mutable_flag x1),
          (copy_virtual_flag x2), (copy_core_type x3)))
  | Ast_409.Parsetree.Pctf_method x0 ->
      Ast_410.Parsetree.Pctf_method
        (let (x0, x1, x2, x3) = x0 in
         ((copy_loc copy_label x0), (copy_private_flag x1),
          (copy_virtual_flag x2), (copy_core_type x3)))
  | Ast_409.Parsetree.Pctf_constraint x0 ->
      Ast_410.Parsetree.Pctf_constraint
        (let (x0, x1) = x0 in ((copy_core_type x0), (copy_core_type x1)))
  | Ast_409.Parsetree.Pctf_attribute x0 ->
      Ast_410.Parsetree.Pctf_attribute (copy_attribute x0)
  | Ast_409.Parsetree.Pctf_extension x0 ->
      Ast_410.Parsetree.Pctf_extension (copy_extension x0)
and copy_extension :
  Ast_409.Parsetree.extension -> Ast_410.Parsetree.extension =
  fun x ->
  let (x0, x1) = x in ((copy_loc (fun x -> x) x0), (copy_payload x1))
and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
  'f0 Ast_409.Parsetree.class_infos -> 'g0 Ast_410.Parsetree.class_infos
  =
  fun f0 ->
  fun
    { Ast_409.Parsetree.pci_virt = pci_virt;
      Ast_409.Parsetree.pci_params = pci_params;
      Ast_409.Parsetree.pci_name = pci_name;
      Ast_409.Parsetree.pci_expr = pci_expr;
      Ast_409.Parsetree.pci_loc = pci_loc;
      Ast_409.Parsetree.pci_attributes = pci_attributes }
    ->
      {
        Ast_410.Parsetree.pci_virt = (copy_virtual_flag pci_virt);
        Ast_410.Parsetree.pci_params =
          (List.map
             (fun x ->
                let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
             pci_params);
        Ast_410.Parsetree.pci_name = (copy_loc (fun x -> x) pci_name);
        Ast_410.Parsetree.pci_expr = (f0 pci_expr);
        Ast_410.Parsetree.pci_loc = (copy_location pci_loc);
        Ast_410.Parsetree.pci_attributes = (copy_attributes pci_attributes)
      }
and copy_virtual_flag :
  Ast_409.Asttypes.virtual_flag -> Ast_410.Asttypes.virtual_flag =
  function
  | Ast_409.Asttypes.Virtual -> Ast_410.Asttypes.Virtual
  | Ast_409.Asttypes.Concrete -> Ast_410.Asttypes.Concrete
and copy_include_description :
  Ast_409.Parsetree.include_description ->
  Ast_410.Parsetree.include_description
  = fun x -> copy_include_infos copy_module_type x
and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
  'f0 Ast_409.Parsetree.include_infos ->
  'g0 Ast_410.Parsetree.include_infos
  =
  fun f0 ->
  fun
    { Ast_409.Parsetree.pincl_mod = pincl_mod;
      Ast_409.Parsetree.pincl_loc = pincl_loc;
      Ast_409.Parsetree.pincl_attributes = pincl_attributes }
    ->
      {
        Ast_410.Parsetree.pincl_mod = (f0 pincl_mod);
        Ast_410.Parsetree.pincl_loc = (copy_location pincl_loc);
        Ast_410.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }
and copy_open_description :
  Ast_409.Parsetree.open_description -> Ast_410.Parsetree.open_description =
  fun x -> copy_open_infos (fun x -> copy_loc copy_Longident_t x) x
and copy_open_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
  'f0 Ast_409.Parsetree.open_infos -> 'g0 Ast_410.Parsetree.open_infos
  =
  fun f0 ->
  fun
    { Ast_409.Parsetree.popen_expr = popen_expr;
      Ast_409.Parsetree.popen_override = popen_override;
      Ast_409.Parsetree.popen_loc = popen_loc;
      Ast_409.Parsetree.popen_attributes = popen_attributes }
    ->
      {
        Ast_410.Parsetree.popen_expr = (f0 popen_expr);
        Ast_410.Parsetree.popen_override =
          (copy_override_flag popen_override);
        Ast_410.Parsetree.popen_loc = (copy_location popen_loc);
        Ast_410.Parsetree.popen_attributes =
          (copy_attributes popen_attributes)
      }
and copy_override_flag :
  Ast_409.Asttypes.override_flag -> Ast_410.Asttypes.override_flag =
  function
  | Ast_409.Asttypes.Override -> Ast_410.Asttypes.Override
  | Ast_409.Asttypes.Fresh -> Ast_410.Asttypes.Fresh
and copy_module_type_declaration :
  Ast_409.Parsetree.module_type_declaration ->
  Ast_410.Parsetree.module_type_declaration
  =
  fun
    { Ast_409.Parsetree.pmtd_name = pmtd_name;
      Ast_409.Parsetree.pmtd_type = pmtd_type;
      Ast_409.Parsetree.pmtd_attributes = pmtd_attributes;
      Ast_409.Parsetree.pmtd_loc = pmtd_loc }
    ->
      {
        Ast_410.Parsetree.pmtd_name = (copy_loc (fun x -> x) pmtd_name);
        Ast_410.Parsetree.pmtd_type = (map_option copy_module_type pmtd_type);
        Ast_410.Parsetree.pmtd_attributes = (copy_attributes pmtd_attributes);
        Ast_410.Parsetree.pmtd_loc = (copy_location pmtd_loc)
      }
and copy_module_substitution :
  Ast_409.Parsetree.module_substitution ->
  Ast_410.Parsetree.module_substitution
  =
  fun
    { Ast_409.Parsetree.pms_name = pms_name;
      Ast_409.Parsetree.pms_manifest = pms_manifest;
      Ast_409.Parsetree.pms_attributes = pms_attributes;
      Ast_409.Parsetree.pms_loc = pms_loc }
    ->
      {
        Ast_410.Parsetree.pms_name = (copy_loc (fun x -> x) pms_name);
        Ast_410.Parsetree.pms_manifest =
          (copy_loc copy_Longident_t pms_manifest);
        Ast_410.Parsetree.pms_attributes = (copy_attributes pms_attributes);
        Ast_410.Parsetree.pms_loc = (copy_location pms_loc)
      }
and copy_module_declaration :
  Ast_409.Parsetree.module_declaration ->
  Ast_410.Parsetree.module_declaration
  =
  fun
    { Ast_409.Parsetree.pmd_name = pmd_name;
      Ast_409.Parsetree.pmd_type = pmd_type;
      Ast_409.Parsetree.pmd_attributes = pmd_attributes;
      Ast_409.Parsetree.pmd_loc = pmd_loc }
    ->
      {
        Ast_410.Parsetree.pmd_name = (copy_loc (fun x -> Some x) pmd_name);
        Ast_410.Parsetree.pmd_type = (copy_module_type pmd_type);
        Ast_410.Parsetree.pmd_attributes = (copy_attributes pmd_attributes);
        Ast_410.Parsetree.pmd_loc = (copy_location pmd_loc)
      }
and copy_type_exception :
  Ast_409.Parsetree.type_exception -> Ast_410.Parsetree.type_exception =
  fun
    { Ast_409.Parsetree.ptyexn_constructor = ptyexn_constructor;
      Ast_409.Parsetree.ptyexn_loc = ptyexn_loc;
      Ast_409.Parsetree.ptyexn_attributes = ptyexn_attributes }
    ->
      {
        Ast_410.Parsetree.ptyexn_constructor =
          (copy_extension_constructor ptyexn_constructor);
        Ast_410.Parsetree.ptyexn_loc = (copy_location ptyexn_loc);
        Ast_410.Parsetree.ptyexn_attributes =
          (copy_attributes ptyexn_attributes)
      }
and copy_type_extension :
  Ast_409.Parsetree.type_extension -> Ast_410.Parsetree.type_extension =
  fun
    { Ast_409.Parsetree.ptyext_path = ptyext_path;
      Ast_409.Parsetree.ptyext_params = ptyext_params;
      Ast_409.Parsetree.ptyext_constructors = ptyext_constructors;
      Ast_409.Parsetree.ptyext_private = ptyext_private;
      Ast_409.Parsetree.ptyext_loc = ptyext_loc;
      Ast_409.Parsetree.ptyext_attributes = ptyext_attributes }
    ->
      {
        Ast_410.Parsetree.ptyext_path = (copy_loc copy_Longident_t ptyext_path);
        Ast_410.Parsetree.ptyext_params =
          (List.map
             (fun x ->
                let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
             ptyext_params);
        Ast_410.Parsetree.ptyext_constructors =
          (List.map copy_extension_constructor ptyext_constructors);
        Ast_410.Parsetree.ptyext_private = (copy_private_flag ptyext_private);
        Ast_410.Parsetree.ptyext_loc = (copy_location ptyext_loc);
        Ast_410.Parsetree.ptyext_attributes =
          (copy_attributes ptyext_attributes)
      }
and copy_extension_constructor :
  Ast_409.Parsetree.extension_constructor ->
  Ast_410.Parsetree.extension_constructor
  =
  fun
    { Ast_409.Parsetree.pext_name = pext_name;
      Ast_409.Parsetree.pext_kind = pext_kind;
      Ast_409.Parsetree.pext_loc = pext_loc;
      Ast_409.Parsetree.pext_attributes = pext_attributes }
    ->
      {
        Ast_410.Parsetree.pext_name = (copy_loc (fun x -> x) pext_name);
        Ast_410.Parsetree.pext_kind =
          (copy_extension_constructor_kind pext_kind);
        Ast_410.Parsetree.pext_loc = (copy_location pext_loc);
        Ast_410.Parsetree.pext_attributes = (copy_attributes pext_attributes)
      }
and copy_extension_constructor_kind :
  Ast_409.Parsetree.extension_constructor_kind ->
  Ast_410.Parsetree.extension_constructor_kind
  =
  function
  | Ast_409.Parsetree.Pext_decl (x0, x1) ->
      Ast_410.Parsetree.Pext_decl
        ((copy_constructor_arguments x0), (map_option copy_core_type x1))
  | Ast_409.Parsetree.Pext_rebind x0 ->
      Ast_410.Parsetree.Pext_rebind (copy_loc copy_Longident_t x0)
and copy_type_declaration :
  Ast_409.Parsetree.type_declaration -> Ast_410.Parsetree.type_declaration =
  fun
    { Ast_409.Parsetree.ptype_name = ptype_name;
      Ast_409.Parsetree.ptype_params = ptype_params;
      Ast_409.Parsetree.ptype_cstrs = ptype_cstrs;
      Ast_409.Parsetree.ptype_kind = ptype_kind;
      Ast_409.Parsetree.ptype_private = ptype_private;
      Ast_409.Parsetree.ptype_manifest = ptype_manifest;
      Ast_409.Parsetree.ptype_attributes = ptype_attributes;
      Ast_409.Parsetree.ptype_loc = ptype_loc }
    ->
      {
        Ast_410.Parsetree.ptype_name = (copy_loc (fun x -> x) ptype_name);
        Ast_410.Parsetree.ptype_params =
          (List.map
             (fun x ->
                let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
             ptype_params);
        Ast_410.Parsetree.ptype_cstrs =
          (List.map
             (fun x ->
                let (x0, x1, x2) = x in
                ((copy_core_type x0), (copy_core_type x1), (copy_location x2)))
             ptype_cstrs);
        Ast_410.Parsetree.ptype_kind = (copy_type_kind ptype_kind);
        Ast_410.Parsetree.ptype_private = (copy_private_flag ptype_private);
        Ast_410.Parsetree.ptype_manifest =
          (map_option copy_core_type ptype_manifest);
        Ast_410.Parsetree.ptype_attributes = (copy_attributes ptype_attributes);
        Ast_410.Parsetree.ptype_loc = (copy_location ptype_loc)
      }
and copy_private_flag :
  Ast_409.Asttypes.private_flag -> Ast_410.Asttypes.private_flag =
  function
  | Ast_409.Asttypes.Private -> Ast_410.Asttypes.Private
  | Ast_409.Asttypes.Public -> Ast_410.Asttypes.Public
and copy_type_kind :
  Ast_409.Parsetree.type_kind -> Ast_410.Parsetree.type_kind =
  function
  | Ast_409.Parsetree.Ptype_abstract -> Ast_410.Parsetree.Ptype_abstract
  | Ast_409.Parsetree.Ptype_variant x0 ->
      Ast_410.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | Ast_409.Parsetree.Ptype_record x0 ->
      Ast_410.Parsetree.Ptype_record (List.map copy_label_declaration x0)
  | Ast_409.Parsetree.Ptype_open -> Ast_410.Parsetree.Ptype_open
and copy_constructor_declaration :
  Ast_409.Parsetree.constructor_declaration ->
  Ast_410.Parsetree.constructor_declaration
  =
  fun
    { Ast_409.Parsetree.pcd_name = pcd_name;
      Ast_409.Parsetree.pcd_args = pcd_args;
      Ast_409.Parsetree.pcd_res = pcd_res;
      Ast_409.Parsetree.pcd_loc = pcd_loc;
      Ast_409.Parsetree.pcd_attributes = pcd_attributes }
    ->
      {
        Ast_410.Parsetree.pcd_name = (copy_loc (fun x -> x) pcd_name);
        Ast_410.Parsetree.pcd_args = (copy_constructor_arguments pcd_args);
        Ast_410.Parsetree.pcd_res = (map_option copy_core_type pcd_res);
        Ast_410.Parsetree.pcd_loc = (copy_location pcd_loc);
        Ast_410.Parsetree.pcd_attributes = (copy_attributes pcd_attributes)
      }
and copy_constructor_arguments :
  Ast_409.Parsetree.constructor_arguments ->
  Ast_410.Parsetree.constructor_arguments
  =
  function
  | Ast_409.Parsetree.Pcstr_tuple x0 ->
      Ast_410.Parsetree.Pcstr_tuple (List.map copy_core_type x0)
  | Ast_409.Parsetree.Pcstr_record x0 ->
      Ast_410.Parsetree.Pcstr_record (List.map copy_label_declaration x0)
and copy_label_declaration :
  Ast_409.Parsetree.label_declaration -> Ast_410.Parsetree.label_declaration
  =
  fun
    { Ast_409.Parsetree.pld_name = pld_name;
      Ast_409.Parsetree.pld_mutable = pld_mutable;
      Ast_409.Parsetree.pld_type = pld_type;
      Ast_409.Parsetree.pld_loc = pld_loc;
      Ast_409.Parsetree.pld_attributes = pld_attributes }
    ->
      {
        Ast_410.Parsetree.pld_name = (copy_loc (fun x -> x) pld_name);
        Ast_410.Parsetree.pld_mutable = (copy_mutable_flag pld_mutable);
        Ast_410.Parsetree.pld_type = (copy_core_type pld_type);
        Ast_410.Parsetree.pld_loc = (copy_location pld_loc);
        Ast_410.Parsetree.pld_attributes = (copy_attributes pld_attributes)
      }
and copy_mutable_flag :
  Ast_409.Asttypes.mutable_flag -> Ast_410.Asttypes.mutable_flag =
  function
  | Ast_409.Asttypes.Immutable -> Ast_410.Asttypes.Immutable
  | Ast_409.Asttypes.Mutable -> Ast_410.Asttypes.Mutable
and copy_variance : Ast_409.Asttypes.variance -> Ast_410.Asttypes.variance =
  function
  | Ast_409.Asttypes.Covariant -> Ast_410.Asttypes.Covariant
  | Ast_409.Asttypes.Contravariant -> Ast_410.Asttypes.Contravariant
  | Ast_409.Asttypes.Invariant -> Ast_410.Asttypes.Invariant
and copy_value_description :
  Ast_409.Parsetree.value_description -> Ast_410.Parsetree.value_description
  =
  fun
    { Ast_409.Parsetree.pval_name = pval_name;
      Ast_409.Parsetree.pval_type = pval_type;
      Ast_409.Parsetree.pval_prim = pval_prim;
      Ast_409.Parsetree.pval_attributes = pval_attributes;
      Ast_409.Parsetree.pval_loc = pval_loc }
    ->
      {
        Ast_410.Parsetree.pval_name = (copy_loc (fun x -> x) pval_name);
        Ast_410.Parsetree.pval_type = (copy_core_type pval_type);
        Ast_410.Parsetree.pval_prim = (List.map (fun x -> x) pval_prim);
        Ast_410.Parsetree.pval_attributes = (copy_attributes pval_attributes);
        Ast_410.Parsetree.pval_loc = (copy_location pval_loc)
      }
and copy_object_field_desc :
  Ast_409.Parsetree.object_field_desc -> Ast_410.Parsetree.object_field_desc
  =
  function
  | Ast_409.Parsetree.Otag (x0, x1) ->
      Ast_410.Parsetree.Otag ((copy_loc copy_label x0), (copy_core_type x1))
  | Ast_409.Parsetree.Oinherit x0 ->
      Ast_410.Parsetree.Oinherit (copy_core_type x0)
and copy_arg_label : Ast_409.Asttypes.arg_label -> Ast_410.Asttypes.arg_label
  =
  function
  | Ast_409.Asttypes.Nolabel -> Ast_410.Asttypes.Nolabel
  | Ast_409.Asttypes.Labelled x0 -> Ast_410.Asttypes.Labelled x0
  | Ast_409.Asttypes.Optional x0 -> Ast_410.Asttypes.Optional x0
and copy_closed_flag :
  Ast_409.Asttypes.closed_flag -> Ast_410.Asttypes.closed_flag =
  function
  | Ast_409.Asttypes.Closed -> Ast_410.Asttypes.Closed
  | Ast_409.Asttypes.Open -> Ast_410.Asttypes.Open
and copy_label : Ast_409.Asttypes.label -> Ast_410.Asttypes.label =
  fun x -> x
and copy_rec_flag : Ast_409.Asttypes.rec_flag -> Ast_410.Asttypes.rec_flag =
  function
  | Ast_409.Asttypes.Nonrecursive -> Ast_410.Asttypes.Nonrecursive
  | Ast_409.Asttypes.Recursive -> Ast_410.Asttypes.Recursive
and copy_constant : Ast_409.Parsetree.constant -> Ast_410.Parsetree.constant
  =
  function
  | Ast_409.Parsetree.Pconst_integer (x0, x1) ->
      Ast_410.Parsetree.Pconst_integer (x0, (map_option (fun x -> x) x1))
  | Ast_409.Parsetree.Pconst_char x0 -> Ast_410.Parsetree.Pconst_char x0
  | Ast_409.Parsetree.Pconst_string (x0, x1) ->
      Ast_410.Parsetree.Pconst_string (x0, (map_option (fun x -> x) x1))
  | Ast_409.Parsetree.Pconst_float (x0, x1) ->
      Ast_410.Parsetree.Pconst_float (x0, (map_option (fun x -> x) x1))
and copy_Longident_t : Ast_409.Longident.t -> Ast_410.Longident.t =
  function
  | Ast_409.Longident.Lident x0 -> Ast_410.Longident.Lident x0
  | Ast_409.Longident.Ldot (x0, x1) ->
      Ast_410.Longident.Ldot ((copy_Longident_t x0), x1)
  | Ast_409.Longident.Lapply (x0, x1) ->
      Ast_410.Longident.Lapply ((copy_Longident_t x0), (copy_Longident_t x1))
and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 Ast_409.Asttypes.loc -> 'g0 Ast_410.Asttypes.loc
  =
  fun f0 ->
  fun { Ast_409.Asttypes.txt = txt; Ast_409.Asttypes.loc = loc } ->
  {
    Ast_410.Asttypes.txt = (f0 txt);
    Ast_410.Asttypes.loc = (copy_location loc)
  }
and copy_location : Ast_409.Location.t -> Ast_410.Location.t =
  fun
    { Ast_409.Location.loc_start = loc_start;
      Ast_409.Location.loc_end = loc_end;
      Ast_409.Location.loc_ghost = loc_ghost }
    ->
      {
        Ast_410.Location.loc_start = (copy_position loc_start);
        Ast_410.Location.loc_end = (copy_position loc_end);
        Ast_410.Location.loc_ghost = loc_ghost
      }
and copy_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
    ->
      {
        Lexing.pos_fname = pos_fname;
        Lexing.pos_lnum = pos_lnum;
        Lexing.pos_bol = pos_bol;
        Lexing.pos_cnum = pos_cnum
      }
let copy_expr = copy_expression
let copy_pat = copy_pattern
let copy_typ = copy_core_type

end
module Migrate_parsetree_410_409_migrate
= struct
#1 "migrate_parsetree_410_409_migrate.ml"
# 1 "src/migrate_parsetree_410_409_migrate.ml"
module From = Ast_410
module To = Ast_409

module Def = Migrate_parsetree_def

let migration_error location feature =
  raise (Def.Migration_error (feature, location))

let map_option f x =
  match x with
  | None -> None
  | Some x -> Some (f x)

let rec copy_out_type_extension :
  Ast_410.Outcometree.out_type_extension ->
    Ast_409.Outcometree.out_type_extension
  =
  fun
    { Ast_410.Outcometree.otyext_name = otyext_name;
      Ast_410.Outcometree.otyext_params = otyext_params;
      Ast_410.Outcometree.otyext_constructors = otyext_constructors;
      Ast_410.Outcometree.otyext_private = otyext_private }
    ->
    {
      Ast_409.Outcometree.otyext_name = otyext_name;
      Ast_409.Outcometree.otyext_params =
        (List.map (fun x -> x) otyext_params);
      Ast_409.Outcometree.otyext_constructors =
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              (x0, (List.map copy_out_type x1),
                (map_option copy_out_type x2))) otyext_constructors);
      Ast_409.Outcometree.otyext_private = (copy_private_flag otyext_private)
    }
and copy_out_phrase :
  Ast_410.Outcometree.out_phrase -> Ast_409.Outcometree.out_phrase =
  function
  | Ast_410.Outcometree.Ophr_eval (x0, x1) ->
      Ast_409.Outcometree.Ophr_eval ((copy_out_value x0), (copy_out_type x1))
  | Ast_410.Outcometree.Ophr_signature x0 ->
      Ast_409.Outcometree.Ophr_signature
        (List.map
           (fun x ->
              let (x0, x1) = x in
              ((copy_out_sig_item x0), (map_option copy_out_value x1))) x0)
  | Ast_410.Outcometree.Ophr_exception x0 ->
      Ast_409.Outcometree.Ophr_exception
        (let (x0, x1) = x0 in (x0, (copy_out_value x1)))
and copy_out_sig_item :
  Ast_410.Outcometree.out_sig_item -> Ast_409.Outcometree.out_sig_item =
  function
  | Ast_410.Outcometree.Osig_class (x0, x1, x2, x3, x4) ->
      Ast_409.Outcometree.Osig_class
        (x0, x1,
          (List.map
             (fun x ->
                let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1)))) x2),
          (copy_out_class_type x3), (copy_out_rec_status x4))
  | Ast_410.Outcometree.Osig_class_type (x0, x1, x2, x3, x4) ->
      Ast_409.Outcometree.Osig_class_type
        (x0, x1,
          (List.map
             (fun x ->
                let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1)))) x2),
          (copy_out_class_type x3), (copy_out_rec_status x4))
  | Ast_410.Outcometree.Osig_typext (x0, x1) ->
      Ast_409.Outcometree.Osig_typext
        ((copy_out_extension_constructor x0), (copy_out_ext_status x1))
  | Ast_410.Outcometree.Osig_modtype (x0, x1) ->
      Ast_409.Outcometree.Osig_modtype (x0, (copy_out_module_type x1))
  | Ast_410.Outcometree.Osig_module (x0, x1, x2) ->
      Ast_409.Outcometree.Osig_module
        (x0, (copy_out_module_type x1), (copy_out_rec_status x2))
  | Ast_410.Outcometree.Osig_type (x0, x1) ->
      Ast_409.Outcometree.Osig_type
        ((copy_out_type_decl x0), (copy_out_rec_status x1))
  | Ast_410.Outcometree.Osig_value x0 ->
      Ast_409.Outcometree.Osig_value (copy_out_val_decl x0)
  | Ast_410.Outcometree.Osig_ellipsis -> Ast_409.Outcometree.Osig_ellipsis
and copy_out_val_decl :
  Ast_410.Outcometree.out_val_decl -> Ast_409.Outcometree.out_val_decl =
  fun
    { Ast_410.Outcometree.oval_name = oval_name;
      Ast_410.Outcometree.oval_type = oval_type;
      Ast_410.Outcometree.oval_prims = oval_prims;
      Ast_410.Outcometree.oval_attributes = oval_attributes }
    ->
    {
      Ast_409.Outcometree.oval_name = oval_name;
      Ast_409.Outcometree.oval_type = (copy_out_type oval_type);
      Ast_409.Outcometree.oval_prims = (List.map (fun x -> x) oval_prims);
      Ast_409.Outcometree.oval_attributes =
        (List.map copy_out_attribute oval_attributes)
    }
and copy_out_type_decl :
  Ast_410.Outcometree.out_type_decl -> Ast_409.Outcometree.out_type_decl =
  fun
    { Ast_410.Outcometree.otype_name = otype_name;
      Ast_410.Outcometree.otype_params = otype_params;
      Ast_410.Outcometree.otype_type = otype_type;
      Ast_410.Outcometree.otype_private = otype_private;
      Ast_410.Outcometree.otype_immediate = otype_immediate;
      Ast_410.Outcometree.otype_unboxed = otype_unboxed;
      Ast_410.Outcometree.otype_cstrs = otype_cstrs }
    ->
    {
      Ast_409.Outcometree.otype_name = otype_name;
      Ast_409.Outcometree.otype_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in (x0, (let (x0, x1) = x1 in (x0, x1))))
           otype_params);
      Ast_409.Outcometree.otype_type = (copy_out_type otype_type);
      Ast_409.Outcometree.otype_private = (copy_private_flag otype_private);
      Ast_409.Outcometree.otype_immediate =
        (copy_Type_immediacy_t otype_immediate);
      Ast_409.Outcometree.otype_unboxed = otype_unboxed;
      Ast_409.Outcometree.otype_cstrs =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_out_type x0), (copy_out_type x1)))
           otype_cstrs)
    }
and copy_Type_immediacy_t :
  Ast_410.Type_immediacy.t -> bool =
  function
  | Ast_410.Type_immediacy.Unknown -> false
  | Ast_410.Type_immediacy.Always -> true
  | Ast_410.Type_immediacy.Always_on_64bits -> migration_error Location.none Immediate64
and copy_out_module_type :
  Ast_410.Outcometree.out_module_type -> Ast_409.Outcometree.out_module_type
  =
  function
  | Ast_410.Outcometree.Omty_abstract -> Ast_409.Outcometree.Omty_abstract
  | Ast_410.Outcometree.Omty_functor (x0, x1) ->
      let name, mt =
        match x0 with
        | None -> "*", None
        | Some (None, mt) -> "_", Some (copy_out_module_type mt)
        | Some (Some s, mt) -> s, Some (copy_out_module_type mt)
      in
      Ast_409.Outcometree.Omty_functor
        (name, mt, copy_out_module_type x1)
  | Ast_410.Outcometree.Omty_ident x0 ->
      Ast_409.Outcometree.Omty_ident (copy_out_ident x0)
  | Ast_410.Outcometree.Omty_signature x0 ->
      Ast_409.Outcometree.Omty_signature (List.map copy_out_sig_item x0)
  | Ast_410.Outcometree.Omty_alias x0 ->
      Ast_409.Outcometree.Omty_alias (copy_out_ident x0)
and copy_out_ext_status :
  Ast_410.Outcometree.out_ext_status -> Ast_409.Outcometree.out_ext_status =
  function
  | Ast_410.Outcometree.Oext_first -> Ast_409.Outcometree.Oext_first
  | Ast_410.Outcometree.Oext_next -> Ast_409.Outcometree.Oext_next
  | Ast_410.Outcometree.Oext_exception -> Ast_409.Outcometree.Oext_exception
and copy_out_extension_constructor :
  Ast_410.Outcometree.out_extension_constructor ->
    Ast_409.Outcometree.out_extension_constructor
  =
  fun
    { Ast_410.Outcometree.oext_name = oext_name;
      Ast_410.Outcometree.oext_type_name = oext_type_name;
      Ast_410.Outcometree.oext_type_params = oext_type_params;
      Ast_410.Outcometree.oext_args = oext_args;
      Ast_410.Outcometree.oext_ret_type = oext_ret_type;
      Ast_410.Outcometree.oext_private = oext_private }
    ->
    {
      Ast_409.Outcometree.oext_name = oext_name;
      Ast_409.Outcometree.oext_type_name = oext_type_name;
      Ast_409.Outcometree.oext_type_params =
        (List.map (fun x -> x) oext_type_params);
      Ast_409.Outcometree.oext_args = (List.map copy_out_type oext_args);
      Ast_409.Outcometree.oext_ret_type =
        (map_option copy_out_type oext_ret_type);
      Ast_409.Outcometree.oext_private = (copy_private_flag oext_private)
    }
and copy_out_rec_status :
  Ast_410.Outcometree.out_rec_status -> Ast_409.Outcometree.out_rec_status =
  function
  | Ast_410.Outcometree.Orec_not -> Ast_409.Outcometree.Orec_not
  | Ast_410.Outcometree.Orec_first -> Ast_409.Outcometree.Orec_first
  | Ast_410.Outcometree.Orec_next -> Ast_409.Outcometree.Orec_next
and copy_out_class_type :
  Ast_410.Outcometree.out_class_type -> Ast_409.Outcometree.out_class_type =
  function
  | Ast_410.Outcometree.Octy_constr (x0, x1) ->
      Ast_409.Outcometree.Octy_constr
        ((copy_out_ident x0), (List.map copy_out_type x1))
  | Ast_410.Outcometree.Octy_arrow (x0, x1, x2) ->
      Ast_409.Outcometree.Octy_arrow
        (x0, (copy_out_type x1), (copy_out_class_type x2))
  | Ast_410.Outcometree.Octy_signature (x0, x1) ->
      Ast_409.Outcometree.Octy_signature
        ((map_option copy_out_type x0),
          (List.map copy_out_class_sig_item x1))
and copy_out_class_sig_item :
  Ast_410.Outcometree.out_class_sig_item ->
    Ast_409.Outcometree.out_class_sig_item
  =
  function
  | Ast_410.Outcometree.Ocsg_constraint (x0, x1) ->
      Ast_409.Outcometree.Ocsg_constraint
        ((copy_out_type x0), (copy_out_type x1))
  | Ast_410.Outcometree.Ocsg_method (x0, x1, x2, x3) ->
      Ast_409.Outcometree.Ocsg_method (x0, x1, x2, (copy_out_type x3))
  | Ast_410.Outcometree.Ocsg_value (x0, x1, x2, x3) ->
      Ast_409.Outcometree.Ocsg_value (x0, x1, x2, (copy_out_type x3))
and copy_out_type :
  Ast_410.Outcometree.out_type -> Ast_409.Outcometree.out_type =
  function
  | Ast_410.Outcometree.Otyp_abstract -> Ast_409.Outcometree.Otyp_abstract
  | Ast_410.Outcometree.Otyp_open -> Ast_409.Outcometree.Otyp_open
  | Ast_410.Outcometree.Otyp_alias (x0, x1) ->
      Ast_409.Outcometree.Otyp_alias ((copy_out_type x0), x1)
  | Ast_410.Outcometree.Otyp_arrow (x0, x1, x2) ->
      Ast_409.Outcometree.Otyp_arrow
        (x0, (copy_out_type x1), (copy_out_type x2))
  | Ast_410.Outcometree.Otyp_class (x0, x1, x2) ->
      Ast_409.Outcometree.Otyp_class
        (x0, (copy_out_ident x1), (List.map copy_out_type x2))
  | Ast_410.Outcometree.Otyp_constr (x0, x1) ->
      Ast_409.Outcometree.Otyp_constr
        ((copy_out_ident x0), (List.map copy_out_type x1))
  | Ast_410.Outcometree.Otyp_manifest (x0, x1) ->
      Ast_409.Outcometree.Otyp_manifest
        ((copy_out_type x0), (copy_out_type x1))
  | Ast_410.Outcometree.Otyp_object (x0, x1) ->
      Ast_409.Outcometree.Otyp_object
        ((List.map (fun x -> let (x0, x1) = x in (x0, (copy_out_type x1))) x0),
          (map_option (fun x -> x) x1))
  | Ast_410.Outcometree.Otyp_record x0 ->
      Ast_409.Outcometree.Otyp_record
        (List.map
           (fun x -> let (x0, x1, x2) = x in (x0, x1, (copy_out_type x2))) x0)
  | Ast_410.Outcometree.Otyp_stuff x0 -> Ast_409.Outcometree.Otyp_stuff x0
  | Ast_410.Outcometree.Otyp_sum x0 ->
      Ast_409.Outcometree.Otyp_sum
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              (x0, (List.map copy_out_type x1),
                (map_option copy_out_type x2))) x0)
  | Ast_410.Outcometree.Otyp_tuple x0 ->
      Ast_409.Outcometree.Otyp_tuple (List.map copy_out_type x0)
  | Ast_410.Outcometree.Otyp_var (x0, x1) ->
      Ast_409.Outcometree.Otyp_var (x0, x1)
  | Ast_410.Outcometree.Otyp_variant (x0, x1, x2, x3) ->
      Ast_409.Outcometree.Otyp_variant
        (x0, (copy_out_variant x1), x2,
          (map_option (fun x -> List.map (fun x -> x) x) x3))
  | Ast_410.Outcometree.Otyp_poly (x0, x1) ->
      Ast_409.Outcometree.Otyp_poly
        ((List.map (fun x -> x) x0), (copy_out_type x1))
  | Ast_410.Outcometree.Otyp_module (x0, x1, x2) ->
      Ast_409.Outcometree.Otyp_module
        ((copy_out_ident x0), (List.map (fun x -> x) x1),
          (List.map copy_out_type x2))
  | Ast_410.Outcometree.Otyp_attribute (x0, x1) ->
      Ast_409.Outcometree.Otyp_attribute
        ((copy_out_type x0), (copy_out_attribute x1))
and copy_out_attribute :
  Ast_410.Outcometree.out_attribute -> Ast_409.Outcometree.out_attribute =
  fun { Ast_410.Outcometree.oattr_name = oattr_name } ->
    { Ast_409.Outcometree.oattr_name = oattr_name }
and copy_out_variant :
  Ast_410.Outcometree.out_variant -> Ast_409.Outcometree.out_variant =
  function
  | Ast_410.Outcometree.Ovar_fields x0 ->
      Ast_409.Outcometree.Ovar_fields
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in (x0, x1, (List.map copy_out_type x2)))
           x0)
  | Ast_410.Outcometree.Ovar_typ x0 ->
      Ast_409.Outcometree.Ovar_typ (copy_out_type x0)
and copy_out_value :
  Ast_410.Outcometree.out_value -> Ast_409.Outcometree.out_value =
  function
  | Ast_410.Outcometree.Oval_array x0 ->
      Ast_409.Outcometree.Oval_array (List.map copy_out_value x0)
  | Ast_410.Outcometree.Oval_char x0 -> Ast_409.Outcometree.Oval_char x0
  | Ast_410.Outcometree.Oval_constr (x0, x1) ->
      Ast_409.Outcometree.Oval_constr
        ((copy_out_ident x0), (List.map copy_out_value x1))
  | Ast_410.Outcometree.Oval_ellipsis -> Ast_409.Outcometree.Oval_ellipsis
  | Ast_410.Outcometree.Oval_float x0 -> Ast_409.Outcometree.Oval_float x0
  | Ast_410.Outcometree.Oval_int x0 -> Ast_409.Outcometree.Oval_int x0
  | Ast_410.Outcometree.Oval_int32 x0 -> Ast_409.Outcometree.Oval_int32 x0
  | Ast_410.Outcometree.Oval_int64 x0 -> Ast_409.Outcometree.Oval_int64 x0
  | Ast_410.Outcometree.Oval_nativeint x0 ->
      Ast_409.Outcometree.Oval_nativeint x0
  | Ast_410.Outcometree.Oval_list x0 ->
      Ast_409.Outcometree.Oval_list (List.map copy_out_value x0)
  | Ast_410.Outcometree.Oval_printer x0 ->
      Ast_409.Outcometree.Oval_printer x0
  | Ast_410.Outcometree.Oval_record x0 ->
      Ast_409.Outcometree.Oval_record
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_out_ident x0), (copy_out_value x1)))
           x0)
  | Ast_410.Outcometree.Oval_string (x0, x1, x2) ->
      Ast_409.Outcometree.Oval_string (x0, x1, (copy_out_string x2))
  | Ast_410.Outcometree.Oval_stuff x0 -> Ast_409.Outcometree.Oval_stuff x0
  | Ast_410.Outcometree.Oval_tuple x0 ->
      Ast_409.Outcometree.Oval_tuple (List.map copy_out_value x0)
  | Ast_410.Outcometree.Oval_variant (x0, x1) ->
      Ast_409.Outcometree.Oval_variant (x0, (map_option copy_out_value x1))
and copy_out_string :
  Ast_410.Outcometree.out_string -> Ast_409.Outcometree.out_string =
  function
  | Ast_410.Outcometree.Ostr_string -> Ast_409.Outcometree.Ostr_string
  | Ast_410.Outcometree.Ostr_bytes -> Ast_409.Outcometree.Ostr_bytes
and copy_out_ident :
  Ast_410.Outcometree.out_ident -> Ast_409.Outcometree.out_ident =
  function
  | Ast_410.Outcometree.Oide_apply (x0, x1) ->
      Ast_409.Outcometree.Oide_apply
        ((copy_out_ident x0), (copy_out_ident x1))
  | Ast_410.Outcometree.Oide_dot (x0, x1) ->
      Ast_409.Outcometree.Oide_dot ((copy_out_ident x0), x1)
  | Ast_410.Outcometree.Oide_ident x0 ->
      Ast_409.Outcometree.Oide_ident (copy_out_name x0)
and copy_out_name :
  Ast_410.Outcometree.out_name -> Ast_409.Outcometree.out_name =
  fun { Ast_410.Outcometree.printed_name = printed_name } ->
    { Ast_409.Outcometree.printed_name = printed_name }
and copy_toplevel_phrase :
  Ast_410.Parsetree.toplevel_phrase -> Ast_409.Parsetree.toplevel_phrase =
  function
  | Ast_410.Parsetree.Ptop_def x0 ->
      Ast_409.Parsetree.Ptop_def (copy_structure x0)
  | Ast_410.Parsetree.Ptop_dir x0 ->
      Ast_409.Parsetree.Ptop_dir (copy_toplevel_directive x0)
and copy_toplevel_directive :
  Ast_410.Parsetree.toplevel_directive ->
    Ast_409.Parsetree.toplevel_directive
  =
  fun
    { Ast_410.Parsetree.pdir_name = pdir_name;
      Ast_410.Parsetree.pdir_arg = pdir_arg;
      Ast_410.Parsetree.pdir_loc = pdir_loc }
    ->
    {
      Ast_409.Parsetree.pdir_name = (copy_loc (fun x -> x) pdir_name);
      Ast_409.Parsetree.pdir_arg =
        (map_option copy_directive_argument pdir_arg);
      Ast_409.Parsetree.pdir_loc = (copy_location pdir_loc)
    }
and copy_directive_argument :
  Ast_410.Parsetree.directive_argument ->
    Ast_409.Parsetree.directive_argument
  =
  fun
    { Ast_410.Parsetree.pdira_desc = pdira_desc;
      Ast_410.Parsetree.pdira_loc = pdira_loc }
    ->
    {
      Ast_409.Parsetree.pdira_desc =
        (copy_directive_argument_desc pdira_desc);
      Ast_409.Parsetree.pdira_loc = (copy_location pdira_loc)
    }
and copy_directive_argument_desc :
  Ast_410.Parsetree.directive_argument_desc ->
    Ast_409.Parsetree.directive_argument_desc
  =
  function
  | Ast_410.Parsetree.Pdir_string x0 -> Ast_409.Parsetree.Pdir_string x0
  | Ast_410.Parsetree.Pdir_int (x0, x1) ->
      Ast_409.Parsetree.Pdir_int (x0, (map_option (fun x -> x) x1))
  | Ast_410.Parsetree.Pdir_ident x0 ->
      Ast_409.Parsetree.Pdir_ident (copy_Longident_t x0)
  | Ast_410.Parsetree.Pdir_bool x0 -> Ast_409.Parsetree.Pdir_bool x0
and copy_expression :
  Ast_410.Parsetree.expression -> Ast_409.Parsetree.expression =
  fun
    { Ast_410.Parsetree.pexp_desc = pexp_desc;
      Ast_410.Parsetree.pexp_loc = pexp_loc;
      Ast_410.Parsetree.pexp_loc_stack = pexp_loc_stack;
      Ast_410.Parsetree.pexp_attributes = pexp_attributes }
    ->
    {
      Ast_409.Parsetree.pexp_desc = (copy_expression_desc pexp_desc);
      Ast_409.Parsetree.pexp_loc = (copy_location pexp_loc);
      Ast_409.Parsetree.pexp_loc_stack = (copy_location_stack pexp_loc_stack);
      Ast_409.Parsetree.pexp_attributes = (copy_attributes pexp_attributes)
    }
and copy_expression_desc :
  Ast_410.Parsetree.expression_desc -> Ast_409.Parsetree.expression_desc =
  function
  | Ast_410.Parsetree.Pexp_ident x0 ->
      Ast_409.Parsetree.Pexp_ident (copy_loc copy_Longident_t x0)
  | Ast_410.Parsetree.Pexp_constant x0 ->
      Ast_409.Parsetree.Pexp_constant (copy_constant x0)
  | Ast_410.Parsetree.Pexp_let (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_let
        ((copy_rec_flag x0), (List.map copy_value_binding x1),
          (copy_expression x2))
  | Ast_410.Parsetree.Pexp_function x0 ->
      Ast_409.Parsetree.Pexp_function (List.map copy_case x0)
  | Ast_410.Parsetree.Pexp_fun (x0, x1, x2, x3) ->
      Ast_409.Parsetree.Pexp_fun
        ((copy_arg_label x0), (map_option copy_expression x1),
          (copy_pattern x2), (copy_expression x3))
  | Ast_410.Parsetree.Pexp_apply (x0, x1) ->
      Ast_409.Parsetree.Pexp_apply
        ((copy_expression x0),
          (List.map
             (fun x ->
                let (x0, x1) = x in
                ((copy_arg_label x0), (copy_expression x1))) x1))
  | Ast_410.Parsetree.Pexp_match (x0, x1) ->
      Ast_409.Parsetree.Pexp_match
        ((copy_expression x0), (List.map copy_case x1))
  | Ast_410.Parsetree.Pexp_try (x0, x1) ->
      Ast_409.Parsetree.Pexp_try
        ((copy_expression x0), (List.map copy_case x1))
  | Ast_410.Parsetree.Pexp_tuple x0 ->
      Ast_409.Parsetree.Pexp_tuple (List.map copy_expression x0)
  | Ast_410.Parsetree.Pexp_construct (x0, x1) ->
      Ast_409.Parsetree.Pexp_construct
        ((copy_loc copy_Longident_t x0), (map_option copy_expression x1))
  | Ast_410.Parsetree.Pexp_variant (x0, x1) ->
      Ast_409.Parsetree.Pexp_variant
        ((copy_label x0), (map_option copy_expression x1))
  | Ast_410.Parsetree.Pexp_record (x0, x1) ->
      Ast_409.Parsetree.Pexp_record
        ((List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_loc copy_Longident_t x0), (copy_expression x1))) x0),
          (map_option copy_expression x1))
  | Ast_410.Parsetree.Pexp_field (x0, x1) ->
      Ast_409.Parsetree.Pexp_field
        ((copy_expression x0), (copy_loc copy_Longident_t x1))
  | Ast_410.Parsetree.Pexp_setfield (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_setfield
        ((copy_expression x0), (copy_loc copy_Longident_t x1),
          (copy_expression x2))
  | Ast_410.Parsetree.Pexp_array x0 ->
      Ast_409.Parsetree.Pexp_array (List.map copy_expression x0)
  | Ast_410.Parsetree.Pexp_ifthenelse (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_ifthenelse
        ((copy_expression x0), (copy_expression x1),
          (map_option copy_expression x2))
  | Ast_410.Parsetree.Pexp_sequence (x0, x1) ->
      Ast_409.Parsetree.Pexp_sequence
        ((copy_expression x0), (copy_expression x1))
  | Ast_410.Parsetree.Pexp_while (x0, x1) ->
      Ast_409.Parsetree.Pexp_while
        ((copy_expression x0), (copy_expression x1))
  | Ast_410.Parsetree.Pexp_for (x0, x1, x2, x3, x4) ->
      Ast_409.Parsetree.Pexp_for
        ((copy_pattern x0), (copy_expression x1), (copy_expression x2),
          (copy_direction_flag x3), (copy_expression x4))
  | Ast_410.Parsetree.Pexp_constraint (x0, x1) ->
      Ast_409.Parsetree.Pexp_constraint
        ((copy_expression x0), (copy_core_type x1))
  | Ast_410.Parsetree.Pexp_coerce (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_coerce
        ((copy_expression x0), (map_option copy_core_type x1),
          (copy_core_type x2))
  | Ast_410.Parsetree.Pexp_send (x0, x1) ->
      Ast_409.Parsetree.Pexp_send
        ((copy_expression x0), (copy_loc copy_label x1))
  | Ast_410.Parsetree.Pexp_new x0 ->
      Ast_409.Parsetree.Pexp_new (copy_loc copy_Longident_t x0)
  | Ast_410.Parsetree.Pexp_setinstvar (x0, x1) ->
      Ast_409.Parsetree.Pexp_setinstvar
        ((copy_loc copy_label x0), (copy_expression x1))
  | Ast_410.Parsetree.Pexp_override x0 ->
      Ast_409.Parsetree.Pexp_override
        (List.map
           (fun x ->
              let (x0, x1) = x in
              ((copy_loc copy_label x0), (copy_expression x1))) x0)
  | Ast_410.Parsetree.Pexp_letmodule (x0, x1, x2) ->
      Ast_409.Parsetree.Pexp_letmodule
        ((copy_loc (function
             | None -> migration_error x0.loc Anonymous_let_module
             | Some x -> x) x0),
          (copy_module_expr x1), (copy_expression x2))
  | Ast_410.Parsetree.Pexp_letexception (x0, x1) ->
      Ast_409.Parsetree.Pexp_letexception
        ((copy_extension_constructor x0), (copy_expression x1))
  | Ast_410.Parsetree.Pexp_assert x0 ->
      Ast_409.Parsetree.Pexp_assert (copy_expression x0)
  | Ast_410.Parsetree.Pexp_lazy x0 ->
      Ast_409.Parsetree.Pexp_lazy (copy_expression x0)
  | Ast_410.Parsetree.Pexp_poly (x0, x1) ->
      Ast_409.Parsetree.Pexp_poly
        ((copy_expression x0), (map_option copy_core_type x1))
  | Ast_410.Parsetree.Pexp_object x0 ->
      Ast_409.Parsetree.Pexp_object (copy_class_structure x0)
  | Ast_410.Parsetree.Pexp_newtype (x0, x1) ->
      Ast_409.Parsetree.Pexp_newtype
        ((copy_loc (fun x -> x) x0), (copy_expression x1))
  | Ast_410.Parsetree.Pexp_pack x0 ->
      Ast_409.Parsetree.Pexp_pack (copy_module_expr x0)
  | Ast_410.Parsetree.Pexp_open (x0, x1) ->
      Ast_409.Parsetree.Pexp_open
        ((copy_open_declaration x0), (copy_expression x1))
  | Ast_410.Parsetree.Pexp_letop x0 ->
      Ast_409.Parsetree.Pexp_letop (copy_letop x0)
  | Ast_410.Parsetree.Pexp_extension x0 ->
      Ast_409.Parsetree.Pexp_extension (copy_extension x0)
  | Ast_410.Parsetree.Pexp_unreachable -> Ast_409.Parsetree.Pexp_unreachable
and copy_letop : Ast_410.Parsetree.letop -> Ast_409.Parsetree.letop =
  fun
    { Ast_410.Parsetree.let_ = let_; Ast_410.Parsetree.ands = ands;
      Ast_410.Parsetree.body = body }
    ->
    {
      Ast_409.Parsetree.let_ = (copy_binding_op let_);
      Ast_409.Parsetree.ands = (List.map copy_binding_op ands);
      Ast_409.Parsetree.body = (copy_expression body)
    }
and copy_binding_op :
  Ast_410.Parsetree.binding_op -> Ast_409.Parsetree.binding_op =
  fun
    { Ast_410.Parsetree.pbop_op = pbop_op;
      Ast_410.Parsetree.pbop_pat = pbop_pat;
      Ast_410.Parsetree.pbop_exp = pbop_exp;
      Ast_410.Parsetree.pbop_loc = pbop_loc }
    ->
    {
      Ast_409.Parsetree.pbop_op = (copy_loc (fun x -> x) pbop_op);
      Ast_409.Parsetree.pbop_pat = (copy_pattern pbop_pat);
      Ast_409.Parsetree.pbop_exp = (copy_expression pbop_exp);
      Ast_409.Parsetree.pbop_loc = (copy_location pbop_loc)
    }
and copy_direction_flag :
  Ast_410.Asttypes.direction_flag -> Ast_409.Asttypes.direction_flag =
  function
  | Ast_410.Asttypes.Upto -> Ast_409.Asttypes.Upto
  | Ast_410.Asttypes.Downto -> Ast_409.Asttypes.Downto
and copy_case : Ast_410.Parsetree.case -> Ast_409.Parsetree.case =
  fun
    { Ast_410.Parsetree.pc_lhs = pc_lhs;
      Ast_410.Parsetree.pc_guard = pc_guard;
      Ast_410.Parsetree.pc_rhs = pc_rhs }
    ->
    {
      Ast_409.Parsetree.pc_lhs = (copy_pattern pc_lhs);
      Ast_409.Parsetree.pc_guard = (map_option copy_expression pc_guard);
      Ast_409.Parsetree.pc_rhs = (copy_expression pc_rhs)
    }
and copy_cases : Ast_410.Parsetree.case list -> Ast_409.Parsetree.cases
  = fun x -> List.map copy_case x
and copy_value_binding :
  Ast_410.Parsetree.value_binding -> Ast_409.Parsetree.value_binding =
  fun
    { Ast_410.Parsetree.pvb_pat = pvb_pat;
      Ast_410.Parsetree.pvb_expr = pvb_expr;
      Ast_410.Parsetree.pvb_attributes = pvb_attributes;
      Ast_410.Parsetree.pvb_loc = pvb_loc }
    ->
    {
      Ast_409.Parsetree.pvb_pat = (copy_pattern pvb_pat);
      Ast_409.Parsetree.pvb_expr = (copy_expression pvb_expr);
      Ast_409.Parsetree.pvb_attributes = (copy_attributes pvb_attributes);
      Ast_409.Parsetree.pvb_loc = (copy_location pvb_loc)
    }
and copy_pattern : Ast_410.Parsetree.pattern -> Ast_409.Parsetree.pattern =
  fun
    { Ast_410.Parsetree.ppat_desc = ppat_desc;
      Ast_410.Parsetree.ppat_loc = ppat_loc;
      Ast_410.Parsetree.ppat_loc_stack = ppat_loc_stack;
      Ast_410.Parsetree.ppat_attributes = ppat_attributes }
    ->
    {
      Ast_409.Parsetree.ppat_desc = (copy_pattern_desc ppat_desc);
      Ast_409.Parsetree.ppat_loc = (copy_location ppat_loc);
      Ast_409.Parsetree.ppat_loc_stack = (copy_location_stack ppat_loc_stack);
      Ast_409.Parsetree.ppat_attributes = (copy_attributes ppat_attributes)
    }
and copy_pattern_desc :
  Ast_410.Parsetree.pattern_desc -> Ast_409.Parsetree.pattern_desc =
  function
  | Ast_410.Parsetree.Ppat_any -> Ast_409.Parsetree.Ppat_any
  | Ast_410.Parsetree.Ppat_var x0 ->
      Ast_409.Parsetree.Ppat_var (copy_loc (fun x -> x) x0)
  | Ast_410.Parsetree.Ppat_alias (x0, x1) ->
      Ast_409.Parsetree.Ppat_alias
        ((copy_pattern x0), (copy_loc (fun x -> x) x1))
  | Ast_410.Parsetree.Ppat_constant x0 ->
      Ast_409.Parsetree.Ppat_constant (copy_constant x0)
  | Ast_410.Parsetree.Ppat_interval (x0, x1) ->
      Ast_409.Parsetree.Ppat_interval
        ((copy_constant x0), (copy_constant x1))
  | Ast_410.Parsetree.Ppat_tuple x0 ->
      Ast_409.Parsetree.Ppat_tuple (List.map copy_pattern x0)
  | Ast_410.Parsetree.Ppat_construct (x0, x1) ->
      Ast_409.Parsetree.Ppat_construct
        ((copy_loc copy_Longident_t x0), (map_option copy_pattern x1))
  | Ast_410.Parsetree.Ppat_variant (x0, x1) ->
      Ast_409.Parsetree.Ppat_variant
        ((copy_label x0), (map_option copy_pattern x1))
  | Ast_410.Parsetree.Ppat_record (x0, x1) ->
      Ast_409.Parsetree.Ppat_record
        ((List.map
            (fun x ->
               let (x0, x1) = x in
               ((copy_loc copy_Longident_t x0), (copy_pattern x1))) x0),
          (copy_closed_flag x1))
  | Ast_410.Parsetree.Ppat_array x0 ->
      Ast_409.Parsetree.Ppat_array (List.map copy_pattern x0)
  | Ast_410.Parsetree.Ppat_or (x0, x1) ->
      Ast_409.Parsetree.Ppat_or ((copy_pattern x0), (copy_pattern x1))
  | Ast_410.Parsetree.Ppat_constraint (x0, x1) ->
      Ast_409.Parsetree.Ppat_constraint
        ((copy_pattern x0), (copy_core_type x1))
  | Ast_410.Parsetree.Ppat_type x0 ->
      Ast_409.Parsetree.Ppat_type (copy_loc copy_Longident_t x0)
  | Ast_410.Parsetree.Ppat_lazy x0 ->
      Ast_409.Parsetree.Ppat_lazy (copy_pattern x0)
  | Ast_410.Parsetree.Ppat_unpack x0 ->
      Ast_409.Parsetree.Ppat_unpack
        (copy_loc (function
             | None -> migration_error x0.loc Anonymous_unpack
             | Some x -> x) x0)
  | Ast_410.Parsetree.Ppat_exception x0 ->
      Ast_409.Parsetree.Ppat_exception (copy_pattern x0)
  | Ast_410.Parsetree.Ppat_extension x0 ->
      Ast_409.Parsetree.Ppat_extension (copy_extension x0)
  | Ast_410.Parsetree.Ppat_open (x0, x1) ->
      Ast_409.Parsetree.Ppat_open
        ((copy_loc copy_Longident_t x0), (copy_pattern x1))
and copy_core_type :
  Ast_410.Parsetree.core_type -> Ast_409.Parsetree.core_type =
  fun
    { Ast_410.Parsetree.ptyp_desc = ptyp_desc;
      Ast_410.Parsetree.ptyp_loc = ptyp_loc;
      Ast_410.Parsetree.ptyp_loc_stack = ptyp_loc_stack;
      Ast_410.Parsetree.ptyp_attributes = ptyp_attributes }
    ->
    {
      Ast_409.Parsetree.ptyp_desc = (copy_core_type_desc ptyp_desc);
      Ast_409.Parsetree.ptyp_loc = (copy_location ptyp_loc);
      Ast_409.Parsetree.ptyp_loc_stack = (copy_location_stack ptyp_loc_stack);
      Ast_409.Parsetree.ptyp_attributes = (copy_attributes ptyp_attributes)
    }
and copy_location_stack :
  Ast_410.Parsetree.location_stack -> Ast_409.Location.t list =
  fun x -> List.map copy_location x
and copy_core_type_desc :
  Ast_410.Parsetree.core_type_desc -> Ast_409.Parsetree.core_type_desc =
  function
  | Ast_410.Parsetree.Ptyp_any -> Ast_409.Parsetree.Ptyp_any
  | Ast_410.Parsetree.Ptyp_var x0 -> Ast_409.Parsetree.Ptyp_var x0
  | Ast_410.Parsetree.Ptyp_arrow (x0, x1, x2) ->
      Ast_409.Parsetree.Ptyp_arrow
        ((copy_arg_label x0), (copy_core_type x1), (copy_core_type x2))
  | Ast_410.Parsetree.Ptyp_tuple x0 ->
      Ast_409.Parsetree.Ptyp_tuple (List.map copy_core_type x0)
  | Ast_410.Parsetree.Ptyp_constr (x0, x1) ->
      Ast_409.Parsetree.Ptyp_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_410.Parsetree.Ptyp_object (x0, x1) ->
      Ast_409.Parsetree.Ptyp_object
        ((List.map copy_object_field x0), (copy_closed_flag x1))
  | Ast_410.Parsetree.Ptyp_class (x0, x1) ->
      Ast_409.Parsetree.Ptyp_class
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_410.Parsetree.Ptyp_alias (x0, x1) ->
      Ast_409.Parsetree.Ptyp_alias ((copy_core_type x0), x1)
  | Ast_410.Parsetree.Ptyp_variant (x0, x1, x2) ->
      Ast_409.Parsetree.Ptyp_variant
        ((List.map copy_row_field x0), (copy_closed_flag x1),
          (map_option (fun x -> List.map copy_label x) x2))
  | Ast_410.Parsetree.Ptyp_poly (x0, x1) ->
      Ast_409.Parsetree.Ptyp_poly
        ((List.map (fun x -> copy_loc (fun x -> x) x) x0),
          (copy_core_type x1))
  | Ast_410.Parsetree.Ptyp_package x0 ->
      Ast_409.Parsetree.Ptyp_package (copy_package_type x0)
  | Ast_410.Parsetree.Ptyp_extension x0 ->
      Ast_409.Parsetree.Ptyp_extension (copy_extension x0)
and copy_package_type :
  Ast_410.Parsetree.package_type -> Ast_409.Parsetree.package_type =
  fun x ->
    let (x0, x1) = x in
    ((copy_loc copy_Longident_t x0),
      (List.map
         (fun x ->
            let (x0, x1) = x in
            ((copy_loc copy_Longident_t x0), (copy_core_type x1))) x1))
and copy_row_field :
  Ast_410.Parsetree.row_field -> Ast_409.Parsetree.row_field =
  fun
    { Ast_410.Parsetree.prf_desc = prf_desc;
      Ast_410.Parsetree.prf_loc = prf_loc;
      Ast_410.Parsetree.prf_attributes = prf_attributes }
    ->
    {
      Ast_409.Parsetree.prf_desc = (copy_row_field_desc prf_desc);
      Ast_409.Parsetree.prf_loc = (copy_location prf_loc);
      Ast_409.Parsetree.prf_attributes = (copy_attributes prf_attributes)
    }
and copy_row_field_desc :
  Ast_410.Parsetree.row_field_desc -> Ast_409.Parsetree.row_field_desc =
  function
  | Ast_410.Parsetree.Rtag (x0, x1, x2) ->
      Ast_409.Parsetree.Rtag
        ((copy_loc copy_label x0), x1, (List.map copy_core_type x2))
  | Ast_410.Parsetree.Rinherit x0 ->
      Ast_409.Parsetree.Rinherit (copy_core_type x0)
and copy_object_field :
  Ast_410.Parsetree.object_field -> Ast_409.Parsetree.object_field =
  fun
    { Ast_410.Parsetree.pof_desc = pof_desc;
      Ast_410.Parsetree.pof_loc = pof_loc;
      Ast_410.Parsetree.pof_attributes = pof_attributes }
    ->
    {
      Ast_409.Parsetree.pof_desc = (copy_object_field_desc pof_desc);
      Ast_409.Parsetree.pof_loc = (copy_location pof_loc);
      Ast_409.Parsetree.pof_attributes = (copy_attributes pof_attributes)
    }
and copy_attributes :
  Ast_410.Parsetree.attributes -> Ast_409.Parsetree.attributes =
  fun x -> List.map copy_attribute x
and copy_attribute :
  Ast_410.Parsetree.attribute -> Ast_409.Parsetree.attribute =
  fun
    { Ast_410.Parsetree.attr_name = attr_name;
      Ast_410.Parsetree.attr_payload = attr_payload;
      Ast_410.Parsetree.attr_loc = attr_loc }
    ->
    {
      Ast_409.Parsetree.attr_name = (copy_loc (fun x -> x) attr_name);
      Ast_409.Parsetree.attr_payload = (copy_payload attr_payload);
      Ast_409.Parsetree.attr_loc = (copy_location attr_loc)
    }
and copy_payload : Ast_410.Parsetree.payload -> Ast_409.Parsetree.payload =
  function
  | Ast_410.Parsetree.PStr x0 -> Ast_409.Parsetree.PStr (copy_structure x0)
  | Ast_410.Parsetree.PSig x0 -> Ast_409.Parsetree.PSig (copy_signature x0)
  | Ast_410.Parsetree.PTyp x0 -> Ast_409.Parsetree.PTyp (copy_core_type x0)
  | Ast_410.Parsetree.PPat (x0, x1) ->
      Ast_409.Parsetree.PPat
        ((copy_pattern x0), (map_option copy_expression x1))
and copy_structure :
  Ast_410.Parsetree.structure -> Ast_409.Parsetree.structure =
  fun x -> List.map copy_structure_item x
and copy_structure_item :
  Ast_410.Parsetree.structure_item -> Ast_409.Parsetree.structure_item =
  fun
    { Ast_410.Parsetree.pstr_desc = pstr_desc;
      Ast_410.Parsetree.pstr_loc = pstr_loc }
    ->
    {
      Ast_409.Parsetree.pstr_desc = (copy_structure_item_desc pstr_desc);
      Ast_409.Parsetree.pstr_loc = (copy_location pstr_loc)
    }
and copy_structure_item_desc :
  Ast_410.Parsetree.structure_item_desc ->
    Ast_409.Parsetree.structure_item_desc
  =
  function
  | Ast_410.Parsetree.Pstr_eval (x0, x1) ->
      Ast_409.Parsetree.Pstr_eval
        ((copy_expression x0), (copy_attributes x1))
  | Ast_410.Parsetree.Pstr_value (x0, x1) ->
      Ast_409.Parsetree.Pstr_value
        ((copy_rec_flag x0), (List.map copy_value_binding x1))
  | Ast_410.Parsetree.Pstr_primitive x0 ->
      Ast_409.Parsetree.Pstr_primitive (copy_value_description x0)
  | Ast_410.Parsetree.Pstr_type (x0, x1) ->
      Ast_409.Parsetree.Pstr_type
        ((copy_rec_flag x0), (List.map copy_type_declaration x1))
  | Ast_410.Parsetree.Pstr_typext x0 ->
      Ast_409.Parsetree.Pstr_typext (copy_type_extension x0)
  | Ast_410.Parsetree.Pstr_exception x0 ->
      Ast_409.Parsetree.Pstr_exception (copy_type_exception x0)
  | Ast_410.Parsetree.Pstr_module x0 ->
      Ast_409.Parsetree.Pstr_module (copy_module_binding x0)
  | Ast_410.Parsetree.Pstr_recmodule x0 ->
      Ast_409.Parsetree.Pstr_recmodule (List.map copy_module_binding x0)
  | Ast_410.Parsetree.Pstr_modtype x0 ->
      Ast_409.Parsetree.Pstr_modtype (copy_module_type_declaration x0)
  | Ast_410.Parsetree.Pstr_open x0 ->
      Ast_409.Parsetree.Pstr_open (copy_open_declaration x0)
  | Ast_410.Parsetree.Pstr_class x0 ->
      Ast_409.Parsetree.Pstr_class (List.map copy_class_declaration x0)
  | Ast_410.Parsetree.Pstr_class_type x0 ->
      Ast_409.Parsetree.Pstr_class_type
        (List.map copy_class_type_declaration x0)
  | Ast_410.Parsetree.Pstr_include x0 ->
      Ast_409.Parsetree.Pstr_include (copy_include_declaration x0)
  | Ast_410.Parsetree.Pstr_attribute x0 ->
      Ast_409.Parsetree.Pstr_attribute (copy_attribute x0)
  | Ast_410.Parsetree.Pstr_extension (x0, x1) ->
      Ast_409.Parsetree.Pstr_extension
        ((copy_extension x0), (copy_attributes x1))
and copy_include_declaration :
  Ast_410.Parsetree.include_declaration ->
    Ast_409.Parsetree.include_declaration
  = fun x -> copy_include_infos copy_module_expr x
and copy_class_declaration :
  Ast_410.Parsetree.class_declaration -> Ast_409.Parsetree.class_declaration
  = fun x -> copy_class_infos copy_class_expr x
and copy_class_expr :
  Ast_410.Parsetree.class_expr -> Ast_409.Parsetree.class_expr =
  fun
    { Ast_410.Parsetree.pcl_desc = pcl_desc;
      Ast_410.Parsetree.pcl_loc = pcl_loc;
      Ast_410.Parsetree.pcl_attributes = pcl_attributes }
    ->
    {
      Ast_409.Parsetree.pcl_desc = (copy_class_expr_desc pcl_desc);
      Ast_409.Parsetree.pcl_loc = (copy_location pcl_loc);
      Ast_409.Parsetree.pcl_attributes = (copy_attributes pcl_attributes)
    }
and copy_class_expr_desc :
  Ast_410.Parsetree.class_expr_desc -> Ast_409.Parsetree.class_expr_desc =
  function
  | Ast_410.Parsetree.Pcl_constr (x0, x1) ->
      Ast_409.Parsetree.Pcl_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_410.Parsetree.Pcl_structure x0 ->
      Ast_409.Parsetree.Pcl_structure (copy_class_structure x0)
  | Ast_410.Parsetree.Pcl_fun (x0, x1, x2, x3) ->
      Ast_409.Parsetree.Pcl_fun
        ((copy_arg_label x0), (map_option copy_expression x1),
          (copy_pattern x2), (copy_class_expr x3))
  | Ast_410.Parsetree.Pcl_apply (x0, x1) ->
      Ast_409.Parsetree.Pcl_apply
        ((copy_class_expr x0),
          (List.map
             (fun x ->
                let (x0, x1) = x in
                ((copy_arg_label x0), (copy_expression x1))) x1))
  | Ast_410.Parsetree.Pcl_let (x0, x1, x2) ->
      Ast_409.Parsetree.Pcl_let
        ((copy_rec_flag x0), (List.map copy_value_binding x1),
          (copy_class_expr x2))
  | Ast_410.Parsetree.Pcl_constraint (x0, x1) ->
      Ast_409.Parsetree.Pcl_constraint
        ((copy_class_expr x0), (copy_class_type x1))
  | Ast_410.Parsetree.Pcl_extension x0 ->
      Ast_409.Parsetree.Pcl_extension (copy_extension x0)
  | Ast_410.Parsetree.Pcl_open (x0, x1) ->
      Ast_409.Parsetree.Pcl_open
        ((copy_open_description x0), (copy_class_expr x1))
and copy_class_structure :
  Ast_410.Parsetree.class_structure -> Ast_409.Parsetree.class_structure =
  fun
    { Ast_410.Parsetree.pcstr_self = pcstr_self;
      Ast_410.Parsetree.pcstr_fields = pcstr_fields }
    ->
    {
      Ast_409.Parsetree.pcstr_self = (copy_pattern pcstr_self);
      Ast_409.Parsetree.pcstr_fields =
        (List.map copy_class_field pcstr_fields)
    }
and copy_class_field :
  Ast_410.Parsetree.class_field -> Ast_409.Parsetree.class_field =
  fun
    { Ast_410.Parsetree.pcf_desc = pcf_desc;
      Ast_410.Parsetree.pcf_loc = pcf_loc;
      Ast_410.Parsetree.pcf_attributes = pcf_attributes }
    ->
    {
      Ast_409.Parsetree.pcf_desc = (copy_class_field_desc pcf_desc);
      Ast_409.Parsetree.pcf_loc = (copy_location pcf_loc);
      Ast_409.Parsetree.pcf_attributes = (copy_attributes pcf_attributes)
    }
and copy_class_field_desc :
  Ast_410.Parsetree.class_field_desc -> Ast_409.Parsetree.class_field_desc =
  function
  | Ast_410.Parsetree.Pcf_inherit (x0, x1, x2) ->
      Ast_409.Parsetree.Pcf_inherit
        ((copy_override_flag x0), (copy_class_expr x1),
          (map_option (fun x -> copy_loc (fun x -> x) x) x2))
  | Ast_410.Parsetree.Pcf_val x0 ->
      Ast_409.Parsetree.Pcf_val
        (let (x0, x1, x2) = x0 in
         ((copy_loc copy_label x0), (copy_mutable_flag x1),
           (copy_class_field_kind x2)))
  | Ast_410.Parsetree.Pcf_method x0 ->
      Ast_409.Parsetree.Pcf_method
        (let (x0, x1, x2) = x0 in
         ((copy_loc copy_label x0), (copy_private_flag x1),
           (copy_class_field_kind x2)))
  | Ast_410.Parsetree.Pcf_constraint x0 ->
      Ast_409.Parsetree.Pcf_constraint
        (let (x0, x1) = x0 in ((copy_core_type x0), (copy_core_type x1)))
  | Ast_410.Parsetree.Pcf_initializer x0 ->
      Ast_409.Parsetree.Pcf_initializer (copy_expression x0)
  | Ast_410.Parsetree.Pcf_attribute x0 ->
      Ast_409.Parsetree.Pcf_attribute (copy_attribute x0)
  | Ast_410.Parsetree.Pcf_extension x0 ->
      Ast_409.Parsetree.Pcf_extension (copy_extension x0)
and copy_class_field_kind :
  Ast_410.Parsetree.class_field_kind -> Ast_409.Parsetree.class_field_kind =
  function
  | Ast_410.Parsetree.Cfk_virtual x0 ->
      Ast_409.Parsetree.Cfk_virtual (copy_core_type x0)
  | Ast_410.Parsetree.Cfk_concrete (x0, x1) ->
      Ast_409.Parsetree.Cfk_concrete
        ((copy_override_flag x0), (copy_expression x1))
and copy_open_declaration :
  Ast_410.Parsetree.open_declaration -> Ast_409.Parsetree.open_declaration =
  fun x -> copy_open_infos copy_module_expr x
and copy_module_binding :
  Ast_410.Parsetree.module_binding -> Ast_409.Parsetree.module_binding =
  fun
    { Ast_410.Parsetree.pmb_name = pmb_name;
      Ast_410.Parsetree.pmb_expr = pmb_expr;
      Ast_410.Parsetree.pmb_attributes = pmb_attributes;
      Ast_410.Parsetree.pmb_loc = pmb_loc }
    ->
    {
      Ast_409.Parsetree.pmb_name =
        (copy_loc (function Some x -> x
                          | None -> migration_error pmb_name.loc Anonymous_module_binding) pmb_name);
      Ast_409.Parsetree.pmb_expr = (copy_module_expr pmb_expr);
      Ast_409.Parsetree.pmb_attributes = (copy_attributes pmb_attributes);
      Ast_409.Parsetree.pmb_loc = (copy_location pmb_loc)
    }
and copy_module_expr :
  Ast_410.Parsetree.module_expr -> Ast_409.Parsetree.module_expr =
  fun
    { Ast_410.Parsetree.pmod_desc = pmod_desc;
      Ast_410.Parsetree.pmod_loc = pmod_loc;
      Ast_410.Parsetree.pmod_attributes = pmod_attributes }
    ->
    {
      Ast_409.Parsetree.pmod_desc = (copy_module_expr_desc pmod_desc);
      Ast_409.Parsetree.pmod_loc = (copy_location pmod_loc);
      Ast_409.Parsetree.pmod_attributes = (copy_attributes pmod_attributes)
    }
and copy_module_expr_desc :
  Ast_410.Parsetree.module_expr_desc -> Ast_409.Parsetree.module_expr_desc =
  function
  | Ast_410.Parsetree.Pmod_ident x0 ->
      Ast_409.Parsetree.Pmod_ident (copy_loc copy_Longident_t x0)
  | Ast_410.Parsetree.Pmod_structure x0 ->
      Ast_409.Parsetree.Pmod_structure (copy_structure x0)
  | Ast_410.Parsetree.Pmod_functor (x0, x1) ->
      let x, y = copy_functor_parameter x0 in
      Ast_409.Parsetree.Pmod_functor
        (x, y, (copy_module_expr x1))
  | Ast_410.Parsetree.Pmod_apply (x0, x1) ->
      Ast_409.Parsetree.Pmod_apply
        ((copy_module_expr x0), (copy_module_expr x1))
  | Ast_410.Parsetree.Pmod_constraint (x0, x1) ->
      Ast_409.Parsetree.Pmod_constraint
        ((copy_module_expr x0), (copy_module_type x1))
  | Ast_410.Parsetree.Pmod_unpack x0 ->
      Ast_409.Parsetree.Pmod_unpack (copy_expression x0)
  | Ast_410.Parsetree.Pmod_extension x0 ->
      Ast_409.Parsetree.Pmod_extension (copy_extension x0)
and copy_functor_parameter :
  Ast_410.Parsetree.functor_parameter -> string Ast_409.Asttypes.loc * Ast_409.Parsetree.module_type option
  =
  function
  | Ast_410.Parsetree.Unit -> ({ loc = Location.none; txt = "*" }, None)
  | Ast_410.Parsetree.Named (x0, x1) ->
        ((copy_loc (function
             | None -> "_"
             | Some x -> x) x0,
          Some (copy_module_type x1)))
and copy_module_type :
  Ast_410.Parsetree.module_type -> Ast_409.Parsetree.module_type =
  fun
    { Ast_410.Parsetree.pmty_desc = pmty_desc;
      Ast_410.Parsetree.pmty_loc = pmty_loc;
      Ast_410.Parsetree.pmty_attributes = pmty_attributes }
    ->
    {
      Ast_409.Parsetree.pmty_desc = (copy_module_type_desc pmty_desc);
      Ast_409.Parsetree.pmty_loc = (copy_location pmty_loc);
      Ast_409.Parsetree.pmty_attributes = (copy_attributes pmty_attributes)
    }
and copy_module_type_desc :
  Ast_410.Parsetree.module_type_desc -> Ast_409.Parsetree.module_type_desc =
  function
  | Ast_410.Parsetree.Pmty_ident x0 ->
      Ast_409.Parsetree.Pmty_ident (copy_loc copy_Longident_t x0)
  | Ast_410.Parsetree.Pmty_signature x0 ->
      Ast_409.Parsetree.Pmty_signature (copy_signature x0)
  | Ast_410.Parsetree.Pmty_functor (x0, x1) ->
      let x, y = copy_functor_parameter x0 in
      Ast_409.Parsetree.Pmty_functor
        (x, y, (copy_module_type x1))
  | Ast_410.Parsetree.Pmty_with (x0, x1) ->
      Ast_409.Parsetree.Pmty_with
        ((copy_module_type x0), (List.map copy_with_constraint x1))
  | Ast_410.Parsetree.Pmty_typeof x0 ->
      Ast_409.Parsetree.Pmty_typeof (copy_module_expr x0)
  | Ast_410.Parsetree.Pmty_extension x0 ->
      Ast_409.Parsetree.Pmty_extension (copy_extension x0)
  | Ast_410.Parsetree.Pmty_alias x0 ->
      Ast_409.Parsetree.Pmty_alias (copy_loc copy_Longident_t x0)
and copy_with_constraint :
  Ast_410.Parsetree.with_constraint -> Ast_409.Parsetree.with_constraint =
  function
  | Ast_410.Parsetree.Pwith_type (x0, x1) ->
      Ast_409.Parsetree.Pwith_type
        ((copy_loc copy_Longident_t x0), (copy_type_declaration x1))
  | Ast_410.Parsetree.Pwith_module (x0, x1) ->
      Ast_409.Parsetree.Pwith_module
        ((copy_loc copy_Longident_t x0), (copy_loc copy_Longident_t x1))
  | Ast_410.Parsetree.Pwith_typesubst (x0, x1) ->
      Ast_409.Parsetree.Pwith_typesubst
        ((copy_loc copy_Longident_t x0), (copy_type_declaration x1))
  | Ast_410.Parsetree.Pwith_modsubst (x0, x1) ->
      Ast_409.Parsetree.Pwith_modsubst
        ((copy_loc copy_Longident_t x0), (copy_loc copy_Longident_t x1))
and copy_signature :
  Ast_410.Parsetree.signature -> Ast_409.Parsetree.signature =
  fun x -> List.map copy_signature_item x
and copy_signature_item :
  Ast_410.Parsetree.signature_item -> Ast_409.Parsetree.signature_item =
  fun
    { Ast_410.Parsetree.psig_desc = psig_desc;
      Ast_410.Parsetree.psig_loc = psig_loc }
    ->
    {
      Ast_409.Parsetree.psig_desc = (copy_signature_item_desc psig_desc);
      Ast_409.Parsetree.psig_loc = (copy_location psig_loc)
    }
and copy_signature_item_desc :
  Ast_410.Parsetree.signature_item_desc ->
    Ast_409.Parsetree.signature_item_desc
  =
  function
  | Ast_410.Parsetree.Psig_value x0 ->
      Ast_409.Parsetree.Psig_value (copy_value_description x0)
  | Ast_410.Parsetree.Psig_type (x0, x1) ->
      Ast_409.Parsetree.Psig_type
        ((copy_rec_flag x0), (List.map copy_type_declaration x1))
  | Ast_410.Parsetree.Psig_typesubst x0 ->
      Ast_409.Parsetree.Psig_typesubst (List.map copy_type_declaration x0)
  | Ast_410.Parsetree.Psig_typext x0 ->
      Ast_409.Parsetree.Psig_typext (copy_type_extension x0)
  | Ast_410.Parsetree.Psig_exception x0 ->
      Ast_409.Parsetree.Psig_exception (copy_type_exception x0)
  | Ast_410.Parsetree.Psig_module x0 ->
      Ast_409.Parsetree.Psig_module (copy_module_declaration x0)
  | Ast_410.Parsetree.Psig_modsubst x0 ->
      Ast_409.Parsetree.Psig_modsubst (copy_module_substitution x0)
  | Ast_410.Parsetree.Psig_recmodule x0 ->
      Ast_409.Parsetree.Psig_recmodule (List.map copy_module_declaration x0)
  | Ast_410.Parsetree.Psig_modtype x0 ->
      Ast_409.Parsetree.Psig_modtype (copy_module_type_declaration x0)
  | Ast_410.Parsetree.Psig_open x0 ->
      Ast_409.Parsetree.Psig_open (copy_open_description x0)
  | Ast_410.Parsetree.Psig_include x0 ->
      Ast_409.Parsetree.Psig_include (copy_include_description x0)
  | Ast_410.Parsetree.Psig_class x0 ->
      Ast_409.Parsetree.Psig_class (List.map copy_class_description x0)
  | Ast_410.Parsetree.Psig_class_type x0 ->
      Ast_409.Parsetree.Psig_class_type
        (List.map copy_class_type_declaration x0)
  | Ast_410.Parsetree.Psig_attribute x0 ->
      Ast_409.Parsetree.Psig_attribute (copy_attribute x0)
  | Ast_410.Parsetree.Psig_extension (x0, x1) ->
      Ast_409.Parsetree.Psig_extension
        ((copy_extension x0), (copy_attributes x1))
and copy_class_type_declaration :
  Ast_410.Parsetree.class_type_declaration ->
    Ast_409.Parsetree.class_type_declaration
  = fun x -> copy_class_infos copy_class_type x
and copy_class_description :
  Ast_410.Parsetree.class_description -> Ast_409.Parsetree.class_description
  = fun x -> copy_class_infos copy_class_type x
and copy_class_type :
  Ast_410.Parsetree.class_type -> Ast_409.Parsetree.class_type =
  fun
    { Ast_410.Parsetree.pcty_desc = pcty_desc;
      Ast_410.Parsetree.pcty_loc = pcty_loc;
      Ast_410.Parsetree.pcty_attributes = pcty_attributes }
    ->
    {
      Ast_409.Parsetree.pcty_desc = (copy_class_type_desc pcty_desc);
      Ast_409.Parsetree.pcty_loc = (copy_location pcty_loc);
      Ast_409.Parsetree.pcty_attributes = (copy_attributes pcty_attributes)
    }
and copy_class_type_desc :
  Ast_410.Parsetree.class_type_desc -> Ast_409.Parsetree.class_type_desc =
  function
  | Ast_410.Parsetree.Pcty_constr (x0, x1) ->
      Ast_409.Parsetree.Pcty_constr
        ((copy_loc copy_Longident_t x0), (List.map copy_core_type x1))
  | Ast_410.Parsetree.Pcty_signature x0 ->
      Ast_409.Parsetree.Pcty_signature (copy_class_signature x0)
  | Ast_410.Parsetree.Pcty_arrow (x0, x1, x2) ->
      Ast_409.Parsetree.Pcty_arrow
        ((copy_arg_label x0), (copy_core_type x1), (copy_class_type x2))
  | Ast_410.Parsetree.Pcty_extension x0 ->
      Ast_409.Parsetree.Pcty_extension (copy_extension x0)
  | Ast_410.Parsetree.Pcty_open (x0, x1) ->
      Ast_409.Parsetree.Pcty_open
        ((copy_open_description x0), (copy_class_type x1))
and copy_class_signature :
  Ast_410.Parsetree.class_signature -> Ast_409.Parsetree.class_signature =
  fun
    { Ast_410.Parsetree.pcsig_self = pcsig_self;
      Ast_410.Parsetree.pcsig_fields = pcsig_fields }
    ->
    {
      Ast_409.Parsetree.pcsig_self = (copy_core_type pcsig_self);
      Ast_409.Parsetree.pcsig_fields =
        (List.map copy_class_type_field pcsig_fields)
    }
and copy_class_type_field :
  Ast_410.Parsetree.class_type_field -> Ast_409.Parsetree.class_type_field =
  fun
    { Ast_410.Parsetree.pctf_desc = pctf_desc;
      Ast_410.Parsetree.pctf_loc = pctf_loc;
      Ast_410.Parsetree.pctf_attributes = pctf_attributes }
    ->
    {
      Ast_409.Parsetree.pctf_desc = (copy_class_type_field_desc pctf_desc);
      Ast_409.Parsetree.pctf_loc = (copy_location pctf_loc);
      Ast_409.Parsetree.pctf_attributes = (copy_attributes pctf_attributes)
    }
and copy_class_type_field_desc :
  Ast_410.Parsetree.class_type_field_desc ->
    Ast_409.Parsetree.class_type_field_desc
  =
  function
  | Ast_410.Parsetree.Pctf_inherit x0 ->
      Ast_409.Parsetree.Pctf_inherit (copy_class_type x0)
  | Ast_410.Parsetree.Pctf_val x0 ->
      Ast_409.Parsetree.Pctf_val
        (let (x0, x1, x2, x3) = x0 in
         ((copy_loc copy_label x0), (copy_mutable_flag x1),
           (copy_virtual_flag x2), (copy_core_type x3)))
  | Ast_410.Parsetree.Pctf_method x0 ->
      Ast_409.Parsetree.Pctf_method
        (let (x0, x1, x2, x3) = x0 in
         ((copy_loc copy_label x0), (copy_private_flag x1),
           (copy_virtual_flag x2), (copy_core_type x3)))
  | Ast_410.Parsetree.Pctf_constraint x0 ->
      Ast_409.Parsetree.Pctf_constraint
        (let (x0, x1) = x0 in ((copy_core_type x0), (copy_core_type x1)))
  | Ast_410.Parsetree.Pctf_attribute x0 ->
      Ast_409.Parsetree.Pctf_attribute (copy_attribute x0)
  | Ast_410.Parsetree.Pctf_extension x0 ->
      Ast_409.Parsetree.Pctf_extension (copy_extension x0)
and copy_extension :
  Ast_410.Parsetree.extension -> Ast_409.Parsetree.extension =
  fun x ->
    let (x0, x1) = x in ((copy_loc (fun x -> x) x0), (copy_payload x1))
and copy_class_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_410.Parsetree.class_infos -> 'g0 Ast_409.Parsetree.class_infos
  =
  fun f0 ->
    fun
      { Ast_410.Parsetree.pci_virt = pci_virt;
        Ast_410.Parsetree.pci_params = pci_params;
        Ast_410.Parsetree.pci_name = pci_name;
        Ast_410.Parsetree.pci_expr = pci_expr;
        Ast_410.Parsetree.pci_loc = pci_loc;
        Ast_410.Parsetree.pci_attributes = pci_attributes }
      ->
      {
        Ast_409.Parsetree.pci_virt = (copy_virtual_flag pci_virt);
        Ast_409.Parsetree.pci_params =
          (List.map
             (fun x ->
                let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
             pci_params);
        Ast_409.Parsetree.pci_name = (copy_loc (fun x -> x) pci_name);
        Ast_409.Parsetree.pci_expr = (f0 pci_expr);
        Ast_409.Parsetree.pci_loc = (copy_location pci_loc);
        Ast_409.Parsetree.pci_attributes = (copy_attributes pci_attributes)
      }
and copy_virtual_flag :
  Ast_410.Asttypes.virtual_flag -> Ast_409.Asttypes.virtual_flag =
  function
  | Ast_410.Asttypes.Virtual -> Ast_409.Asttypes.Virtual
  | Ast_410.Asttypes.Concrete -> Ast_409.Asttypes.Concrete
and copy_include_description :
  Ast_410.Parsetree.include_description ->
    Ast_409.Parsetree.include_description
  = fun x -> copy_include_infos copy_module_type x
and copy_include_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_410.Parsetree.include_infos ->
        'g0 Ast_409.Parsetree.include_infos
  =
  fun f0 ->
    fun
      { Ast_410.Parsetree.pincl_mod = pincl_mod;
        Ast_410.Parsetree.pincl_loc = pincl_loc;
        Ast_410.Parsetree.pincl_attributes = pincl_attributes }
      ->
      {
        Ast_409.Parsetree.pincl_mod = (f0 pincl_mod);
        Ast_409.Parsetree.pincl_loc = (copy_location pincl_loc);
        Ast_409.Parsetree.pincl_attributes =
          (copy_attributes pincl_attributes)
      }
and copy_open_description :
  Ast_410.Parsetree.open_description -> Ast_409.Parsetree.open_description =
  fun x -> copy_open_infos (fun x -> copy_loc copy_Longident_t x) x
and copy_open_infos :
  'f0 'g0 .
    ('f0 -> 'g0) ->
      'f0 Ast_410.Parsetree.open_infos -> 'g0 Ast_409.Parsetree.open_infos
  =
  fun f0 ->
    fun
      { Ast_410.Parsetree.popen_expr = popen_expr;
        Ast_410.Parsetree.popen_override = popen_override;
        Ast_410.Parsetree.popen_loc = popen_loc;
        Ast_410.Parsetree.popen_attributes = popen_attributes }
      ->
      {
        Ast_409.Parsetree.popen_expr = (f0 popen_expr);
        Ast_409.Parsetree.popen_override =
          (copy_override_flag popen_override);
        Ast_409.Parsetree.popen_loc = (copy_location popen_loc);
        Ast_409.Parsetree.popen_attributes =
          (copy_attributes popen_attributes)
      }
and copy_override_flag :
  Ast_410.Asttypes.override_flag -> Ast_409.Asttypes.override_flag =
  function
  | Ast_410.Asttypes.Override -> Ast_409.Asttypes.Override
  | Ast_410.Asttypes.Fresh -> Ast_409.Asttypes.Fresh
and copy_module_type_declaration :
  Ast_410.Parsetree.module_type_declaration ->
    Ast_409.Parsetree.module_type_declaration
  =
  fun
    { Ast_410.Parsetree.pmtd_name = pmtd_name;
      Ast_410.Parsetree.pmtd_type = pmtd_type;
      Ast_410.Parsetree.pmtd_attributes = pmtd_attributes;
      Ast_410.Parsetree.pmtd_loc = pmtd_loc }
    ->
    {
      Ast_409.Parsetree.pmtd_name = (copy_loc (fun x -> x) pmtd_name);
      Ast_409.Parsetree.pmtd_type = (map_option copy_module_type pmtd_type);
      Ast_409.Parsetree.pmtd_attributes = (copy_attributes pmtd_attributes);
      Ast_409.Parsetree.pmtd_loc = (copy_location pmtd_loc)
    }
and copy_module_substitution :
  Ast_410.Parsetree.module_substitution ->
    Ast_409.Parsetree.module_substitution
  =
  fun
    { Ast_410.Parsetree.pms_name = pms_name;
      Ast_410.Parsetree.pms_manifest = pms_manifest;
      Ast_410.Parsetree.pms_attributes = pms_attributes;
      Ast_410.Parsetree.pms_loc = pms_loc }
    ->
    {
      Ast_409.Parsetree.pms_name = (copy_loc (fun x -> x) pms_name);
      Ast_409.Parsetree.pms_manifest =
        (copy_loc copy_Longident_t pms_manifest);
      Ast_409.Parsetree.pms_attributes = (copy_attributes pms_attributes);
      Ast_409.Parsetree.pms_loc = (copy_location pms_loc)
    }
and copy_module_declaration :
  Ast_410.Parsetree.module_declaration ->
    Ast_409.Parsetree.module_declaration
  =
  fun
    { Ast_410.Parsetree.pmd_name = pmd_name;
      Ast_410.Parsetree.pmd_type = pmd_type;
      Ast_410.Parsetree.pmd_attributes = pmd_attributes;
      Ast_410.Parsetree.pmd_loc = pmd_loc }
    ->
    {
      Ast_409.Parsetree.pmd_name =
        (copy_loc (function
             | None -> migration_error pmd_name.loc Anonymous_module_declaration
             | Some x -> x) pmd_name);
      Ast_409.Parsetree.pmd_type = (copy_module_type pmd_type);
      Ast_409.Parsetree.pmd_attributes = (copy_attributes pmd_attributes);
      Ast_409.Parsetree.pmd_loc = (copy_location pmd_loc)
    }
and copy_type_exception :
  Ast_410.Parsetree.type_exception -> Ast_409.Parsetree.type_exception =
  fun
    { Ast_410.Parsetree.ptyexn_constructor = ptyexn_constructor;
      Ast_410.Parsetree.ptyexn_loc = ptyexn_loc;
      Ast_410.Parsetree.ptyexn_attributes = ptyexn_attributes }
    ->
    {
      Ast_409.Parsetree.ptyexn_constructor =
        (copy_extension_constructor ptyexn_constructor);
      Ast_409.Parsetree.ptyexn_loc = (copy_location ptyexn_loc);
      Ast_409.Parsetree.ptyexn_attributes =
        (copy_attributes ptyexn_attributes)
    }
and copy_type_extension :
  Ast_410.Parsetree.type_extension -> Ast_409.Parsetree.type_extension =
  fun
    { Ast_410.Parsetree.ptyext_path = ptyext_path;
      Ast_410.Parsetree.ptyext_params = ptyext_params;
      Ast_410.Parsetree.ptyext_constructors = ptyext_constructors;
      Ast_410.Parsetree.ptyext_private = ptyext_private;
      Ast_410.Parsetree.ptyext_loc = ptyext_loc;
      Ast_410.Parsetree.ptyext_attributes = ptyext_attributes }
    ->
    {
      Ast_409.Parsetree.ptyext_path = (copy_loc copy_Longident_t ptyext_path);
      Ast_409.Parsetree.ptyext_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
           ptyext_params);
      Ast_409.Parsetree.ptyext_constructors =
        (List.map copy_extension_constructor ptyext_constructors);
      Ast_409.Parsetree.ptyext_private = (copy_private_flag ptyext_private);
      Ast_409.Parsetree.ptyext_loc = (copy_location ptyext_loc);
      Ast_409.Parsetree.ptyext_attributes =
        (copy_attributes ptyext_attributes)
    }
and copy_extension_constructor :
  Ast_410.Parsetree.extension_constructor ->
    Ast_409.Parsetree.extension_constructor
  =
  fun
    { Ast_410.Parsetree.pext_name = pext_name;
      Ast_410.Parsetree.pext_kind = pext_kind;
      Ast_410.Parsetree.pext_loc = pext_loc;
      Ast_410.Parsetree.pext_attributes = pext_attributes }
    ->
    {
      Ast_409.Parsetree.pext_name = (copy_loc (fun x -> x) pext_name);
      Ast_409.Parsetree.pext_kind =
        (copy_extension_constructor_kind pext_kind);
      Ast_409.Parsetree.pext_loc = (copy_location pext_loc);
      Ast_409.Parsetree.pext_attributes = (copy_attributes pext_attributes)
    }
and copy_extension_constructor_kind :
  Ast_410.Parsetree.extension_constructor_kind ->
    Ast_409.Parsetree.extension_constructor_kind
  =
  function
  | Ast_410.Parsetree.Pext_decl (x0, x1) ->
      Ast_409.Parsetree.Pext_decl
        ((copy_constructor_arguments x0), (map_option copy_core_type x1))
  | Ast_410.Parsetree.Pext_rebind x0 ->
      Ast_409.Parsetree.Pext_rebind (copy_loc copy_Longident_t x0)
and copy_type_declaration :
  Ast_410.Parsetree.type_declaration -> Ast_409.Parsetree.type_declaration =
  fun
    { Ast_410.Parsetree.ptype_name = ptype_name;
      Ast_410.Parsetree.ptype_params = ptype_params;
      Ast_410.Parsetree.ptype_cstrs = ptype_cstrs;
      Ast_410.Parsetree.ptype_kind = ptype_kind;
      Ast_410.Parsetree.ptype_private = ptype_private;
      Ast_410.Parsetree.ptype_manifest = ptype_manifest;
      Ast_410.Parsetree.ptype_attributes = ptype_attributes;
      Ast_410.Parsetree.ptype_loc = ptype_loc }
    ->
    {
      Ast_409.Parsetree.ptype_name = (copy_loc (fun x -> x) ptype_name);
      Ast_409.Parsetree.ptype_params =
        (List.map
           (fun x ->
              let (x0, x1) = x in ((copy_core_type x0), (copy_variance x1)))
           ptype_params);
      Ast_409.Parsetree.ptype_cstrs =
        (List.map
           (fun x ->
              let (x0, x1, x2) = x in
              ((copy_core_type x0), (copy_core_type x1), (copy_location x2)))
           ptype_cstrs);
      Ast_409.Parsetree.ptype_kind = (copy_type_kind ptype_kind);
      Ast_409.Parsetree.ptype_private = (copy_private_flag ptype_private);
      Ast_409.Parsetree.ptype_manifest =
        (map_option copy_core_type ptype_manifest);
      Ast_409.Parsetree.ptype_attributes = (copy_attributes ptype_attributes);
      Ast_409.Parsetree.ptype_loc = (copy_location ptype_loc)
    }
and copy_private_flag :
  Ast_410.Asttypes.private_flag -> Ast_409.Asttypes.private_flag =
  function
  | Ast_410.Asttypes.Private -> Ast_409.Asttypes.Private
  | Ast_410.Asttypes.Public -> Ast_409.Asttypes.Public
and copy_type_kind :
  Ast_410.Parsetree.type_kind -> Ast_409.Parsetree.type_kind =
  function
  | Ast_410.Parsetree.Ptype_abstract -> Ast_409.Parsetree.Ptype_abstract
  | Ast_410.Parsetree.Ptype_variant x0 ->
      Ast_409.Parsetree.Ptype_variant
        (List.map copy_constructor_declaration x0)
  | Ast_410.Parsetree.Ptype_record x0 ->
      Ast_409.Parsetree.Ptype_record (List.map copy_label_declaration x0)
  | Ast_410.Parsetree.Ptype_open -> Ast_409.Parsetree.Ptype_open
and copy_constructor_declaration :
  Ast_410.Parsetree.constructor_declaration ->
    Ast_409.Parsetree.constructor_declaration
  =
  fun
    { Ast_410.Parsetree.pcd_name = pcd_name;
      Ast_410.Parsetree.pcd_args = pcd_args;
      Ast_410.Parsetree.pcd_res = pcd_res;
      Ast_410.Parsetree.pcd_loc = pcd_loc;
      Ast_410.Parsetree.pcd_attributes = pcd_attributes }
    ->
    {
      Ast_409.Parsetree.pcd_name = (copy_loc (fun x -> x) pcd_name);
      Ast_409.Parsetree.pcd_args = (copy_constructor_arguments pcd_args);
      Ast_409.Parsetree.pcd_res = (map_option copy_core_type pcd_res);
      Ast_409.Parsetree.pcd_loc = (copy_location pcd_loc);
      Ast_409.Parsetree.pcd_attributes = (copy_attributes pcd_attributes)
    }
and copy_constructor_arguments :
  Ast_410.Parsetree.constructor_arguments ->
    Ast_409.Parsetree.constructor_arguments
  =
  function
  | Ast_410.Parsetree.Pcstr_tuple x0 ->
      Ast_409.Parsetree.Pcstr_tuple (List.map copy_core_type x0)
  | Ast_410.Parsetree.Pcstr_record x0 ->
      Ast_409.Parsetree.Pcstr_record (List.map copy_label_declaration x0)
and copy_label_declaration :
  Ast_410.Parsetree.label_declaration -> Ast_409.Parsetree.label_declaration
  =
  fun
    { Ast_410.Parsetree.pld_name = pld_name;
      Ast_410.Parsetree.pld_mutable = pld_mutable;
      Ast_410.Parsetree.pld_type = pld_type;
      Ast_410.Parsetree.pld_loc = pld_loc;
      Ast_410.Parsetree.pld_attributes = pld_attributes }
    ->
    {
      Ast_409.Parsetree.pld_name = (copy_loc (fun x -> x) pld_name);
      Ast_409.Parsetree.pld_mutable = (copy_mutable_flag pld_mutable);
      Ast_409.Parsetree.pld_type = (copy_core_type pld_type);
      Ast_409.Parsetree.pld_loc = (copy_location pld_loc);
      Ast_409.Parsetree.pld_attributes = (copy_attributes pld_attributes)
    }
and copy_mutable_flag :
  Ast_410.Asttypes.mutable_flag -> Ast_409.Asttypes.mutable_flag =
  function
  | Ast_410.Asttypes.Immutable -> Ast_409.Asttypes.Immutable
  | Ast_410.Asttypes.Mutable -> Ast_409.Asttypes.Mutable
and copy_variance : Ast_410.Asttypes.variance -> Ast_409.Asttypes.variance =
  function
  | Ast_410.Asttypes.Covariant -> Ast_409.Asttypes.Covariant
  | Ast_410.Asttypes.Contravariant -> Ast_409.Asttypes.Contravariant
  | Ast_410.Asttypes.Invariant -> Ast_409.Asttypes.Invariant
and copy_value_description :
  Ast_410.Parsetree.value_description -> Ast_409.Parsetree.value_description
  =
  fun
    { Ast_410.Parsetree.pval_name = pval_name;
      Ast_410.Parsetree.pval_type = pval_type;
      Ast_410.Parsetree.pval_prim = pval_prim;
      Ast_410.Parsetree.pval_attributes = pval_attributes;
      Ast_410.Parsetree.pval_loc = pval_loc }
    ->
    {
      Ast_409.Parsetree.pval_name = (copy_loc (fun x -> x) pval_name);
      Ast_409.Parsetree.pval_type = (copy_core_type pval_type);
      Ast_409.Parsetree.pval_prim = (List.map (fun x -> x) pval_prim);
      Ast_409.Parsetree.pval_attributes = (copy_attributes pval_attributes);
      Ast_409.Parsetree.pval_loc = (copy_location pval_loc)
    }
and copy_object_field_desc :
  Ast_410.Parsetree.object_field_desc -> Ast_409.Parsetree.object_field_desc
  =
  function
  | Ast_410.Parsetree.Otag (x0, x1) ->
      Ast_409.Parsetree.Otag ((copy_loc copy_label x0), (copy_core_type x1))
  | Ast_410.Parsetree.Oinherit x0 ->
      Ast_409.Parsetree.Oinherit (copy_core_type x0)
and copy_arg_label : Ast_410.Asttypes.arg_label -> Ast_409.Asttypes.arg_label
  =
  function
  | Ast_410.Asttypes.Nolabel -> Ast_409.Asttypes.Nolabel
  | Ast_410.Asttypes.Labelled x0 -> Ast_409.Asttypes.Labelled x0
  | Ast_410.Asttypes.Optional x0 -> Ast_409.Asttypes.Optional x0
and copy_closed_flag :
  Ast_410.Asttypes.closed_flag -> Ast_409.Asttypes.closed_flag =
  function
  | Ast_410.Asttypes.Closed -> Ast_409.Asttypes.Closed
  | Ast_410.Asttypes.Open -> Ast_409.Asttypes.Open
and copy_label : Ast_410.Asttypes.label -> Ast_409.Asttypes.label =
  fun x -> x
and copy_rec_flag : Ast_410.Asttypes.rec_flag -> Ast_409.Asttypes.rec_flag =
  function
  | Ast_410.Asttypes.Nonrecursive -> Ast_409.Asttypes.Nonrecursive
  | Ast_410.Asttypes.Recursive -> Ast_409.Asttypes.Recursive
and copy_constant : Ast_410.Parsetree.constant -> Ast_409.Parsetree.constant
  =
  function
  | Ast_410.Parsetree.Pconst_integer (x0, x1) ->
      Ast_409.Parsetree.Pconst_integer (x0, (map_option (fun x -> x) x1))
  | Ast_410.Parsetree.Pconst_char x0 -> Ast_409.Parsetree.Pconst_char x0
  | Ast_410.Parsetree.Pconst_string (x0, x1) ->
      Ast_409.Parsetree.Pconst_string (x0, (map_option (fun x -> x) x1))
  | Ast_410.Parsetree.Pconst_float (x0, x1) ->
      Ast_409.Parsetree.Pconst_float (x0, (map_option (fun x -> x) x1))
and copy_Longident_t : Ast_410.Longident.t -> Ast_409.Longident.t =
  function
  | Ast_410.Longident.Lident x0 -> Ast_409.Longident.Lident x0
  | Ast_410.Longident.Ldot (x0, x1) ->
      Ast_409.Longident.Ldot ((copy_Longident_t x0), x1)
  | Ast_410.Longident.Lapply (x0, x1) ->
      Ast_409.Longident.Lapply ((copy_Longident_t x0), (copy_Longident_t x1))
and copy_loc :
  'f0 'g0 .
    ('f0 -> 'g0) -> 'f0 Ast_410.Asttypes.loc -> 'g0 Ast_409.Asttypes.loc
  =
  fun f0 ->
    fun { Ast_410.Asttypes.txt = txt; Ast_410.Asttypes.loc = loc } ->
      {
        Ast_409.Asttypes.txt = (f0 txt);
        Ast_409.Asttypes.loc = (copy_location loc)
      }
and copy_location : Ast_410.Location.t -> Ast_409.Location.t =
  fun
    { Ast_410.Location.loc_start = loc_start;
      Ast_410.Location.loc_end = loc_end;
      Ast_410.Location.loc_ghost = loc_ghost }
    ->
    {
      Ast_409.Location.loc_start = (copy_position loc_start);
      Ast_409.Location.loc_end = (copy_position loc_end);
      Ast_409.Location.loc_ghost = loc_ghost
    }
and copy_position : Lexing.position -> Lexing.position =
  fun
    { Lexing.pos_fname = pos_fname; Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol; Lexing.pos_cnum = pos_cnum }
    ->
    {
      Lexing.pos_fname = pos_fname;
      Lexing.pos_lnum = pos_lnum;
      Lexing.pos_bol = pos_bol;
      Lexing.pos_cnum = pos_cnum
    }
let copy_expr = copy_expression
let copy_pat = copy_pattern
let copy_typ = copy_core_type

end
module Migrate_parsetree_409_410
= struct
#1 "migrate_parsetree_409_410.ml"
# 1 "src/migrate_parsetree_409_410.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_409_410_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload";
    "binding_op"; "module_substitution"; "open_declaration"; "type_exception"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     binding_op;
     module_substitution;
     open_declaration;
     type_exception;
     (*$*)
   } as mapper) ->
  let module Def = Migrate_parsetree_def in
  let module R = Migrate_parsetree_410_409_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    binding_op = (fun _ x -> copy_binding_op (binding_op mapper (R.copy_binding_op x)));
    module_substitution = (fun _ x -> copy_module_substitution (module_substitution mapper (R.copy_module_substitution x)));
    open_declaration = (fun _ x -> copy_open_declaration (open_declaration mapper (R.copy_open_declaration x)));
    type_exception = (fun _ x -> copy_type_exception (type_exception mapper (R.copy_type_exception x)));
    (*$*)
  }

end
module Migrate_parsetree_410_409
= struct
#1 "migrate_parsetree_410_409.ml"
# 1 "src/migrate_parsetree_410_409.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

include Migrate_parsetree_410_409_migrate

(*$ open Printf
  let fields = [
    "attribute"; "attributes"; "case"; "cases"; "class_declaration";
    "class_description"; "class_expr"; "class_field"; "class_signature";
    "class_structure"; "class_type"; "class_type_declaration";
    "class_type_field"; "constructor_declaration"; "expr"; "extension";
    "extension_constructor"; "include_declaration"; "include_description";
    "label_declaration"; "location"; "module_binding"; "module_declaration";
    "module_expr"; "module_type"; "module_type_declaration";
    "open_description"; "pat"; "signature"; "signature_item"; "structure";
    "structure_item"; "typ"; "type_declaration"; "type_extension";
    "type_kind"; "value_binding"; "value_description";
    "with_constraint"; "payload";
    "binding_op"; "module_substitution"; "open_declaration"; "type_exception"
  ]
  let foreach_field f =
    printf "\n";
    List.iter f fields
*)(*$*)

let copy_mapper = fun
  ({ From.Ast_mapper.
     (*$ foreach_field (printf "%s;\n")*)
     attribute;
     attributes;
     case;
     cases;
     class_declaration;
     class_description;
     class_expr;
     class_field;
     class_signature;
     class_structure;
     class_type;
     class_type_declaration;
     class_type_field;
     constructor_declaration;
     expr;
     extension;
     extension_constructor;
     include_declaration;
     include_description;
     label_declaration;
     location;
     module_binding;
     module_declaration;
     module_expr;
     module_type;
     module_type_declaration;
     open_description;
     pat;
     signature;
     signature_item;
     structure;
     structure_item;
     typ;
     type_declaration;
     type_extension;
     type_kind;
     value_binding;
     value_description;
     with_constraint;
     payload;
     binding_op;
     module_substitution;
     open_declaration;
     type_exception;
     (*$*)
   } as mapper) ->
  let module Def = Migrate_parsetree_def in
  let module R = Migrate_parsetree_409_410_migrate in
  {
    To.Ast_mapper.
    (*$ foreach_field (fun s ->
        printf
          "%s = (fun _ x -> copy_%s (%s mapper (R.copy_%s x)));\n" s s s s)
    *)
    attribute = (fun _ x -> copy_attribute (attribute mapper (R.copy_attribute x)));
    attributes = (fun _ x -> copy_attributes (attributes mapper (R.copy_attributes x)));
    case = (fun _ x -> copy_case (case mapper (R.copy_case x)));
    cases = (fun _ x -> copy_cases (cases mapper (R.copy_cases x)));
    class_declaration = (fun _ x -> copy_class_declaration (class_declaration mapper (R.copy_class_declaration x)));
    class_description = (fun _ x -> copy_class_description (class_description mapper (R.copy_class_description x)));
    class_expr = (fun _ x -> copy_class_expr (class_expr mapper (R.copy_class_expr x)));
    class_field = (fun _ x -> copy_class_field (class_field mapper (R.copy_class_field x)));
    class_signature = (fun _ x -> copy_class_signature (class_signature mapper (R.copy_class_signature x)));
    class_structure = (fun _ x -> copy_class_structure (class_structure mapper (R.copy_class_structure x)));
    class_type = (fun _ x -> copy_class_type (class_type mapper (R.copy_class_type x)));
    class_type_declaration = (fun _ x -> copy_class_type_declaration (class_type_declaration mapper (R.copy_class_type_declaration x)));
    class_type_field = (fun _ x -> copy_class_type_field (class_type_field mapper (R.copy_class_type_field x)));
    constructor_declaration = (fun _ x -> copy_constructor_declaration (constructor_declaration mapper (R.copy_constructor_declaration x)));
    expr = (fun _ x -> copy_expr (expr mapper (R.copy_expr x)));
    extension = (fun _ x -> copy_extension (extension mapper (R.copy_extension x)));
    extension_constructor = (fun _ x -> copy_extension_constructor (extension_constructor mapper (R.copy_extension_constructor x)));
    include_declaration = (fun _ x -> copy_include_declaration (include_declaration mapper (R.copy_include_declaration x)));
    include_description = (fun _ x -> copy_include_description (include_description mapper (R.copy_include_description x)));
    label_declaration = (fun _ x -> copy_label_declaration (label_declaration mapper (R.copy_label_declaration x)));
    location = (fun _ x -> copy_location (location mapper (R.copy_location x)));
    module_binding = (fun _ x -> copy_module_binding (module_binding mapper (R.copy_module_binding x)));
    module_declaration = (fun _ x -> copy_module_declaration (module_declaration mapper (R.copy_module_declaration x)));
    module_expr = (fun _ x -> copy_module_expr (module_expr mapper (R.copy_module_expr x)));
    module_type = (fun _ x -> copy_module_type (module_type mapper (R.copy_module_type x)));
    module_type_declaration = (fun _ x -> copy_module_type_declaration (module_type_declaration mapper (R.copy_module_type_declaration x)));
    open_description = (fun _ x -> copy_open_description (open_description mapper (R.copy_open_description x)));
    pat = (fun _ x -> copy_pat (pat mapper (R.copy_pat x)));
    signature = (fun _ x -> copy_signature (signature mapper (R.copy_signature x)));
    signature_item = (fun _ x -> copy_signature_item (signature_item mapper (R.copy_signature_item x)));
    structure = (fun _ x -> copy_structure (structure mapper (R.copy_structure x)));
    structure_item = (fun _ x -> copy_structure_item (structure_item mapper (R.copy_structure_item x)));
    typ = (fun _ x -> copy_typ (typ mapper (R.copy_typ x)));
    type_declaration = (fun _ x -> copy_type_declaration (type_declaration mapper (R.copy_type_declaration x)));
    type_extension = (fun _ x -> copy_type_extension (type_extension mapper (R.copy_type_extension x)));
    type_kind = (fun _ x -> copy_type_kind (type_kind mapper (R.copy_type_kind x)));
    value_binding = (fun _ x -> copy_value_binding (value_binding mapper (R.copy_value_binding x)));
    value_description = (fun _ x -> copy_value_description (value_description mapper (R.copy_value_description x)));
    with_constraint = (fun _ x -> copy_with_constraint (with_constraint mapper (R.copy_with_constraint x)));
    payload = (fun _ x -> copy_payload (payload mapper (R.copy_payload x)));
    binding_op = (fun _ x -> copy_binding_op (binding_op mapper (R.copy_binding_op x)));
    module_substitution = (fun _ x -> copy_module_substitution (module_substitution mapper (R.copy_module_substitution x)));
    open_declaration = (fun _ x -> copy_open_declaration (open_declaration mapper (R.copy_open_declaration x)));
    type_exception = (fun _ x -> copy_type_exception (type_exception mapper (R.copy_type_exception x)));
    (*$*)
  }

end
module Migrate_parsetree_versions : sig 
#1 "migrate_parsetree_versions.mli"
# 1 "src/migrate_parsetree_versions.mli"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                   Jérémie Dimino, Jane Street Europe                   *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(*$ #use "src/cinaps_helpers" $*)

(** {1 Abstracting an OCaml frontend} *)

(** Abstract view of a version of an OCaml Ast *)
module type Ast = sig
  (*$ foreach_module (fun m types ->
      printf "module %s : sig\n" m;
      List.iter types ~f:(printf "type %s\n");
      printf "end\n"
    )
  *)
  module Parsetree : sig
    type structure
    type signature
    type toplevel_phrase
    type core_type
    type expression
    type pattern
    type case
    type type_declaration
    type type_extension
    type extension_constructor
  end
  module Outcometree : sig
    type out_value
    type out_type
    type out_class_type
    type out_module_type
    type out_sig_item
    type out_type_extension
    type out_phrase
  end
  module Ast_mapper : sig
    type mapper
  end
  (*$*)
  module Config : sig
    val ast_impl_magic_number : string
    val ast_intf_magic_number : string
  end
  val shallow_identity : Ast_mapper.mapper
  val map_signature : Ast_mapper.mapper -> Parsetree.signature -> Parsetree.signature
  val map_structure : Ast_mapper.mapper -> Parsetree.structure -> Parsetree.structure
  val make_top_mapper
    :  signature:(Parsetree.signature -> Parsetree.signature)
    -> structure:(Parsetree.structure -> Parsetree.structure)
    -> Ast_mapper.mapper
end

(* Shortcuts for talking about ast types outside of the module language *)

type 'a _types = 'a constraint 'a
  = <
    (*$ foreach_type (fun _ s -> printf "%-21s : _;\n" s) *)
    structure             : _;
    signature             : _;
    toplevel_phrase       : _;
    core_type             : _;
    expression            : _;
    pattern               : _;
    case                  : _;
    type_declaration      : _;
    type_extension        : _;
    extension_constructor : _;
    out_value             : _;
    out_type              : _;
    out_class_type        : _;
    out_module_type       : _;
    out_sig_item          : _;
    out_type_extension    : _;
    out_phrase            : _;
    mapper                : _;
    (*$*)
  >
;;

(*$ foreach_type (fun _ s ->
    printf "type 'a get_%s = 'x constraint 'a _types = < %s : 'x; .. >\n" s s
  );
  printf ";;\n" *)
type 'a get_structure = 'x constraint 'a _types = < structure : 'x; .. >
type 'a get_signature = 'x constraint 'a _types = < signature : 'x; .. >
type 'a get_toplevel_phrase = 'x constraint 'a _types = < toplevel_phrase : 'x; .. >
type 'a get_core_type = 'x constraint 'a _types = < core_type : 'x; .. >
type 'a get_expression = 'x constraint 'a _types = < expression : 'x; .. >
type 'a get_pattern = 'x constraint 'a _types = < pattern : 'x; .. >
type 'a get_case = 'x constraint 'a _types = < case : 'x; .. >
type 'a get_type_declaration = 'x constraint 'a _types = < type_declaration : 'x; .. >
type 'a get_type_extension = 'x constraint 'a _types = < type_extension : 'x; .. >
type 'a get_extension_constructor = 'x constraint 'a _types = < extension_constructor : 'x; .. >
type 'a get_out_value = 'x constraint 'a _types = < out_value : 'x; .. >
type 'a get_out_type = 'x constraint 'a _types = < out_type : 'x; .. >
type 'a get_out_class_type = 'x constraint 'a _types = < out_class_type : 'x; .. >
type 'a get_out_module_type = 'x constraint 'a _types = < out_module_type : 'x; .. >
type 'a get_out_sig_item = 'x constraint 'a _types = < out_sig_item : 'x; .. >
type 'a get_out_type_extension = 'x constraint 'a _types = < out_type_extension : 'x; .. >
type 'a get_out_phrase = 'x constraint 'a _types = < out_phrase : 'x; .. >
type 'a get_mapper = 'x constraint 'a _types = < mapper : 'x; .. >
;;
(*$*)

(** A version of the OCaml frontend packs the ast with type witnesses
    so that equalities can be recovered dynamically. *)
type _ witnesses                   = private ..  

(** [migration_info] is an opaque type that is used to generate migration
    functions. *)
type _ migration_info

(** An OCaml frontend versions an Ast, version number and some witnesses for
    conversion. *)
module type OCaml_version = sig

  (** Ast definition for this version *)
  module Ast : Ast

  (* Version number as an integer, 402, 403, 404, ... *)
  val version : int

  (* Version number as a user-friendly string *)
  val string_version : string (* 4.02, 4.03, 4.04, ... *)

  (** Shortcut for talking about Ast types *)
  type types = <
    (*$ foreach_type (fun m s -> printf "%-21s : Ast.%s.%s;\n" s m s) *)
    structure             : Ast.Parsetree.structure;
    signature             : Ast.Parsetree.signature;
    toplevel_phrase       : Ast.Parsetree.toplevel_phrase;
    core_type             : Ast.Parsetree.core_type;
    expression            : Ast.Parsetree.expression;
    pattern               : Ast.Parsetree.pattern;
    case                  : Ast.Parsetree.case;
    type_declaration      : Ast.Parsetree.type_declaration;
    type_extension        : Ast.Parsetree.type_extension;
    extension_constructor : Ast.Parsetree.extension_constructor;
    out_value             : Ast.Outcometree.out_value;
    out_type              : Ast.Outcometree.out_type;
    out_class_type        : Ast.Outcometree.out_class_type;
    out_module_type       : Ast.Outcometree.out_module_type;
    out_sig_item          : Ast.Outcometree.out_sig_item;
    out_type_extension    : Ast.Outcometree.out_type_extension;
    out_phrase            : Ast.Outcometree.out_phrase;
    mapper                : Ast.Ast_mapper.mapper;
    (*$*)
  > _types

  (** A construtor for recovering type equalities between two arbitrary
      versions. *)
  type _ witnesses += Version : types witnesses

  (** Information used to derive migration functions, see below *)
  val migration_info : types migration_info
end

(** Representing an ocaml version in type language *)
type 'types ocaml_version =
  (module OCaml_version
    (*$ let sep = with_then_and () in
      foreach_type (fun m s ->
          printf "%t type Ast.%s.%s = 'types get_%s\n" sep m s s) *)
    with type Ast.Parsetree.structure = 'types get_structure
     and type Ast.Parsetree.signature = 'types get_signature
     and type Ast.Parsetree.toplevel_phrase = 'types get_toplevel_phrase
     and type Ast.Parsetree.core_type = 'types get_core_type
     and type Ast.Parsetree.expression = 'types get_expression
     and type Ast.Parsetree.pattern = 'types get_pattern
     and type Ast.Parsetree.case = 'types get_case
     and type Ast.Parsetree.type_declaration = 'types get_type_declaration
     and type Ast.Parsetree.type_extension = 'types get_type_extension
     and type Ast.Parsetree.extension_constructor = 'types get_extension_constructor
     and type Ast.Outcometree.out_value = 'types get_out_value
     and type Ast.Outcometree.out_type = 'types get_out_type
     and type Ast.Outcometree.out_class_type = 'types get_out_class_type
     and type Ast.Outcometree.out_module_type = 'types get_out_module_type
     and type Ast.Outcometree.out_sig_item = 'types get_out_sig_item
     and type Ast.Outcometree.out_type_extension = 'types get_out_type_extension
     and type Ast.Outcometree.out_phrase = 'types get_out_phrase
     and type Ast.Ast_mapper.mapper = 'types get_mapper
     (*$*)
  )

(** {1 Concrete frontend instances} *)

(*$foreach_version (fun suffix _ ->
    printf "module OCaml_%s : OCaml_version with module Ast = Ast_%s\n"
      suffix suffix;
    printf "val ocaml_%s : OCaml_%s.types ocaml_version\n" suffix suffix;
  )*)
module OCaml_402 : OCaml_version with module Ast = Ast_402
val ocaml_402 : OCaml_402.types ocaml_version
module OCaml_403 : OCaml_version with module Ast = Ast_403
val ocaml_403 : OCaml_403.types ocaml_version
module OCaml_404 : OCaml_version with module Ast = Ast_404
val ocaml_404 : OCaml_404.types ocaml_version
module OCaml_405 : OCaml_version with module Ast = Ast_405
val ocaml_405 : OCaml_405.types ocaml_version
module OCaml_406 : OCaml_version with module Ast = Ast_406
val ocaml_406 : OCaml_406.types ocaml_version
module OCaml_407 : OCaml_version with module Ast = Ast_407
val ocaml_407 : OCaml_407.types ocaml_version
module OCaml_408 : OCaml_version with module Ast = Ast_408
val ocaml_408 : OCaml_408.types ocaml_version
module OCaml_409 : OCaml_version with module Ast = Ast_409
val ocaml_409 : OCaml_409.types ocaml_version
module OCaml_410 : OCaml_version with module Ast = Ast_410
val ocaml_410 : OCaml_410.types ocaml_version
(*$*)

(* An alias to the current compiler version *)
module OCaml_current = OCaml_406          
val ocaml_current : OCaml_current.types ocaml_version

val all_versions : (module OCaml_version) list

(** {1 Migrating between different versions} *)

type ('a, 'b) type_comparison =
  | Lt : ('a, 'b) type_comparison
  | Eq : ('a, 'a) type_comparison
  | Gt : ('a, 'b) type_comparison

val compare_ocaml_version : 'a ocaml_version -> 'b ocaml_version -> ('a, 'b) type_comparison

(** A record for migrating each AST construct between two known versions *)
type ('from, 'to_) migration_functions = {
  (*$ foreach_type (fun _ s ->
      printf "copy_%s: 'from get_%s -> 'to_ get_%s;\n" s s s) *)
  copy_structure: 'from get_structure -> 'to_ get_structure;
  copy_signature: 'from get_signature -> 'to_ get_signature;
  copy_toplevel_phrase: 'from get_toplevel_phrase -> 'to_ get_toplevel_phrase;
  copy_core_type: 'from get_core_type -> 'to_ get_core_type;
  copy_expression: 'from get_expression -> 'to_ get_expression;
  copy_pattern: 'from get_pattern -> 'to_ get_pattern;
  copy_case: 'from get_case -> 'to_ get_case;
  copy_type_declaration: 'from get_type_declaration -> 'to_ get_type_declaration;
  copy_type_extension: 'from get_type_extension -> 'to_ get_type_extension;
  copy_extension_constructor: 'from get_extension_constructor -> 'to_ get_extension_constructor;
  copy_out_value: 'from get_out_value -> 'to_ get_out_value;
  copy_out_type: 'from get_out_type -> 'to_ get_out_type;
  copy_out_class_type: 'from get_out_class_type -> 'to_ get_out_class_type;
  copy_out_module_type: 'from get_out_module_type -> 'to_ get_out_module_type;
  copy_out_sig_item: 'from get_out_sig_item -> 'to_ get_out_sig_item;
  copy_out_type_extension: 'from get_out_type_extension -> 'to_ get_out_type_extension;
  copy_out_phrase: 'from get_out_phrase -> 'to_ get_out_phrase;
  copy_mapper: 'from get_mapper -> 'to_ get_mapper;
  (*$*)
}

(** Migrating to the same version is no-op *)
val migration_identity : ('a, 'a) migration_functions

(** Migrations can be composed *)
val migration_compose : ('a, 'b) migration_functions -> ('b, 'c) migration_functions -> ('a, 'c) migration_functions

(** Represent the next or previous version of an Ast *)

type 'from immediate_migration =
  | No_migration : 'from immediate_migration
  (** Cannot migrate earliest or latest supported version *)
  |
    Immediate_migration :
      ('from, 'to_) migration_functions * 'to_ ocaml_version -> 'from immediate_migration
  (** Pack the migration functions and the new version *)

val immediate_migration : 'types ocaml_version -> [< `Next | `Previous ] -> 'types immediate_migration

val migrate : 'from ocaml_version -> 'to_ ocaml_version -> ('from, 'to_) migration_functions

(** {1 Convenience definitions} *)

(** Module level migration *)
module Convert (A : OCaml_version) (B : OCaml_version) : sig
  (*$ foreach_type (fun m s ->
      let fq = sprintf "%s.%s" m s in
      printf "  val copy_%-21s : A.Ast.%-31s -> B.Ast.%s\n" s fq fq) *)
  val copy_structure             : A.Ast.Parsetree.structure             -> B.Ast.Parsetree.structure
  val copy_signature             : A.Ast.Parsetree.signature             -> B.Ast.Parsetree.signature
  val copy_toplevel_phrase       : A.Ast.Parsetree.toplevel_phrase       -> B.Ast.Parsetree.toplevel_phrase
  val copy_core_type             : A.Ast.Parsetree.core_type             -> B.Ast.Parsetree.core_type
  val copy_expression            : A.Ast.Parsetree.expression            -> B.Ast.Parsetree.expression
  val copy_pattern               : A.Ast.Parsetree.pattern               -> B.Ast.Parsetree.pattern
  val copy_case                  : A.Ast.Parsetree.case                  -> B.Ast.Parsetree.case
  val copy_type_declaration      : A.Ast.Parsetree.type_declaration      -> B.Ast.Parsetree.type_declaration
  val copy_type_extension        : A.Ast.Parsetree.type_extension        -> B.Ast.Parsetree.type_extension
  val copy_extension_constructor : A.Ast.Parsetree.extension_constructor -> B.Ast.Parsetree.extension_constructor
  val copy_out_value             : A.Ast.Outcometree.out_value           -> B.Ast.Outcometree.out_value
  val copy_out_type              : A.Ast.Outcometree.out_type            -> B.Ast.Outcometree.out_type
  val copy_out_class_type        : A.Ast.Outcometree.out_class_type      -> B.Ast.Outcometree.out_class_type
  val copy_out_module_type       : A.Ast.Outcometree.out_module_type     -> B.Ast.Outcometree.out_module_type
  val copy_out_sig_item          : A.Ast.Outcometree.out_sig_item        -> B.Ast.Outcometree.out_sig_item
  val copy_out_type_extension    : A.Ast.Outcometree.out_type_extension  -> B.Ast.Outcometree.out_type_extension
  val copy_out_phrase            : A.Ast.Outcometree.out_phrase          -> B.Ast.Outcometree.out_phrase
  val copy_mapper                : A.Ast.Ast_mapper.mapper               -> B.Ast.Ast_mapper.mapper
  (*$*)
end

end = struct
#1 "migrate_parsetree_versions.ml"
# 1 "src/migrate_parsetree_versions.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                   Jérémie Dimino, Jane Street Europe                   *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(* BEGIN of BLACK MAGIC *)
(*$ #use "src/cinaps_helpers" $*)

type _ witnesses = ..

type _ migration = ..
type _ migration += Undefined : _ migration

type 'a migration_info = {
  mutable next_version : 'a migration;
  mutable previous_version : 'a migration;
}

(** Abstract view of a version of an OCaml Ast *)
module type Ast = sig
  (*$ foreach_module (fun m types ->
      printf "module %s : sig\n" m;
      List.iter types ~f:(printf "type %s\n");
      printf "end\n"
    )
  *)
  module Parsetree : sig
    type structure
    type signature
    type toplevel_phrase
    type core_type
    type expression
    type pattern
    type case
    type type_declaration
    type type_extension
    type extension_constructor
  end
  module Outcometree : sig
    type out_value
    type out_type
    type out_class_type
    type out_module_type
    type out_sig_item
    type out_type_extension
    type out_phrase
  end
  module Ast_mapper : sig
    type mapper
  end
  (*$*)
  module Config : sig
    val ast_impl_magic_number : string
    val ast_intf_magic_number : string
  end
  val shallow_identity : Ast_mapper.mapper
  val map_signature : Ast_mapper.mapper -> Parsetree.signature -> Parsetree.signature
  val map_structure : Ast_mapper.mapper -> Parsetree.structure -> Parsetree.structure
  val make_top_mapper
    :  signature:(Parsetree.signature -> Parsetree.signature)
    -> structure:(Parsetree.structure -> Parsetree.structure)
    -> Ast_mapper.mapper
end

(* Shortcuts for talking about ast types outside of the module language *)

type 'a _types = 'a constraint 'a
  = <
    (*$ foreach_type (fun _ s -> printf "%-21s : _;\n" s) *)
    structure             : _;
    signature             : _;
    toplevel_phrase       : _;
    core_type             : _;
    expression            : _;
    pattern               : _;
    case                  : _;
    type_declaration      : _;
    type_extension        : _;
    extension_constructor : _;
    out_value             : _;
    out_type              : _;
    out_class_type        : _;
    out_module_type       : _;
    out_sig_item          : _;
    out_type_extension    : _;
    out_phrase            : _;
    mapper                : _;
    (*$*)
  >
;;

(*$ foreach_type (fun _ s ->
    printf "type 'a get_%s =\n" s;
    printf " 'x constraint 'a _types = < %s : 'x; .. >\n" s
  ) *)
type 'a get_structure =
  'x constraint 'a _types = < structure : 'x; .. >
type 'a get_signature =
  'x constraint 'a _types = < signature : 'x; .. >
type 'a get_toplevel_phrase =
  'x constraint 'a _types = < toplevel_phrase : 'x; .. >
type 'a get_core_type =
  'x constraint 'a _types = < core_type : 'x; .. >
type 'a get_expression =
  'x constraint 'a _types = < expression : 'x; .. >
type 'a get_pattern =
  'x constraint 'a _types = < pattern : 'x; .. >
type 'a get_case =
  'x constraint 'a _types = < case : 'x; .. >
type 'a get_type_declaration =
  'x constraint 'a _types = < type_declaration : 'x; .. >
type 'a get_type_extension =
  'x constraint 'a _types = < type_extension : 'x; .. >
type 'a get_extension_constructor =
  'x constraint 'a _types = < extension_constructor : 'x; .. >
type 'a get_out_value =
  'x constraint 'a _types = < out_value : 'x; .. >
type 'a get_out_type =
  'x constraint 'a _types = < out_type : 'x; .. >
type 'a get_out_class_type =
  'x constraint 'a _types = < out_class_type : 'x; .. >
type 'a get_out_module_type =
  'x constraint 'a _types = < out_module_type : 'x; .. >
type 'a get_out_sig_item =
  'x constraint 'a _types = < out_sig_item : 'x; .. >
type 'a get_out_type_extension =
  'x constraint 'a _types = < out_type_extension : 'x; .. >
type 'a get_out_phrase =
  'x constraint 'a _types = < out_phrase : 'x; .. >
type 'a get_mapper =
  'x constraint 'a _types = < mapper : 'x; .. >
(*$*)

module type OCaml_version = sig
  module Ast : Ast
  val version : int
  val string_version : string
  type types = <
    (*$ foreach_type (fun m s -> printf "%-21s : Ast.%s.%s;\n" s m s)*)
    structure             : Ast.Parsetree.structure;
    signature             : Ast.Parsetree.signature;
    toplevel_phrase       : Ast.Parsetree.toplevel_phrase;
    core_type             : Ast.Parsetree.core_type;
    expression            : Ast.Parsetree.expression;
    pattern               : Ast.Parsetree.pattern;
    case                  : Ast.Parsetree.case;
    type_declaration      : Ast.Parsetree.type_declaration;
    type_extension        : Ast.Parsetree.type_extension;
    extension_constructor : Ast.Parsetree.extension_constructor;
    out_value             : Ast.Outcometree.out_value;
    out_type              : Ast.Outcometree.out_type;
    out_class_type        : Ast.Outcometree.out_class_type;
    out_module_type       : Ast.Outcometree.out_module_type;
    out_sig_item          : Ast.Outcometree.out_sig_item;
    out_type_extension    : Ast.Outcometree.out_type_extension;
    out_phrase            : Ast.Outcometree.out_phrase;
    mapper                : Ast.Ast_mapper.mapper;
    (*$*)
  > _types
  type _ witnesses += Version : types witnesses
  val migration_info : types migration_info
end

module Make_witness(Ast : Ast) =
struct
  type types = <
    (*$ foreach_type (fun m s -> printf "%-21s : Ast.%s.%s;\n" s m s)*)
    structure             : Ast.Parsetree.structure;
    signature             : Ast.Parsetree.signature;
    toplevel_phrase       : Ast.Parsetree.toplevel_phrase;
    core_type             : Ast.Parsetree.core_type;
    expression            : Ast.Parsetree.expression;
    pattern               : Ast.Parsetree.pattern;
    case                  : Ast.Parsetree.case;
    type_declaration      : Ast.Parsetree.type_declaration;
    type_extension        : Ast.Parsetree.type_extension;
    extension_constructor : Ast.Parsetree.extension_constructor;
    out_value             : Ast.Outcometree.out_value;
    out_type              : Ast.Outcometree.out_type;
    out_class_type        : Ast.Outcometree.out_class_type;
    out_module_type       : Ast.Outcometree.out_module_type;
    out_sig_item          : Ast.Outcometree.out_sig_item;
    out_type_extension    : Ast.Outcometree.out_type_extension;
    out_phrase            : Ast.Outcometree.out_phrase;
    mapper                : Ast.Ast_mapper.mapper;
    (*$*)
  > _types
  type _ witnesses += Version : types witnesses
  let migration_info : types migration_info =
    { next_version = Undefined; previous_version = Undefined }
end

type 'types ocaml_version =
  (module OCaml_version
    (*$ let sep = with_then_and () in
      foreach_type (fun m s ->
          printf "%t type Ast.%s.%s = 'types get_%s\n" sep m s s) *)
    with type Ast.Parsetree.structure = 'types get_structure
     and type Ast.Parsetree.signature = 'types get_signature
     and type Ast.Parsetree.toplevel_phrase = 'types get_toplevel_phrase
     and type Ast.Parsetree.core_type = 'types get_core_type
     and type Ast.Parsetree.expression = 'types get_expression
     and type Ast.Parsetree.pattern = 'types get_pattern
     and type Ast.Parsetree.case = 'types get_case
     and type Ast.Parsetree.type_declaration = 'types get_type_declaration
     and type Ast.Parsetree.type_extension = 'types get_type_extension
     and type Ast.Parsetree.extension_constructor = 'types get_extension_constructor
     and type Ast.Outcometree.out_value = 'types get_out_value
     and type Ast.Outcometree.out_type = 'types get_out_type
     and type Ast.Outcometree.out_class_type = 'types get_out_class_type
     and type Ast.Outcometree.out_module_type = 'types get_out_module_type
     and type Ast.Outcometree.out_sig_item = 'types get_out_sig_item
     and type Ast.Outcometree.out_type_extension = 'types get_out_type_extension
     and type Ast.Outcometree.out_phrase = 'types get_out_phrase
     and type Ast.Ast_mapper.mapper = 'types get_mapper
     (*$*)
  )

type ('a, 'b) type_comparison =
  | Lt : ('a, 'b) type_comparison
  | Eq : ('a, 'a) type_comparison
  | Gt : ('a, 'b) type_comparison

let compare_ocaml_version
    (*$ foreach_type (fun _ s -> printf "(type %s1) (type %s2)\n" s s) *)
    (type structure1) (type structure2)
    (type signature1) (type signature2)
    (type toplevel_phrase1) (type toplevel_phrase2)
    (type core_type1) (type core_type2)
    (type expression1) (type expression2)
    (type pattern1) (type pattern2)
    (type case1) (type case2)
    (type type_declaration1) (type type_declaration2)
    (type type_extension1) (type type_extension2)
    (type extension_constructor1) (type extension_constructor2)
    (type out_value1) (type out_value2)
    (type out_type1) (type out_type2)
    (type out_class_type1) (type out_class_type2)
    (type out_module_type1) (type out_module_type2)
    (type out_sig_item1) (type out_sig_item2)
    (type out_type_extension1) (type out_type_extension2)
    (type out_phrase1) (type out_phrase2)
    (type mapper1) (type mapper2)
    (*$*)
    ((module A) : <
     (*$ foreach_type (fun _ s -> printf "%-21s : %s1;\n" s s) *)
     structure             : structure1;
     signature             : signature1;
     toplevel_phrase       : toplevel_phrase1;
     core_type             : core_type1;
     expression            : expression1;
     pattern               : pattern1;
     case                  : case1;
     type_declaration      : type_declaration1;
     type_extension        : type_extension1;
     extension_constructor : extension_constructor1;
     out_value             : out_value1;
     out_type              : out_type1;
     out_class_type        : out_class_type1;
     out_module_type       : out_module_type1;
     out_sig_item          : out_sig_item1;
     out_type_extension    : out_type_extension1;
     out_phrase            : out_phrase1;
     mapper                : mapper1;
     (*$*)
     > ocaml_version)
    ((module B) : <
     (*$ foreach_type (fun _ s -> printf "%-21s : %s2;\n" s s) *)
     structure             : structure2;
     signature             : signature2;
     toplevel_phrase       : toplevel_phrase2;
     core_type             : core_type2;
     expression            : expression2;
     pattern               : pattern2;
     case                  : case2;
     type_declaration      : type_declaration2;
     type_extension        : type_extension2;
     extension_constructor : extension_constructor2;
     out_value             : out_value2;
     out_type              : out_type2;
     out_class_type        : out_class_type2;
     out_module_type       : out_module_type2;
     out_sig_item          : out_sig_item2;
     out_type_extension    : out_type_extension2;
     out_phrase            : out_phrase2;
     mapper                : mapper2;
     (*$*)
     > ocaml_version)
  : (A.types, B.types) type_comparison
  =
  match A.Version with
  | B.Version -> Eq
  | _ when A.version < B.version -> Lt
  | _ when A.version > B.version -> Gt
  | _ -> assert false

type ('from, 'to_) migration_functions = {
  (*$ foreach_type (fun _ s ->
      printf "copy_%s: 'from get_%s -> 'to_ get_%s;\n" s s s) *)
  copy_structure: 'from get_structure -> 'to_ get_structure;
  copy_signature: 'from get_signature -> 'to_ get_signature;
  copy_toplevel_phrase: 'from get_toplevel_phrase -> 'to_ get_toplevel_phrase;
  copy_core_type: 'from get_core_type -> 'to_ get_core_type;
  copy_expression: 'from get_expression -> 'to_ get_expression;
  copy_pattern: 'from get_pattern -> 'to_ get_pattern;
  copy_case: 'from get_case -> 'to_ get_case;
  copy_type_declaration: 'from get_type_declaration -> 'to_ get_type_declaration;
  copy_type_extension: 'from get_type_extension -> 'to_ get_type_extension;
  copy_extension_constructor: 'from get_extension_constructor -> 'to_ get_extension_constructor;
  copy_out_value: 'from get_out_value -> 'to_ get_out_value;
  copy_out_type: 'from get_out_type -> 'to_ get_out_type;
  copy_out_class_type: 'from get_out_class_type -> 'to_ get_out_class_type;
  copy_out_module_type: 'from get_out_module_type -> 'to_ get_out_module_type;
  copy_out_sig_item: 'from get_out_sig_item -> 'to_ get_out_sig_item;
  copy_out_type_extension: 'from get_out_type_extension -> 'to_ get_out_type_extension;
  copy_out_phrase: 'from get_out_phrase -> 'to_ get_out_phrase;
  copy_mapper: 'from get_mapper -> 'to_ get_mapper;
  (*$*)
}

let id x = x
let migration_identity : ('a, 'a) migration_functions = {
  (*$ foreach_type (fun _ s -> printf "copy_%s = id;\n" s) *)
  copy_structure = id;
  copy_signature = id;
  copy_toplevel_phrase = id;
  copy_core_type = id;
  copy_expression = id;
  copy_pattern = id;
  copy_case = id;
  copy_type_declaration = id;
  copy_type_extension = id;
  copy_extension_constructor = id;
  copy_out_value = id;
  copy_out_type = id;
  copy_out_class_type = id;
  copy_out_module_type = id;
  copy_out_sig_item = id;
  copy_out_type_extension = id;
  copy_out_phrase = id;
  copy_mapper = id;
  (*$*)
}

let compose f g x = f (g x)
let migration_compose (ab : ('a, 'b) migration_functions) (bc : ('b, 'c) migration_functions) : ('a, 'c) migration_functions = {
  (*$ foreach_type (fun _ s ->
      printf "copy_%-21s = compose bc.copy_%-21s ab.copy_%s;\n" s s s) *)
  copy_structure             = compose bc.copy_structure             ab.copy_structure;
  copy_signature             = compose bc.copy_signature             ab.copy_signature;
  copy_toplevel_phrase       = compose bc.copy_toplevel_phrase       ab.copy_toplevel_phrase;
  copy_core_type             = compose bc.copy_core_type             ab.copy_core_type;
  copy_expression            = compose bc.copy_expression            ab.copy_expression;
  copy_pattern               = compose bc.copy_pattern               ab.copy_pattern;
  copy_case                  = compose bc.copy_case                  ab.copy_case;
  copy_type_declaration      = compose bc.copy_type_declaration      ab.copy_type_declaration;
  copy_type_extension        = compose bc.copy_type_extension        ab.copy_type_extension;
  copy_extension_constructor = compose bc.copy_extension_constructor ab.copy_extension_constructor;
  copy_out_value             = compose bc.copy_out_value             ab.copy_out_value;
  copy_out_type              = compose bc.copy_out_type              ab.copy_out_type;
  copy_out_class_type        = compose bc.copy_out_class_type        ab.copy_out_class_type;
  copy_out_module_type       = compose bc.copy_out_module_type       ab.copy_out_module_type;
  copy_out_sig_item          = compose bc.copy_out_sig_item          ab.copy_out_sig_item;
  copy_out_type_extension    = compose bc.copy_out_type_extension    ab.copy_out_type_extension;
  copy_out_phrase            = compose bc.copy_out_phrase            ab.copy_out_phrase;
  copy_mapper                = compose bc.copy_mapper                ab.copy_mapper;
  (*$*)
}

type _ migration += Migration : 'from ocaml_version * ('from, 'to_) migration_functions * 'to_ ocaml_version -> 'from migration

module type Migrate_module = sig
  module From : Ast
  module To : Ast
  (*$ foreach_type (fun m s ->
      printf "val copy_%-21s: From.%s.%s -> To.%s.%s\n" s m s m s) *)
  val copy_structure            : From.Parsetree.structure -> To.Parsetree.structure
  val copy_signature            : From.Parsetree.signature -> To.Parsetree.signature
  val copy_toplevel_phrase      : From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase
  val copy_core_type            : From.Parsetree.core_type -> To.Parsetree.core_type
  val copy_expression           : From.Parsetree.expression -> To.Parsetree.expression
  val copy_pattern              : From.Parsetree.pattern -> To.Parsetree.pattern
  val copy_case                 : From.Parsetree.case -> To.Parsetree.case
  val copy_type_declaration     : From.Parsetree.type_declaration -> To.Parsetree.type_declaration
  val copy_type_extension       : From.Parsetree.type_extension -> To.Parsetree.type_extension
  val copy_extension_constructor: From.Parsetree.extension_constructor -> To.Parsetree.extension_constructor
  val copy_out_value            : From.Outcometree.out_value -> To.Outcometree.out_value
  val copy_out_type             : From.Outcometree.out_type -> To.Outcometree.out_type
  val copy_out_class_type       : From.Outcometree.out_class_type -> To.Outcometree.out_class_type
  val copy_out_module_type      : From.Outcometree.out_module_type -> To.Outcometree.out_module_type
  val copy_out_sig_item         : From.Outcometree.out_sig_item -> To.Outcometree.out_sig_item
  val copy_out_type_extension   : From.Outcometree.out_type_extension -> To.Outcometree.out_type_extension
  val copy_out_phrase           : From.Outcometree.out_phrase -> To.Outcometree.out_phrase
  val copy_mapper               : From.Ast_mapper.mapper -> To.Ast_mapper.mapper
  (*$*)
end

module Migration_functions
    (A : OCaml_version) (B : OCaml_version)
    (A_to_B : Migrate_module with module From = A.Ast and module To = B.Ast)
=
struct
  let migration_functions : (A.types, B.types) migration_functions =
    let open A_to_B in
    {
      (*$ foreach_type (fun _ s -> printf "copy_%s;\n" s) *)
      copy_structure;
      copy_signature;
      copy_toplevel_phrase;
      copy_core_type;
      copy_expression;
      copy_pattern;
      copy_case;
      copy_type_declaration;
      copy_type_extension;
      copy_extension_constructor;
      copy_out_value;
      copy_out_type;
      copy_out_class_type;
      copy_out_module_type;
      copy_out_sig_item;
      copy_out_type_extension;
      copy_out_phrase;
      copy_mapper;
      (*$*)
    }
end

module Register_migration (A : OCaml_version) (B : OCaml_version)
    (A_to_B : Migrate_module with module From = A.Ast and module To = B.Ast)
    (B_to_A : Migrate_module with module From = B.Ast and module To = A.Ast)
=
struct
  let () = (
    let is_undefined : type a. a migration -> bool = function
      | Undefined -> true
      | _ -> false
    in
    assert (A.version < B.version);
    assert (is_undefined A.migration_info.next_version);
    assert (is_undefined B.migration_info.previous_version);
    let module A_to_B_fun = Migration_functions(A)(B)(A_to_B) in
    let module B_to_A_fun = Migration_functions(B)(A)(B_to_A) in
    A.migration_info.next_version <-
      Migration ((module A), A_to_B_fun.migration_functions, (module B));
    B.migration_info.previous_version <-
      Migration ((module B), B_to_A_fun.migration_functions, (module A));
  )
end

type 'from immediate_migration =
  | No_migration : 'from immediate_migration
  | Immediate_migration
    :  ('from, 'to_) migration_functions * 'to_ ocaml_version
      -> 'from immediate_migration

let immediate_migration
    (*$ foreach_type (fun _ s -> printf "(type %s)\n" s) *)
    (type structure)
    (type signature)
    (type toplevel_phrase)
    (type core_type)
    (type expression)
    (type pattern)
    (type case)
    (type type_declaration)
    (type type_extension)
    (type extension_constructor)
    (type out_value)
    (type out_type)
    (type out_class_type)
    (type out_module_type)
    (type out_sig_item)
    (type out_type_extension)
    (type out_phrase)
    (type mapper)
    (*$*)
    ((module A) : <
     (*$ foreach_type (fun _ s -> printf "%-21s : %s;\n" s s) *)
     structure             : structure;
     signature             : signature;
     toplevel_phrase       : toplevel_phrase;
     core_type             : core_type;
     expression            : expression;
     pattern               : pattern;
     case                  : case;
     type_declaration      : type_declaration;
     type_extension        : type_extension;
     extension_constructor : extension_constructor;
     out_value             : out_value;
     out_type              : out_type;
     out_class_type        : out_class_type;
     out_module_type       : out_module_type;
     out_sig_item          : out_sig_item;
     out_type_extension    : out_type_extension;
     out_phrase            : out_phrase;
     mapper                : mapper;
     (*$*)
     > ocaml_version)
    direction
  =
  let version = match direction with
    | `Next -> A.migration_info.next_version
    | `Previous -> A.migration_info.previous_version
  in
  match version with
  | Undefined -> No_migration
  | Migration (_, funs, to_) -> Immediate_migration (funs, to_)
  | _ -> assert false

let migrate
    (*$ foreach_type (fun _ s -> printf "(type %s1) (type %s2)\n" s s) *)
    (type structure1) (type structure2)
    (type signature1) (type signature2)
    (type toplevel_phrase1) (type toplevel_phrase2)
    (type core_type1) (type core_type2)
    (type expression1) (type expression2)
    (type pattern1) (type pattern2)
    (type case1) (type case2)
    (type type_declaration1) (type type_declaration2)
    (type type_extension1) (type type_extension2)
    (type extension_constructor1) (type extension_constructor2)
    (type out_value1) (type out_value2)
    (type out_type1) (type out_type2)
    (type out_class_type1) (type out_class_type2)
    (type out_module_type1) (type out_module_type2)
    (type out_sig_item1) (type out_sig_item2)
    (type out_type_extension1) (type out_type_extension2)
    (type out_phrase1) (type out_phrase2)
    (type mapper1) (type mapper2)
    (*$*)
    ((module A) : <
     (*$ foreach_type (fun _ s -> printf "%-21s : %s1;\n" s s) *)
     structure             : structure1;
     signature             : signature1;
     toplevel_phrase       : toplevel_phrase1;
     core_type             : core_type1;
     expression            : expression1;
     pattern               : pattern1;
     case                  : case1;
     type_declaration      : type_declaration1;
     type_extension        : type_extension1;
     extension_constructor : extension_constructor1;
     out_value             : out_value1;
     out_type              : out_type1;
     out_class_type        : out_class_type1;
     out_module_type       : out_module_type1;
     out_sig_item          : out_sig_item1;
     out_type_extension    : out_type_extension1;
     out_phrase            : out_phrase1;
     mapper                : mapper1;
     (*$*)
     > ocaml_version)
    ((module B) : <
     (*$ foreach_type (fun _ s -> printf "%-21s : %s2;\n" s s) *)
     structure             : structure2;
     signature             : signature2;
     toplevel_phrase       : toplevel_phrase2;
     core_type             : core_type2;
     expression            : expression2;
     pattern               : pattern2;
     case                  : case2;
     type_declaration      : type_declaration2;
     type_extension        : type_extension2;
     extension_constructor : extension_constructor2;
     out_value             : out_value2;
     out_type              : out_type2;
     out_class_type        : out_class_type2;
     out_module_type       : out_module_type2;
     out_sig_item          : out_sig_item2;
     out_type_extension    : out_type_extension2;
     out_phrase            : out_phrase2;
     mapper                : mapper2;
     (*$*)
     > ocaml_version)
  : (A.types, B.types) migration_functions
  =
  match A.Version with
  | B.Version -> migration_identity
  | _ ->
    let direction = if A.version < B.version then `Next else `Previous in
    let rec migrate (m : A.types immediate_migration) : (A.types, B.types) migration_functions =
      match m with
      | No_migration -> assert false
      | Immediate_migration (f, (module To)) ->
        match To.Version with
        | B.Version -> f
        | _ ->
          match immediate_migration (module To) direction with
          | No_migration -> assert false
          | Immediate_migration (g, to2) ->
            migrate (Immediate_migration (migration_compose f g, to2))
    in
    migrate (immediate_migration (module A) direction)

module Convert (A : OCaml_version) (B : OCaml_version) = struct
  let {
    (*$ foreach_type (fun _ s -> printf "copy_%s;\n" s) *)
    copy_structure;
    copy_signature;
    copy_toplevel_phrase;
    copy_core_type;
    copy_expression;
    copy_pattern;
    copy_case;
    copy_type_declaration;
    copy_type_extension;
    copy_extension_constructor;
    copy_out_value;
    copy_out_type;
    copy_out_class_type;
    copy_out_module_type;
    copy_out_sig_item;
    copy_out_type_extension;
    copy_out_phrase;
    copy_mapper;
    (*$*)
  } : (A.types, B.types) migration_functions =
    migrate (module A) (module B)
end

(*$ foreach_version (fun suffix version ->
    printf "module OCaml_%s = struct\n" suffix;
    printf "  module Ast = Ast_%s\n" suffix;
    printf "  include Make_witness(Ast_%s)\n" suffix;
    printf "  let version = %s\n" suffix;
    printf "  let string_version = %S\n" version;
    printf "end\n";
    printf "let ocaml_%s : OCaml_%s.types ocaml_version = (module OCaml_%s)\n"
      suffix suffix suffix;
  )
*)
module OCaml_402 = struct
  module Ast = Ast_402
  include Make_witness(Ast_402)
  let version = 402
  let string_version = "4.02"
end
let ocaml_402 : OCaml_402.types ocaml_version = (module OCaml_402)
module OCaml_403 = struct
  module Ast = Ast_403
  include Make_witness(Ast_403)
  let version = 403
  let string_version = "4.03"
end
let ocaml_403 : OCaml_403.types ocaml_version = (module OCaml_403)
module OCaml_404 = struct
  module Ast = Ast_404
  include Make_witness(Ast_404)
  let version = 404
  let string_version = "4.04"
end
let ocaml_404 : OCaml_404.types ocaml_version = (module OCaml_404)
module OCaml_405 = struct
  module Ast = Ast_405
  include Make_witness(Ast_405)
  let version = 405
  let string_version = "4.05"
end
let ocaml_405 : OCaml_405.types ocaml_version = (module OCaml_405)
module OCaml_406 = struct
  module Ast = Ast_406
  include Make_witness(Ast_406)
  let version = 406
  let string_version = "4.06"
end
let ocaml_406 : OCaml_406.types ocaml_version = (module OCaml_406)
module OCaml_407 = struct
  module Ast = Ast_407
  include Make_witness(Ast_407)
  let version = 407
  let string_version = "4.07"
end
let ocaml_407 : OCaml_407.types ocaml_version = (module OCaml_407)
module OCaml_408 = struct
  module Ast = Ast_408
  include Make_witness(Ast_408)
  let version = 408
  let string_version = "4.08"
end
let ocaml_408 : OCaml_408.types ocaml_version = (module OCaml_408)
module OCaml_409 = struct
  module Ast = Ast_409
  include Make_witness(Ast_409)
  let version = 409
  let string_version = "4.09"
end
let ocaml_409 : OCaml_409.types ocaml_version = (module OCaml_409)
module OCaml_410 = struct
  module Ast = Ast_410
  include Make_witness(Ast_410)
  let version = 410
  let string_version = "4.10"
end
let ocaml_410 : OCaml_410.types ocaml_version = (module OCaml_410)
(*$*)

let all_versions : (module OCaml_version) list = [
  (*$foreach_version (fun suffix _ ->
      printf "(module OCaml_%s : OCaml_version);\n" suffix)*)
  (module OCaml_402 : OCaml_version);
  (module OCaml_403 : OCaml_version);
  (module OCaml_404 : OCaml_version);
  (module OCaml_405 : OCaml_version);
  (module OCaml_406 : OCaml_version);
  (module OCaml_407 : OCaml_version);
  (module OCaml_408 : OCaml_version);
  (module OCaml_409 : OCaml_version);
  (module OCaml_410 : OCaml_version);
  (*$*)
]

(*$foreach_version_pair (fun a b ->
    printf "include Register_migration(OCaml_%s)(OCaml_%s)\n" a b;
    printf "  (Migrate_parsetree_%s_%s)(Migrate_parsetree_%s_%s)\n" a b b a
  )
*)
include Register_migration(OCaml_402)(OCaml_403)
    (Migrate_parsetree_402_403)(Migrate_parsetree_403_402)
include Register_migration(OCaml_403)(OCaml_404)
    (Migrate_parsetree_403_404)(Migrate_parsetree_404_403)
include Register_migration(OCaml_404)(OCaml_405)
    (Migrate_parsetree_404_405)(Migrate_parsetree_405_404)
include Register_migration(OCaml_405)(OCaml_406)
    (Migrate_parsetree_405_406)(Migrate_parsetree_406_405)
include Register_migration(OCaml_406)(OCaml_407)
    (Migrate_parsetree_406_407)(Migrate_parsetree_407_406)
include Register_migration(OCaml_407)(OCaml_408)
    (Migrate_parsetree_407_408)(Migrate_parsetree_408_407)
include Register_migration(OCaml_408)(OCaml_409)
    (Migrate_parsetree_408_409)(Migrate_parsetree_409_408)
include Register_migration(OCaml_409)(OCaml_410)
    (Migrate_parsetree_409_410)(Migrate_parsetree_410_409)
(*$*)

module OCaml_current = OCaml_406          
let ocaml_current : OCaml_current.types ocaml_version = (module OCaml_current)

(* Make sure the preprocessing worked as expected *)
let _f (x : Parsetree.expression) : OCaml_current.Ast.Parsetree.expression = x

end
module Migrate_parsetree_ast_io : sig 
#1 "migrate_parsetree_ast_io.mli"
# 1 "src/migrate_parsetree_ast_io.mli"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)
open Result[@@ocaml.warning "-33"]

(** A marshalled ast packs the ast with the corresponding version of the
    frontend *)
type ast =
  | Impl : (module Migrate_parsetree_versions.OCaml_version with
             type Ast.Parsetree.structure = 'concrete) * 'concrete -> ast
  | Intf : (module Migrate_parsetree_versions.OCaml_version with
             type Ast.Parsetree.signature = 'concrete) * 'concrete -> ast

(** A simple alias used for the filename of the source that produced an AST *)
type filename = string

type read_error =
  | Not_a_binary_ast of string
  (** The input doesn't contain a binary AST. The argument corresponds
      to the bytes from the input that were consumed. *)
  | Unknown_version of string
  (** The input contains a binary AST for an unknown version of OCaml.
      The argument is the unknown magic number. *)

(** Load a marshalled AST from a channel

    Any exception raised during unmarshalling (see [Marshal]) can escape.  *)
val from_channel : in_channel -> (filename * ast, read_error) result

(** Load a marshalled AST from a byte string.

    See [from_channel] description for exception that can be raised. *)
val from_bytes : bytes -> int -> (filename * ast, read_error) result

(** Marshal an AST to a channel *)
val to_channel : out_channel -> filename -> ast -> unit

(** Marshal an AST to a byte string *)
val to_bytes : filename -> ast -> bytes

end = struct
#1 "migrate_parsetree_ast_io.ml"
# 1 "src/migrate_parsetree_ast_io.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)
open Result

type ast =
  | Impl : (module Migrate_parsetree_versions.OCaml_version with
             type Ast.Parsetree.structure = 'concrete) * 'concrete -> ast
  | Intf : (module Migrate_parsetree_versions.OCaml_version with
             type Ast.Parsetree.signature = 'concrete) * 'concrete -> ast

type filename = string

let magic_length = String.length Ast_402.Config.ast_impl_magic_number

let read_magic ic =
  let buf = Bytes.create magic_length in
  let len = input ic buf 0 magic_length in
  let s = Bytes.sub_string buf 0 len in
  if len = magic_length then
    Ok s
  else
    Error s

type read_error =
  | Not_a_binary_ast of string
  | Unknown_version of string

let find_magic magic =
  let rec loop = function
    | [] ->
        let prefix = String.sub magic 0 9 in
        if prefix = String.sub Ast_402.Config.ast_impl_magic_number 0 9 ||
           prefix = String.sub Ast_402.Config.ast_intf_magic_number 0 9 then
          Error (Unknown_version magic)
        else
          Error (Not_a_binary_ast magic)
    | (module Frontend : Migrate_parsetree_versions.OCaml_version) :: tail ->
        if Frontend.Ast.Config.ast_impl_magic_number = magic then
          Ok (fun x -> Impl ((module Frontend), Obj.obj x))
        else if Frontend.Ast.Config.ast_intf_magic_number = magic then
          Ok (fun x -> Intf ((module Frontend), Obj.obj x))
        else
          loop tail
  in
  loop Migrate_parsetree_versions.all_versions

let from_channel ic =
  match read_magic ic with
  | Error s -> Error (Not_a_binary_ast s)
  | Ok s ->
    match find_magic s with
    | Ok inj ->
      let filename : filename = input_value ic in
      let payload = inj (input_value ic) in
      Ok (filename, payload)
    | Error _ as e  -> e

let from_bytes bytes pos =
  if Bytes.length bytes - pos < magic_length then
    Error (Not_a_binary_ast "")
  else
    let magic = Bytes.to_string (Bytes.sub bytes pos magic_length) in
    match find_magic magic with
    | Ok inj ->
      let filename_pos = pos + magic_length in
      let filename : filename = Marshal.from_bytes bytes filename_pos in
      let payload_pos = filename_pos + Marshal.total_size bytes filename_pos in
      let payload = inj (Marshal.from_bytes bytes payload_pos) in
      Ok (filename, payload)
    | Error _ as e -> e

let decompose_ast = function
  | Impl ((module Frontend), tree) ->
      (Frontend.Ast.Config.ast_impl_magic_number, Obj.repr tree)
  | Intf ((module Frontend), tree) ->
      (Frontend.Ast.Config.ast_intf_magic_number, Obj.repr tree)

let to_channel oc (filename : filename) x =
  let magic_number, payload = decompose_ast x in
  output_string oc magic_number;
  output_value oc filename;
  output_value oc payload

let to_bytes (filename : filename) x =
  let magic_number, payload = decompose_ast x in
  Bytes.cat (
    Bytes.cat
      (Bytes.of_string magic_number)
      (Marshal.to_bytes filename [])
  ) (Marshal.to_bytes payload [])

end
module Ppx_derivers : sig 
#1 "ppx_derivers.mli"
(** Ppx derivers

    This module holds the various derivers registered by either ppx_deriving or
    ppx_type_conv.
*)

(** Type of a deriver. The concrete constructors are added by
    ppx_type_conv/ppx_deriving. *)
type deriver = ..

(** [register name deriver] registers a new deriver. Raises if [name] is already
    registered. *)
val register : string -> deriver -> unit

(** Lookup a previously registered deriver *)
val lookup : string -> deriver option

(** [derivers ()] returns all currently registered derivers. *)
val derivers : unit -> (string * deriver) list

end = struct
#1 "ppx_derivers.ml"
type deriver = ..

let all = Hashtbl.create 42

let register name deriver =
  if Hashtbl.mem all name then
    Printf.ksprintf failwith
      "Ppx_deriviers.register: %S is already registered" name;
  Hashtbl.add all name deriver

let lookup name =
  match Hashtbl.find all name with
  | drv -> Some drv
  | exception Not_found -> None

let derivers () =
  Hashtbl.fold (fun name drv acc -> (name, drv) :: acc) all []

end
module Migrate_parsetree_driver : sig 
#1 "migrate_parsetree_driver.mli"
# 1 "src/migrate_parsetree_driver.mli"
open Migrate_parsetree_versions

(** {1 State a rewriter can access} *)

type extra = ..

type config = {
  tool_name       : string;
  include_dirs    : string list;
  load_path       : string list;
  debug           : bool;
  for_package     : string option;
  (** Additional parameters that can be passed by a caller of
      [rewrite_{signature,structure}] to a specific register rewriter. *)
  extras          : extra list;
}

val make_config
  :  tool_name:string
  -> ?include_dirs:string list
  -> ?load_path:string list
  -> ?debug:bool
  -> ?for_package:string
  -> ?extras:extra list
  -> unit
  -> config

type cookies

val get_cookie
  : cookies
  -> string
  -> 'types ocaml_version -> 'types get_expression option

val set_cookie
  : cookies
  -> string
  -> 'types ocaml_version -> 'types get_expression
  -> unit

val set_global_cookie
  :  string
  -> 'types ocaml_version -> 'types get_expression
  -> unit

(** {1 Registering rewriters} *)

type 'types rewriter = config -> cookies -> 'types get_mapper

(** Register a ppx rewriter. [position] is a integer that indicates
    when the ppx rewriter should be applied. It is guaranteed that if
    two ppx rewriters [a] and [b] have different position numbers, then
    the one with the lowest number will be applied first. The rewriting
    order of ppx rewriters with the same position number is not
    specified. The default position is [0].

    Note that more different position numbers means more AST
    conversions and slower rewriting, so think twice before setting
    [position] to a non-zero number.
*)
val register
  :  name:string
  -> ?reset_args:(unit -> unit) -> ?args:(Arg.key * Arg.spec * Arg.doc) list
  -> ?position:int
  -> 'types ocaml_version -> 'types rewriter
  -> unit

(** Return the list of command line arguments registered by rewriters *)
val registered_args : unit -> (Arg.key * Arg.spec * Arg.doc) list

(** Call all the registered [reset_args] callbacks *)
val reset_args : unit -> unit

(** {1 Running registered rewriters} *)

val run_as_ast_mapper : string list -> Ast_mapper.mapper

val run_as_ppx_rewriter : ?argv:string array -> unit -> 'a

val run_main : ?argv:string array -> unit -> 'a

(** {1 Manual mapping} *)

type some_signature =
  | Sig : (module Migrate_parsetree_versions.OCaml_version with
            type Ast.Parsetree.signature = 'concrete) * 'concrete -> some_signature

type some_structure =
  | Str : (module Migrate_parsetree_versions.OCaml_version with
            type Ast.Parsetree.structure = 'concrete) * 'concrete -> some_structure

val migrate_some_signature
  :  'version ocaml_version
  -> some_signature
  -> 'version get_signature

val migrate_some_structure
  :  'version ocaml_version
  -> some_structure
  -> 'version get_structure

val rewrite_signature
  :  config
  -> 'version ocaml_version
  -> 'version get_signature
  -> some_signature

val rewrite_structure
  :  config
  -> 'version ocaml_version
  -> 'version get_structure
  -> some_structure

end = struct
#1 "migrate_parsetree_driver.ml"
# 1 "src/migrate_parsetree_driver.ml"
open Migrate_parsetree_versions
module Ast_io = Migrate_parsetree_ast_io

(** {1 State a rewriter can access} *)

type extra = ..

type config = {
  tool_name: string;
  include_dirs : string list;
  load_path : string list;
  debug : bool;
  for_package : string option;
  extras : extra list;
}

let make_config ~tool_name ?(include_dirs=[]) ?(load_path=[]) ?(debug=false)
      ?for_package ?(extras=[]) () =
  { tool_name
  ; include_dirs
  ; load_path
  ; debug
  ; for_package
  ; extras
  }

type cookie = Cookie : 'types ocaml_version * 'types get_expression -> cookie

type cookies = (string, cookie) Hashtbl.t

let create_cookies () = Hashtbl.create 3

let global_cookie_table = create_cookies ()

let get_cookie table name version =
  match
    match Hashtbl.find table name with
    | result -> Some result
    | exception Not_found ->
        match Ast_mapper.get_cookie name with
        | Some expr -> Some (Cookie ((module OCaml_current), expr))
        | None ->
            match Hashtbl.find global_cookie_table name with
            | result -> Some result
            | exception Not_found -> None
  with
  | None -> None
  | Some (Cookie (version', expr)) ->
    Some ((migrate version' version).copy_expression expr)

let set_cookie table name version expr =
  Hashtbl.replace table name (Cookie (version, expr))

let set_global_cookie name version expr =
  set_cookie global_cookie_table name version expr

let apply_cookies table =
  Hashtbl.iter (fun name (Cookie (version, expr)) ->
      Ast_mapper.set_cookie name
        ((migrate version (module OCaml_current)).copy_expression expr)
    ) table

let initial_state () =
  {
    tool_name = Ast_mapper.tool_name ();
    include_dirs = !Clflags.include_dirs;
    load_path = Migrate_parsetree_compiler_functions.get_load_paths ();
    debug = !Clflags.debug;
    for_package = !Clflags.for_package;
    extras = [];
  }

(** {1 Registering rewriters} *)

type 'types rewriter = config -> cookies -> 'types get_mapper

type rewriter_group =
    Rewriters : 'types ocaml_version * (string * 'types rewriter) list -> rewriter_group

let rewriter_group_names (Rewriters (_, l)) = List.map fst l

let uniq_rewriter = Hashtbl.create 7
module Pos_map = Map.Make(struct
    type t = int
    let compare : int -> int -> t = compare
  end)
let registered_rewriters = ref Pos_map.empty

let all_rewriters () =
  Pos_map.bindings !registered_rewriters
  |> List.map (fun (_, r) -> !r)
  |> List.concat

let uniq_arg = Hashtbl.create 7
let registered_args_reset = ref []
let registered_args = ref []

let () =
  let set_cookie s =
    match String.index s '=' with
    | exception _ ->
      raise (Arg.Bad "invalid cookie, must be of the form \"<name>=<expr>\"")
    | i ->
      let name = String.sub s 0 i in
      let value = String.sub s (i + 1) (String.length s - i - 1) in
      let input_name = "<command-line>" in
      Location.input_name := input_name;
      let lexbuf = Lexing.from_string value in
      lexbuf.Lexing.lex_curr_p <-
        { Lexing.
          pos_fname = input_name
        ; pos_lnum  = 1
        ; pos_bol   = 0
        ; pos_cnum  = 0
        };
      let expr = Parse.expression lexbuf in
      set_global_cookie name (module OCaml_current) expr
  in
  registered_args :=
    ("--cookie", Arg.String set_cookie,
     "NAME=EXPR Set the cookie NAME to EXPR") :: !registered_args

type ('types, 'version, 'rewriter) is_rewriter =
  | Is_rewriter : ('types, 'types ocaml_version, 'types rewriter) is_rewriter

let add_rewriter
    (type types) (type version) (type rewriter)
    (Is_rewriter : (types, version, rewriter) is_rewriter)
    (version : version) name (rewriter : rewriter) =
  let rec add_rewriter = function
  | [] -> [Rewriters (version, [name, rewriter])]
  | (Rewriters (version', rewriters) as x) :: xs ->
      match compare_ocaml_version version version' with
      | Eq -> Rewriters (version', (name, rewriter) :: rewriters) :: xs
      | Lt -> Rewriters (version, [name, rewriter]) :: x :: xs
      | Gt -> x :: add_rewriter xs
  in
  add_rewriter

let register ~name ?reset_args ?(args=[]) ?(position=0) version rewriter =
  (* Validate name *)
  if name = "" then
    invalid_arg "Migrate_parsetree_driver.register: name is empty";
  if Hashtbl.mem uniq_rewriter name then
    invalid_arg ("Migrate_parsetree_driver.register: rewriter " ^ name ^ " has already been registered")
  else Hashtbl.add uniq_rewriter name ();
  (* Validate arguments *)
  List.iter (fun (arg_name, _, _) ->
      match Hashtbl.find uniq_arg arg_name with
      | other_rewriter ->
          invalid_arg (Printf.sprintf
                         "Migrate_parsetree_driver.register: argument %s is used by %s and %s" arg_name name other_rewriter)
      | exception Not_found ->
          Hashtbl.add uniq_arg arg_name name
    ) args;
  (* Register *)
  begin match reset_args with
  | None -> ()
  | Some f -> registered_args_reset := f :: !registered_args_reset
  end;
  registered_args := List.rev_append args !registered_args;
  let r =
    try
      Pos_map.find position !registered_rewriters
    with Not_found ->
      let r = ref [] in
      registered_rewriters := Pos_map.add position r !registered_rewriters;
      r
  in
  r := add_rewriter Is_rewriter version name rewriter !r

let registered_args () = List.rev !registered_args
let reset_args () = List.iter (fun f -> f ()) !registered_args_reset

(** {1 Accessing or running registered rewriters} *)

type ('types, 'version, 'tree) is_signature =
    Signature : ('types, 'types ocaml_version, 'types get_signature) is_signature

type ('types, 'version, 'tree) is_structure =
    Structure : ('types, 'types ocaml_version, 'types get_structure) is_structure

type some_structure =
  | Str : (module Migrate_parsetree_versions.OCaml_version with
            type Ast.Parsetree.structure = 'concrete) * 'concrete -> some_structure

type some_signature =
  | Sig : (module Migrate_parsetree_versions.OCaml_version with
            type Ast.Parsetree.signature = 'concrete) * 'concrete -> some_signature

let migrate_some_structure dst (Str ((module Version), st)) =
  (migrate (module Version) dst).copy_structure st

let migrate_some_signature dst (Sig ((module Version), sg)) =
  (migrate (module Version) dst).copy_signature sg

let rec rewrite_signature
  : type types version tree.
    config -> cookies ->
    (types, version, tree) is_signature -> version -> tree ->
    rewriter_group list -> some_signature
  = fun (type types) (type version) (type tree)
    config cookies
    (Signature : (types, version, tree) is_signature)
    (version : version)
    (tree : tree)
    -> function
      | [] ->
        let (module Version) = version in
        Sig ((module Version), tree)
      | Rewriters (version', rewriters) :: rest ->
          let rewrite (_name, rewriter) tree =
            let (module Version) = version' in
            Version.Ast.map_signature (rewriter config cookies) tree
          in
          let tree = (migrate version version').copy_signature tree in
          let tree = List.fold_right rewrite rewriters tree in
          rewrite_signature config cookies Signature version' tree rest

let rewrite_signature config version sg =
  let cookies = create_cookies () in
  let sg =
    rewrite_signature config cookies Signature version sg
      (all_rewriters ())
  in
  apply_cookies cookies;
  sg

let rec rewrite_structure
  : type types version tree.
    config -> cookies ->
    (types, version, tree) is_structure -> version -> tree ->
    rewriter_group list -> some_structure
  = fun (type types) (type version) (type tree)
    config cookies
    (Structure : (types, version, tree) is_structure)
    (version : version)
    (tree : tree)
    -> function
      | [] ->
        let (module Version) = version in
        Str ((module Version), tree)
      | Rewriters (version', rewriters) :: rest ->
          let rewriter (_name, rewriter) tree =
            let (module Version) = version' in
            Version.Ast.map_structure (rewriter config cookies) tree
          in
          let tree = (migrate version version').copy_structure tree in
          let tree = List.fold_right rewriter rewriters tree in
          rewrite_structure config cookies Structure version' tree rest

let rewrite_structure config version st =
  let cookies = create_cookies () in
  let st =
    rewrite_structure config cookies Structure version st
      (all_rewriters ())
  in
  apply_cookies cookies;
  st

let run_as_ast_mapper args =
  let spec = registered_args () in
  let args, usage =
    let me = Filename.basename Sys.executable_name in
    let args = match args with "--as-ppx" :: args -> args | args -> args in
    (Array.of_list (me :: args),
     Printf.sprintf "%s [options] <input ast file> <output ast file>" me)
  in
  reset_args ();
  match
    Arg.parse_argv args spec
      (fun arg -> raise (Arg.Bad (Printf.sprintf "invalid argument %S" arg)))
      usage
  with
  | exception (Arg.Help msg) ->
      prerr_endline msg;
      exit 1
  | () ->
      OCaml_current.Ast.make_top_mapper
        ~signature:(fun sg ->
            let config = initial_state () in
            rewrite_signature config (module OCaml_current) sg
            |> migrate_some_signature (module OCaml_current)
          )
        ~structure:(fun str ->
            let config = initial_state () in
            rewrite_structure config (module OCaml_current) str
            |> migrate_some_structure (module OCaml_current)
          )

let protectx x ~finally ~f =
  match f x with
  | y -> finally x; y
  | exception e -> finally x; raise e

let with_file_in fn ~f =
  protectx (open_in_bin fn) ~finally:close_in ~f

let with_file_out fn ~f =
  protectx (open_out_bin fn) ~finally:close_out ~f

type ('a, 'b) intf_or_impl =
  | Intf of 'a
  | Impl of 'b

type file_kind =
  | Kind_intf
  | Kind_impl
  | Kind_unknown

let guess_file_kind fn =
  if Filename.check_suffix fn ".ml" then
    Kind_impl
  else if Filename.check_suffix fn ".mli" then
    Kind_intf
  else
    Kind_unknown

let check_kind fn ~expected ~got =
  let describe = function
    | Kind_intf -> "interface"
    | Kind_impl -> "implementation"
    | Kind_unknown -> "unknown file"
  in
  match expected, got with
  | Kind_impl, Kind_impl
  | Kind_intf, Kind_intf
  | Kind_unknown, _ -> ()
  | _ ->
    Location.raise_errorf ~loc:(Location.in_file fn)
      "Expected an %s got an %s instead"
      (describe expected)
      (describe got)

let load_file (kind, fn) =
  with_file_in fn ~f:(fun ic ->
    match Ast_io.from_channel ic with
    | Ok (fn, Ast_io.Intf ((module V), sg)) ->
      check_kind fn ~expected:kind ~got:Kind_intf;
      Location.input_name := fn;
      (* We need to convert to the current version in order to interpret the cookies using
         [Ast_mapper.drop_ppx_context_*] from the compiler *)
      (fn, Intf ((migrate (module V) (module OCaml_current)).copy_signature sg))
    | Ok (fn, Ast_io.Impl ((module V), st)) ->
      check_kind fn ~expected:kind ~got:Kind_impl;
      Location.input_name := fn;
      (fn, Impl ((migrate (module V) (module OCaml_current)).copy_structure st))
    | Error (Ast_io.Unknown_version _) ->
      Location.raise_errorf ~loc:(Location.in_file fn)
        "File is a binary ast for an unknown version of OCaml"
    | Error (Ast_io.Not_a_binary_ast prefix_read_from_file) ->
      (* To test if a file is a binary AST file, we have to read the first few bytes of
         the file.

         If it is not a binary AST, we have to parse these bytes and the rest of the file
         as source code. To do that, we prefill the lexbuf buffer with what we read from
         the file to do the test. *)
      let lexbuf = Lexing.from_channel ic in
      let len = String.length prefix_read_from_file in
      String.blit prefix_read_from_file 0 lexbuf.Lexing.lex_buffer 0 len;
      lexbuf.Lexing.lex_buffer_len <- len;
      lexbuf.Lexing.lex_curr_p <-
        { Lexing.
          pos_fname = fn
        ; pos_lnum  = 1
        ; pos_bol   = 0
        ; pos_cnum  = 0
        };
      Location.input_name := fn;
      let kind =
        match kind with
        | Kind_impl -> Kind_impl
        | Kind_intf -> Kind_intf
        | Kind_unknown -> guess_file_kind fn
      in
      match kind with
      | Kind_impl ->
        (fn, Impl (Parse.implementation lexbuf))
      | Kind_intf ->
        (fn, Intf (Parse.interface lexbuf))
      | Kind_unknown ->
        Location.raise_errorf ~loc:(Location.in_file fn)
          "I can't decide whether %s is an implementation or interface file"
          fn)

let with_output ?bin output ~f =
  match output with
  | None ->
      begin match bin with
      | Some bin -> set_binary_mode_out stdout bin
      | None -> ()
      end;
      f stdout
  | Some fn -> with_file_out fn ~f

type output_mode =
  | Pretty_print
  | Dump_ast
  | Null

let process_file ~config ~output ~output_mode ~embed_errors file =
  let fn, ast = load_file file in
  let ast =
    match ast with
    | Intf sg ->
      let sg = Ast_mapper.drop_ppx_context_sig ~restore:true sg in
      let sg =
        try
          rewrite_signature config (module OCaml_current) sg
          |> migrate_some_signature (module OCaml_current)
        with exn when embed_errors ->
        match Migrate_parsetree_compiler_functions.error_of_exn exn with
        | None -> raise exn
        | Some error ->
          [ Ast_helper.Sig.extension ~loc:Location.none
              (Ast_mapper.extension_of_error error) ]
      in
      Intf (sg, Ast_mapper.add_ppx_context_sig ~tool_name:config.tool_name sg)
    | Impl st ->
      let st = Ast_mapper.drop_ppx_context_str ~restore:true st in
      let st =
        try
          rewrite_structure config (module OCaml_current) st
          |> migrate_some_structure (module OCaml_current)
        with exn when embed_errors ->
        match Migrate_parsetree_compiler_functions.error_of_exn exn with
        | None -> raise exn
        | Some error ->
          [ Ast_helper.Str.extension ~loc:Location.none
              (Ast_mapper.extension_of_error error) ]
      in
      Impl (st, Ast_mapper.add_ppx_context_str ~tool_name:config.tool_name st)
  in
  match output_mode with
  | Dump_ast ->
    with_output ~bin:true output ~f:(fun oc ->
      let ast =
        match ast with
        | Intf (_, sg) -> Ast_io.Intf ((module OCaml_current), sg)
        | Impl (_, st) -> Ast_io.Impl ((module OCaml_current), st)
      in
      Ast_io.to_channel oc fn ast)
  | Pretty_print ->
    with_output output ~f:(fun oc ->
      let ppf = Format.formatter_of_out_channel oc in
      (match ast with
       | Intf (sg, _) -> Pprintast.signature ppf sg
       | Impl (st, _) -> Pprintast.structure ppf st);
      Format.pp_print_newline ppf ())
  | Null ->
    ()

let print_transformations () =
  let print_group name = function
    | [] -> ()
    | names ->
        Printf.printf "%s:\n" name;
        List.iter (Printf.printf "%s\n") names
  in
  all_rewriters ()
  |> List.map rewriter_group_names
  |> List.concat
  |> print_group "Registered Transformations";
  Ppx_derivers.derivers ()
  |> List.map (fun (x, _) -> x)
  |> print_group "Registered Derivers"


let run_as_standalone_driver argv =
  let request_print_transformations = ref false in
  let output = ref None in
  let output_mode = ref Pretty_print in
  let output_mode_arg = ref "" in
  let files = ref [] in
  let embed_errors = ref false in
  let embed_errors_arg = ref "" in
  let spec =
    let fail fmt = Printf.ksprintf (fun s -> raise (Arg.Bad s)) fmt in
    let incompatible a b = fail "%s and %s are incompatible" a b in
    let as_ppx () = fail "--as-ppx must be passed as first argument" in
    let set_embed_errors arg =
      if !output_mode = Null then incompatible !output_mode_arg arg;
      embed_errors := true;
      embed_errors_arg := arg
    in
    let set_output_mode arg mode =
      match !output_mode, mode with
      | Pretty_print, _ ->
        if mode = Null && !embed_errors then
          incompatible !embed_errors_arg arg;
        if mode = Null && !output <> None then
          incompatible "-o" arg;
        output_mode := mode;
        output_mode_arg := arg
      | _, Pretty_print -> assert false
      | Dump_ast, Dump_ast | Null, Null -> ()
      | _ -> incompatible !output_mode_arg arg
    in
    let set_output fn =
      if !output_mode = Null then incompatible !output_mode_arg "-o";
      output := Some fn
    in
    let as_pp () =
      let arg = "--as-pp" in
      set_output_mode arg Dump_ast;
      set_embed_errors arg
    in
    [ "--as-ppx", Arg.Unit as_ppx,
      " Act as a -ppx rewriter"
    ; "--as-pp", Arg.Unit as_pp,
      " Shorthand for: --dump-ast --embed-errors"
    ; "--dump-ast", Arg.Unit (fun () -> set_output_mode "--dump-ast" Dump_ast),
      " Output a binary AST instead of source code"
    ; "--null", Arg.Unit (fun () -> set_output_mode "--null" Null),
      " Output nothing, just report errors"
    ; "-o", Arg.String set_output,
      "FILE Output to this file instead of the standard output"
    ; "--intf", Arg.String (fun fn -> files := (Kind_intf, fn) :: !files),
      "FILE Treat FILE as a .mli file"
    ; "--impl", Arg.String (fun fn -> files := (Kind_impl, fn) :: !files),
      "FILE Treat FILE as a .ml file"
    ; "--embed-errors", Arg.Unit (fun () -> set_embed_errors "--embed-errors"),
      " Embed error reported by rewriters into the AST"
    ; "--print-transformations", Arg.Set request_print_transformations,
      " Print registered transformations in their order of executions"
    ]
  in
  let spec = Arg.align (spec @ registered_args ()) in
  let me = Filename.basename Sys.executable_name in
  let usage = Printf.sprintf "%s [options] [<files>]" me in
  try
    reset_args ();
    Arg.parse_argv argv spec (fun anon ->
      files := (Kind_unknown, anon) :: !files) usage;
    if !request_print_transformations then begin
      print_transformations ();
      exit 0
    end;
    let output = !output in
    let output_mode = !output_mode in
    let embed_errors = !embed_errors in
    let config =
      (* TODO: we could add -I, -L and -g options to populate these fields. *)
      { tool_name    = "migrate_driver"
      ; include_dirs = []
      ; load_path    = []
      ; debug        = false
      ; for_package  = None
      ; extras       = []
      }
    in
    List.iter (process_file ~config ~output ~output_mode ~embed_errors)
      (List.rev !files)
  with exn ->
    Location.report_exception Format.err_formatter exn;
    exit 1

let run_as_ppx_rewriter ?(argv = Sys.argv) () =
  let a = argv in
  let n = Array.length a in
  if n <= 2 then begin
    let me = Filename.basename Sys.executable_name in
    Arg.usage (registered_args ())
      (Printf.sprintf "%s [options] <input ast file> <output ast file>" me);
    exit 2
  end;
  match
    Ast_mapper.apply ~source:a.(n - 2) ~target:a.(n - 1)
      (run_as_ast_mapper (Array.to_list (Array.sub a 1 (n - 3))))
  with
  | () -> exit 0
  | exception (Arg.Bad help) ->
      prerr_endline help;
      exit 1
  | exception exn ->
      Location.report_exception Format.err_formatter exn;
      exit 1

let run_main ?(argv = Sys.argv) () =
  if Array.length argv >= 2 && argv.(1) = "--as-ppx" then
    run_as_ppx_rewriter ~argv ()
  else
    run_as_standalone_driver argv;
  exit 0

end
module Migrate_parsetree_parse : sig 
#1 "migrate_parsetree_parse.mli"
# 1 "src/migrate_parsetree_parse.mli"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(* Parser entry points that migrate to a specified version of OCaml.

   The parser used is the one from current compiler-libs.  The resulting AST is
   then converted to the desired version.

   These parsing functions can raise Migration_errors.
*)

open Migrate_parsetree_versions

val implementation  : 'types ocaml_version -> Lexing.lexbuf -> 'types get_structure
val interface       : 'types ocaml_version -> Lexing.lexbuf -> 'types get_signature
val toplevel_phrase : 'types ocaml_version -> Lexing.lexbuf -> 'types get_toplevel_phrase
val use_file        : 'types ocaml_version -> Lexing.lexbuf -> 'types get_toplevel_phrase list
val core_type       : 'types ocaml_version -> Lexing.lexbuf -> 'types get_core_type
val expression      : 'types ocaml_version -> Lexing.lexbuf -> 'types get_expression
val pattern         : 'types ocaml_version -> Lexing.lexbuf -> 'types get_pattern

end = struct
#1 "migrate_parsetree_parse.ml"
# 1 "src/migrate_parsetree_parse.ml"

(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(* Parser entry points that migrate to a specified version of OCaml.

   The parser used is the one from current compiler-libs.  The resulting AST is
   then converted to the desired version.

   These parsing functions can raise Migration_errors.
*)

open Migrate_parsetree_versions

let implementation version =
  let { copy_structure; _ } = migrate ocaml_current version in
  fun lexbuf -> copy_structure (Parse.implementation lexbuf)

let interface version =
  let { copy_signature; _ } = migrate ocaml_current version in
  fun lexbuf -> copy_signature (Parse.interface lexbuf)

let toplevel_phrase version =
  let { copy_toplevel_phrase; _ } = migrate ocaml_current version in
  fun lexbuf -> copy_toplevel_phrase (Parse.toplevel_phrase lexbuf)

let use_file version =
  let { copy_toplevel_phrase; _ } = migrate ocaml_current version in
  fun lexbuf -> List.map copy_toplevel_phrase (Parse.use_file lexbuf)

let core_type version =
  let { copy_core_type; _ } = migrate ocaml_current version in
  fun lexbuf -> copy_core_type (Parse.core_type lexbuf)

let expression version =
  let { copy_expression; _ } = migrate ocaml_current version in
  fun lexbuf -> copy_expression (Parse.expression lexbuf)

let pattern version =
  let { copy_pattern; _ } = migrate ocaml_current version in
  fun lexbuf -> copy_pattern (Parse.pattern lexbuf)

end
module Migrate_parsetree
= struct
#1 "migrate_parsetree.ml"
# 1 "src/migrate_parsetree.ml"
(**************************************************************************)
(*                                                                        *)
(*                         OCaml Migrate Parsetree                        *)
(*                                                                        *)
(*                             Frédéric Bour                              *)
(*                   Jérémie Dimino, Jane Street Europe                   *)
(*                                                                        *)
(*   Copyright 2017 Institut National de Recherche en Informatique et     *)
(*     en Automatique (INRIA).                                            *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(*$ #use "src/cinaps_helpers" $*)

(* Shared definitions.
   Mostly errors about features missing in older versions. *)
module Def = Migrate_parsetree_def

(* Copy of OCaml parsetrees *)
(*$foreach_version (fun suffix _ ->
    printf "module Ast_%s = Ast_%s\n" suffix suffix
  )*)
module Ast_402 = Ast_402
module Ast_403 = Ast_403
module Ast_404 = Ast_404
module Ast_405 = Ast_405
module Ast_406 = Ast_406
module Ast_407 = Ast_407
module Ast_408 = Ast_408
module Ast_409 = Ast_409
module Ast_410 = Ast_410
(*$*)

(* A module for marshalling/unmarshalling arbitrary versions of Asts *)
module Ast_io = Migrate_parsetree_ast_io

(* Manual migration between versions *)
(*$foreach_version_pair (fun x y ->
    printf "module Migrate_%s_%s = Migrate_parsetree_%s_%s\n" x y x y;
    printf "module Migrate_%s_%s = Migrate_parsetree_%s_%s\n" y x y x;
  )*)
module Migrate_402_403 = Migrate_parsetree_402_403
module Migrate_403_402 = Migrate_parsetree_403_402
module Migrate_403_404 = Migrate_parsetree_403_404
module Migrate_404_403 = Migrate_parsetree_404_403
module Migrate_404_405 = Migrate_parsetree_404_405
module Migrate_405_404 = Migrate_parsetree_405_404
module Migrate_405_406 = Migrate_parsetree_405_406
module Migrate_406_405 = Migrate_parsetree_406_405
module Migrate_406_407 = Migrate_parsetree_406_407
module Migrate_407_406 = Migrate_parsetree_407_406
module Migrate_407_408 = Migrate_parsetree_407_408
module Migrate_408_407 = Migrate_parsetree_408_407
module Migrate_408_409 = Migrate_parsetree_408_409
module Migrate_409_408 = Migrate_parsetree_409_408
module Migrate_409_410 = Migrate_parsetree_409_410
module Migrate_410_409 = Migrate_parsetree_410_409
(*$*)

(* An abstraction of OCaml compiler versions *)
module Versions = Migrate_parsetree_versions

(* All versions are compatible with this signature *)
module type OCaml_version = Versions.OCaml_version

(*$foreach_version (fun suffix _ ->
    printf "module OCaml_%s = Versions.OCaml_%s\n" suffix suffix
  )*)
module OCaml_402 = Versions.OCaml_402
module OCaml_403 = Versions.OCaml_403
module OCaml_404 = Versions.OCaml_404
module OCaml_405 = Versions.OCaml_405
module OCaml_406 = Versions.OCaml_406
module OCaml_407 = Versions.OCaml_407
module OCaml_408 = Versions.OCaml_408
module OCaml_409 = Versions.OCaml_409
module OCaml_410 = Versions.OCaml_410
(*$*)
module OCaml_current = Versions.OCaml_current

(* A Functor taking two OCaml versions and producing a module of functions
   migrating from one to the other. *)
module Convert = Versions.Convert

(* A [Parse] module that migrate ASTs to the desired version of an AST *)
module Parse = Migrate_parsetree_parse

(* Entrypoints for registering rewriters and making a ppx binary *)
module Driver = Migrate_parsetree_driver

(* Aliases for compiler-libs modules that might be shadowed *)
module Compiler_libs = struct
  module Location = Location
  module Longident = Longident

  module type Asttypes = module type of struct include Asttypes end
  module rec Asttypes : Asttypes = Asttypes

  module type Parsetree = module type of struct include Parsetree end
  module rec Parsetree : Parsetree = Parsetree

  module Docstrings = Docstrings
  module Ast_helper = Ast_helper
  module Ast_mapper = Ast_mapper
end

end
module Reason_attributes
= struct
#1 "reason_attributes.ml"
open Migrate_parsetree
open Ast_404
open Location
open Parsetree

(** Kinds of attributes *)
type attributesPartition = {
  arityAttrs : attributes;
  docAttrs : attributes;
  stdAttrs : attributes;
  jsxAttrs : attributes;
  stylisticAttrs : attributes;
  uncurried : bool
}

(** Partition attributes into kinds *)
let rec partitionAttributes ?(partDoc=false) ?(allowUncurry=true) attrs : attributesPartition =
  match attrs with
  | [] ->
    {arityAttrs=[]; docAttrs=[]; stdAttrs=[]; jsxAttrs=[]; stylisticAttrs=[]; uncurried = false}
  | (({txt = "bs"}, PStr []) as attr)::atTl ->
    let partition = partitionAttributes ~partDoc ~allowUncurry atTl in
    if allowUncurry then
      {partition with uncurried = true}
    else {partition with stdAttrs=attr::partition.stdAttrs}
  | (({txt="JSX"}, _) as jsx)::atTl ->
    let partition = partitionAttributes ~partDoc ~allowUncurry atTl in
    {partition with jsxAttrs=jsx::partition.jsxAttrs}
  | (({txt="explicit_arity"}, _) as arity_attr)::atTl
  | (({txt="implicit_arity"}, _) as arity_attr)::atTl ->
    let partition = partitionAttributes ~partDoc ~allowUncurry atTl in
    {partition with arityAttrs=arity_attr::partition.arityAttrs}
  | (({txt="ocaml.text"}, _) as doc)::atTl when partDoc = true ->
    let partition = partitionAttributes ~partDoc ~allowUncurry atTl in
    {partition with docAttrs=doc::partition.docAttrs}
  | (({txt="ocaml.doc"}, _) as doc)::atTl when partDoc = true ->
    let partition = partitionAttributes ~partDoc ~allowUncurry atTl in
    {partition with docAttrs=doc::partition.docAttrs}
  | (({txt="reason.raw_literal"}, _) as attr) :: atTl ->
    let partition = partitionAttributes ~partDoc ~allowUncurry atTl in
    {partition with stylisticAttrs=attr::partition.stylisticAttrs}
  | (({txt="reason.preserve_braces"}, _) as attr) :: atTl ->
    let partition = partitionAttributes ~partDoc ~allowUncurry atTl in
    {partition with stylisticAttrs=attr::partition.stylisticAttrs}
  | atHd :: atTl ->
    let partition = partitionAttributes ~partDoc ~allowUncurry atTl in
    {partition with stdAttrs=atHd::partition.stdAttrs}

let extractStdAttrs attrs =
  (partitionAttributes attrs).stdAttrs

let extract_raw_literal attrs =
  let rec loop acc = function
    | ({txt="reason.raw_literal"},
       PStr [{pstr_desc = Pstr_eval({pexp_desc = Pexp_constant(Pconst_string(text, None))}, _)}])
      :: rest ->
      (Some text, List.rev_append acc rest)
    | [] -> (None, List.rev acc)
    | attr :: rest -> loop (attr :: acc) rest
  in
  loop [] attrs

let without_stylistic_attrs attrs =
  let rec loop acc = function
    | attr :: rest when (partitionAttributes [attr]).stylisticAttrs != [] ->
        loop acc rest
    | [] -> List.rev acc
    | attr :: rest -> loop (attr :: acc) rest
  in
  loop [] attrs

let is_preserve_braces_attr ({txt}, _) =
  txt = "reason.preserve_braces"

let has_preserve_braces_attrs stylisticAttrs =
  (List.filter is_preserve_braces_attr stylisticAttrs) != []

let maybe_remove_stylistic_attrs attrs should_preserve =
  if should_preserve then
    attrs
  else
    List.filter (function
      | ({txt="reason.raw_literal"}, _) -> true
      | _ -> false)
      attrs

end
module Reason_syntax_util : sig 
#1 "reason_syntax_util.mli"
# 1 "reason_syntax_util.cppo.mli"
(* Hello! Welcome to the Reason syntax util logic.

  This file's shared between the Reason repo and the BuckleScript repo. In
  Reason, it's in src/reason-parser. In BuckleScript, it's in
  jscomp/outcome_printer. We periodically copy this file from Reason (the source
  of truth) to BuckleScript, then uncomment the #if #else #end cppo macros you
  see in the file. That's because BuckleScript's on OCaml 4.02 while Reason's on
  4.04; so the #if macros surround the pieces of code that are different between
  the two compilers.

  When you modify this file, please make sure you're not dragging in too many
  things. You don't necessarily have to test the file on both Reason and
  BuckleScript; ping @chenglou and a few others and we'll keep them synced up by
  patching the right parts, through the power of types(tm)
*)
open Migrate_parsetree.Ast_404

val ml_to_reason_swap : string -> string

val escape_string : string -> string

(* Everything below is used by reason repo but not the BuckleScript repo *)


# 26 "reason_syntax_util.cppo.mli"
val reason_to_ml_swap : string -> string

module TrailingCommaMarker : sig val char : char val string : string end
module EOLMarker : sig val char : char val string : string end

val pick_while : ('a -> bool) -> 'a list -> 'a list * 'a list

val split_by : ?keep_empty:bool -> (char -> bool) -> string -> string list

val processLineEndingsAndStarts : string -> string

val isLineComment : string -> bool

val remove_stylistic_attrs_mapper : Ast_mapper.mapper

val escape_stars_slashes_mapper :
  Ast_mapper.mapper -> Ast_mapper.mapper

val reason_to_ml_swap_operator_mapper :
  Ast_mapper.mapper -> Ast_mapper.mapper

val ml_to_reason_swap_operator_mapper :
  Ast_mapper.mapper -> Ast_mapper.mapper

val attribute_exists : 'a -> ('a Asttypes.loc * 'b) list -> bool

val attributes_conflicted :
  'a -> 'a -> ('a Asttypes.loc * 'b) list -> bool

val normalized_attributes :
  'a ->
  ('a Asttypes.loc * 'b) list -> ('a Asttypes.loc * 'b) list

val apply_mapper_to_structure :
  Parsetree.structure -> Ast_mapper.mapper -> Parsetree.structure

val apply_mapper_to_signature :
  Parsetree.signature -> Ast_mapper.mapper -> Parsetree.signature

val apply_mapper_to_type :
  Parsetree.core_type -> Ast_mapper.mapper -> Parsetree.core_type

val apply_mapper_to_expr :
  Parsetree.expression -> Ast_mapper.mapper -> Parsetree.expression

val apply_mapper_to_pattern :
  Parsetree.pattern -> Ast_mapper.mapper -> Parsetree.pattern

val apply_mapper_to_toplevel_phrase :
  Parsetree.toplevel_phrase -> Ast_mapper.mapper -> Parsetree.toplevel_phrase

val apply_mapper_to_use_file : Parsetree.toplevel_phrase list ->
  Ast_mapper.mapper -> Parsetree.toplevel_phrase list

val map_first : ('a -> 'a) -> 'a list -> 'a list

val map_last : ('a -> 'a) -> 'a list -> 'a list

val location_is_before : Location.t -> Location.t -> bool

val location_contains : Location.t -> Location.t -> bool

val split_compiler_error : Location.error -> Location.t * string

val explode_str : string -> char list

# 93 "reason_syntax_util.cppo.mli"
module Clflags : sig
  include module type of Clflags

# 99 "reason_syntax_util.cppo.mli"
end

end = struct
#1 "reason_syntax_util.ml"
# 1 "reason_syntax_util.cppo.ml"
(* Hello! Welcome to the Reason syntax util logic.

  This file's shared between the Reason repo and the BuckleScript repo. In
  Reason, it's in src/reason-parser. In BuckleScript, it's in
  jscomp/outcome_printer. We periodically copy this file from Reason (the source
  of truth) to BuckleScript, then uncomment the #if #else #end cppo macros you
  see in the file. That's because BuckleScript's on OCaml 4.02 while Reason's on
  4.04; so the #if macros surround the pieces of code that are different between
  the two compilers.

  When you modify this file, please make sure you're not dragging in too many
  things. You don't necessarily have to test the file on both Reason and
  BuckleScript; ping @chenglou and a few others and we'll keep them synced up by
  patching the right parts, through the power of types(tm)
*)

# 18 "reason_syntax_util.cppo.ml"
open Migrate_parsetree
open Ast_404

# 22 "reason_syntax_util.cppo.ml"
open Asttypes
open Ast_mapper
open Parsetree
open Longident

(* Rename labels in function definition/application and records *)
let rename_labels = ref false

(** Check to see if the string `s` is made up of `keyword` and zero or more
    trailing `_` characters. *)
let potentially_conflicts_with ~keyword s =
  let s_length = String.length s in
  let keyword_length = String.length keyword in
  (* It can't be a match if s is shorter than keyword *)
  s_length >= keyword_length && (
    try
      (* Ensure s starts with keyword... *)
      for i = 0 to keyword_length - 1 do
        if keyword.[i] <> s.[i] then raise Exit;
      done;
      (* ...and contains nothing else except trailing _ characters *)
      for i = keyword_length to s_length - 1 do
        if s.[i] <> '_' then raise Exit;
      done;
      (* If we've made it this far there's a potential conflict *)
      true
    with
    | Exit -> false
  )

(** Add/remove an appropriate suffix when mangling potential keywords *)
let string_add_suffix x = x ^ "_"
let string_drop_suffix x = String.sub x 0 (String.length x - 1)

(** What do these *_swap functions do? Here's an example: Reason code uses `!`
    for logical not, while ocaml uses `not`. So, for converting between reason
    and ocaml syntax, ocaml `not` converts to `!`, reason `!` converts to
    `not`.

    In more complicated cases where a reserved keyword exists in one syntax but
    not the other, these functions translate any potentially conflicting
    identifier into the same identifier with a suffix attached, or remove the
    suffix when converting back. Two examples:

    reason to ocaml:

    pub: invalid in reason to begin with
    pub_: pub
    pub__: pub_

    ocaml to reason:

    pub: pub_
    pub_: pub__
    pub__: pub___

    =====

    reason to ocaml:

    match: match_
    match_: match__
    match__: match___

    ocaml to reason:

    match: invalid in ocaml to begin with
    match_: match
    match__: match_
*)

let reason_to_ml_swap = function
  | "!" -> "not"
  | "^" -> "!"
  | "++" -> "^"
  | "===" -> "=="
  | "==" -> "="
  (* ===\/ and !==\/ are not representable in OCaml but
   * representable in Reason
   *)
  | "\\!==" -> "!=="
  |  "\\===" -> "==="
  | "!=" -> "<>"
  | "!==" -> "!="
  | x when (
    potentially_conflicts_with ~keyword:"match" x
    || potentially_conflicts_with ~keyword:"method" x
    || potentially_conflicts_with ~keyword:"private" x
    || potentially_conflicts_with ~keyword:"not" x) -> string_add_suffix x
  | x when (
    potentially_conflicts_with ~keyword:"switch_" x
    || potentially_conflicts_with ~keyword:"pub_" x
    || potentially_conflicts_with ~keyword:"pri_" x) -> string_drop_suffix x
  | everything_else -> everything_else

let ml_to_reason_swap = function
  | "not" -> "!"
  | "!" -> "^"
  | "^" -> "++"
  | "==" -> "==="
  | "=" -> "=="
  (* ===\/ and !==\/ are not representable in OCaml but
   * representable in Reason
   *)
  | "!==" -> "\\!=="
  |  "===" -> "\\==="
  | "<>" -> "!="
  | "!=" -> "!=="
  | x when (
    potentially_conflicts_with ~keyword:"match_" x
    || potentially_conflicts_with ~keyword:"method_" x
    || potentially_conflicts_with ~keyword:"private_" x
    || potentially_conflicts_with ~keyword:"not_" x) -> string_drop_suffix x
  | x when (
    potentially_conflicts_with ~keyword:"switch" x
    || potentially_conflicts_with ~keyword:"pub" x
    || potentially_conflicts_with ~keyword:"pri" x) -> string_add_suffix x
  | everything_else -> everything_else

let escape_string str =
  let buf = Buffer.create (String.length str) in
  String.iter (fun c ->
      match c with
      | '\t' -> Buffer.add_string buf "\\t"
      | '\r' -> Buffer.add_string buf "\\r"
      | '\n' -> Buffer.add_string buf "\\n"
      | '\\' -> Buffer.add_string buf "\\\\"
      | '"'  -> Buffer.add_string buf "\\\""
      | c when c < ' ' -> Buffer.add_string buf (Char.escaped c)
      | c -> Buffer.add_char buf c
    ) str;
  Buffer.contents buf

(* the stuff below contains side-effects and are not used by BuckleScript's
  vendored version of reason_syntax_util.ml. So we can neglect it *)


# 160 "reason_syntax_util.cppo.ml"
(*
    UTF-8 characters are encoded like this (most editors are UTF-8)
    0xxxxxxx (length 1)
    110xxxxx 10xxxxxx (length 2)
    1110xxxx 10xxxxxx 10xxxxxx (length 3)
    11110xxx 10xxxxxx 10xxxxxx 10xxxxxx (length 4)
   Numbers over 127 cannot be encoded in UTF in a single byte, so they use two
  bytes. That means we can use any characters between 128-255 to encode special
  characters that would never be written by the user and thus never be confused
  for our special formatting characters.
*)
(* Logic for handling special behavior that only happens if things break. We
  use characters that will never appear in the printed output if actually
  written in source code. The OCaml formatter will replace them with the escaped
  versions When moving to a new formatter, the formatter may *not* escape these
  an in that case we need the formatter to accept blacklists of characters to
  escape, but more likely is that the new formatter allows us to do these kinds
  of if-break logic without writing out special characters for post-processing.
*)
module TrailingCommaMarker = struct
  (* TODO: You can detect failed parsings by *NOT* omitting the final comma *ever*. *)
  (* A trailing comma will only be rendered if it is not immediately
   * followed by a closing paren, bracket, or brace *)
  let char = Char.chr 249 (* ˘ *)
  let string = String.make 1 char
end

(* Special character marking the end of a line. Nothing should be printed
 * after this marker. Example usage: // comments shouldn't have content printed
 * at the end of the comment. By attaching an EOLMarker.string at the end of the
 * comment our postprocessing step will ensure a linebreak at the position
 * of the marker. *)
module EOLMarker = struct
  let char = Char.chr 248
  let string = String.make 1 char
end

(** [is_prefixed prefix i str] checks if prefix is the prefix of str
  * starting from position i
  *)
let is_prefixed prefix str i =
  let len = String.length prefix in
  let j = ref 0 in
  while !j < len && String.unsafe_get prefix !j =
                    String.unsafe_get str (i + !j) do
    incr j
  done;
  (!j = len)

(**
 * pick_while returns a tuple where first element is longest prefix (possibly empty) of the list of elements that satisfy p
 * and second element is the remainder of the list
 *)
let rec pick_while p = function
  | [] -> [], []
  | hd::tl when p hd ->
                  let (satisfied, not_satisfied) = pick_while p tl in
                  hd :: satisfied, not_satisfied
  | l -> ([], l)


(** [find_substring sub str i]
    returns the smallest [j >= i] such that [sub = str.[j..length sub - 1]]
    raises [Not_found] if there is no such j
    behavior is not defined if [sub] is the empty string
*)
let find_substring sub str i =
  let len = String.length str - String.length sub in
  let found = ref false and i = ref i in
  while not !found && !i <= len do
    if is_prefixed sub str !i then
      found := true
    else
      incr i;
  done;
  if not !found then
    raise Not_found;
  !i

(** [replace_string old_str new_str str] replaces old_str to new_str in str *)
let replace_string old_str new_str str =
  match find_substring old_str str 0 with
  | exception Not_found -> str
  | occurrence ->
    let buffer = Buffer.create (String.length str + 15) in
    let rec loop i j =
      Buffer.add_substring buffer str i (j - i);
      Buffer.add_string buffer new_str;
      let i = j + String.length old_str in
      match find_substring old_str str i with
      | j -> loop i j
      | exception Not_found ->
        Buffer.add_substring buffer str i (String.length str - i)
    in
    loop 0 occurrence;
    Buffer.contents buffer

(* This is lifted from https://github.com/bloomberg/bucklescript/blob/14d94bb9c7536b4c5f1208c8e8cc715ca002853d/jscomp/ext/ext_string.ml#L32
  Thanks @bobzhang and @hhugo! *)
let split_by ?(keep_empty=false) is_delim str =
  let len = String.length str in
  let rec loop acc last_pos pos =
    if pos = -1 then
      if last_pos = 0 && not keep_empty then
        (*
           {[ split " test_unsafe_obj_ffi_ppx.cmi" ~keep_empty:false ' ']}
        *)
        acc
      else
        String.sub str 0 last_pos :: acc
    else
      if is_delim str.[pos] then
        let new_len = (last_pos - pos - 1) in
        if new_len <> 0 || keep_empty then
          let v = String.sub str (pos + 1) new_len in
          loop ( v :: acc)
            pos (pos - 1)
        else loop acc pos (pos - 1)
    else loop acc last_pos (pos - 1)
  in
  loop [] len (len - 1)

let rec trim_right_idx str idx =
  if idx = -1 then 0
  else
    match String.get str idx with
    | '\t' | ' ' | '\n' | '\r' -> trim_right_idx str (idx - 1)
    | _ -> idx + 1

let trim_right str =
  let length = String.length str in
  if length = 0 then ""
  else
    let index = trim_right_idx str (length - 1) in
    if index = 0 then ""
    else if index = length then
      str
    else String.sub str 0 index


let processLine line =
  let rightTrimmed = trim_right line in
  let trimmedLen = String.length rightTrimmed in
  if trimmedLen = 0 then
    rightTrimmed
  else
    let segments =
      split_by
        ~keep_empty:false
        (fun c -> c = TrailingCommaMarker.char)
        rightTrimmed in
    (* Now we concat the portions back together without any trailing comma markers
      - except we detect if there was a final trailing comma marker which we know
      must be before a newline so we insert a regular comma. This achieves
      "intelligent" trailing commas. *)
    let hadTrailingCommaMarkerBeforeNewline =
      String.get rightTrimmed (trimmedLen - 1) = TrailingCommaMarker.char
    in
    let almostEverything = String.concat "" segments in
    let lineBuilder = if hadTrailingCommaMarkerBeforeNewline then
      almostEverything ^ ","
    else
      almostEverything
    in
    (* Ensure EOLMarker.char is replaced by a newline *)
    split_by ~keep_empty:false (fun c -> c = EOLMarker.char) lineBuilder
    |> List.map trim_right
    |> String.concat "\n"

let processLineEndingsAndStarts str =
  split_by ~keep_empty:true (fun x -> x = '\n') str
  |> List.map processLine
  |> String.concat "\n"
  |> String.trim

let isLineComment str =
  (* true iff the first \n is the last character *)
  match String.index str '\n' with
  | exception Not_found -> false
  | n -> n = String.length str - 1

let map_lident f lid =
  let swapped = match lid.txt with
    | Lident s -> Lident (f s)
    | Ldot(longPrefix, s) -> Ldot(longPrefix, f s)
    | Lapply (y,s) -> Lapply (y, s)
  in
  { lid with txt = swapped }

let map_arg_label f = function
  | Nolabel -> Nolabel
  | Labelled lbl ->
    Labelled (f lbl)
  | Optional lbl ->
    Optional (f lbl)

let map_class_expr f class_expr =
  { class_expr
  with pcl_desc = match class_expr.pcl_desc with
    | Pcl_constr (lid, ts) ->
      Pcl_constr (map_lident f lid, ts)
    | e -> e
  }

let map_class_type f class_type =
  { class_type
  with pcty_desc = match class_type.pcty_desc with
  | Pcty_constr (lid, ct) ->
    Pcty_constr (map_lident f lid, ct)
  | Pcty_arrow (arg_lbl, ct, cls_type) ->
    Pcty_arrow (map_arg_label f arg_lbl, ct, cls_type)
  | x -> x
  }

let map_core_type f typ =
  { typ with ptyp_desc =
    match typ.ptyp_desc with
    | Ptyp_var var -> Ptyp_var (f var)
    | Ptyp_arrow (lbl, t1, t2) ->
      let lbl' = match lbl with
        | Labelled s when !rename_labels -> Labelled (f s)
        | Optional s when !rename_labels -> Optional (f s)
        | lbl -> lbl
      in
      Ptyp_arrow (lbl', t1, t2)
    | Ptyp_constr (lid, typs) ->
      Ptyp_constr (map_lident f lid, typs)
    | Ptyp_object (fields, closed_flag) when !rename_labels ->
      Ptyp_object (List.map (fun (s, attrs, typ) -> f s, attrs, typ) fields, closed_flag)
    | Ptyp_class (lid, typs) ->
      Ptyp_class (map_lident f lid, typs)
    | Ptyp_alias (typ, s) ->
      Ptyp_alias (typ, f s)
    | Ptyp_variant (rfs, closed, lbls) ->
      Ptyp_variant (List.map (function
        | Rtag (lbl, attrs, b, cts) ->
          Rtag (f lbl, attrs, b, cts)
        | t -> t) rfs, closed, lbls)
    | Ptyp_poly (vars, typ) ->
      Ptyp_poly (List.map f vars, typ)
    | Ptyp_package (lid, typs) ->
      Ptyp_package (map_lident f lid, List.map (fun (lid, typ) -> (map_lident f lid, typ)) typs)
    | other -> other
  }

(** identifier_mapper maps all identifiers in an AST with a mapping function f
  this is used by swap_operator_mapper right below, to traverse the whole AST
  and swapping the symbols listed above.
  *)
let identifier_mapper f super =
let map_fields fields = List.map(fun (lid,x) -> (map_lident f lid, x)) fields in
let map_name ({txt} as name) = {name with txt=(f txt)} in
let map_lid lid = map_lident f lid in
let map_label label = map_arg_label f label in
{ super with
  expr = begin fun mapper expr ->
    let expr =
      match expr with
        | { pexp_desc = Pexp_ident lid } ->
          { expr with pexp_desc = Pexp_ident (map_lid lid) }
        | { pexp_desc = Pexp_fun (label, eo, pat, e) } when !rename_labels ->
          { expr with pexp_desc = Pexp_fun (map_label label, eo, pat, e) }
        | { pexp_desc = Pexp_apply (e, args) } when !rename_labels ->
          { expr with
            pexp_desc = Pexp_apply (e, List.map (fun (label, e) ->
            (map_label label), e) args) }
        | { pexp_desc = Pexp_variant (s, e) } ->
          { expr with
            pexp_desc = Pexp_variant (f s, e) }
        | { pexp_desc = Pexp_record (fields, closed) } when !rename_labels ->
          { expr with pexp_desc = Pexp_record (map_fields fields, closed) }
        | { pexp_desc = Pexp_field (e, lid) } when !rename_labels ->
          { expr with
            pexp_desc = Pexp_field (e, map_lid lid) }
        | { pexp_desc = Pexp_setfield (e1, lid, e2) } when !rename_labels ->
          { expr with
            pexp_desc = Pexp_setfield (e1, map_lid lid, e2) }
        | { pexp_desc = Pexp_send (e, s) } ->
          { expr with
            pexp_desc = Pexp_send (e, f s) }
        | { pexp_desc = Pexp_new lid } ->
          { expr with
            pexp_desc = Pexp_new (map_lid lid) }
        | { pexp_desc = Pexp_setinstvar (name, e) } ->
          { expr with
            pexp_desc = Pexp_setinstvar (map_name name, e) }
        | { pexp_desc = Pexp_override name_exp_list } ->
          let name_exp_list = List.map (fun (name,e) -> (map_name name, e)) name_exp_list in
          { expr with
            pexp_desc = Pexp_override name_exp_list }
        | { pexp_desc = Pexp_newtype (s, e) } ->
          { expr with
            pexp_desc = Pexp_newtype (f s, e) }
        | { pexp_desc = Pexp_open (override, lid, e) } ->
          { expr with
            pexp_desc = Pexp_open (override, map_lid lid, e) }
        | _ -> expr
    in
    super.expr mapper expr
  end;
  pat = begin fun mapper pat ->
    let pat =
      match pat with
        | { ppat_desc = Ppat_var name } ->
          { pat with ppat_desc = Ppat_var (map_name name) }
        | { ppat_desc = Ppat_alias (p, name) } ->
          { pat with ppat_desc = Ppat_alias (p, map_name name) }
        | { ppat_desc = Ppat_variant (s, po) } ->
          { pat with
            ppat_desc = Ppat_variant (f s, po) }
        | { ppat_desc = Ppat_record (fields, closed) } when !rename_labels ->
          { pat with
            ppat_desc = Ppat_record (map_fields fields, closed) }
        | { ppat_desc = Ppat_type lid } ->
          { pat with ppat_desc = Ppat_type (map_lid lid) }
        | _ -> pat
    in
    super.pat mapper pat
  end;
  value_description = begin fun mapper desc ->
    let desc' =
      { desc with
        pval_name = map_name  desc.pval_name }
    in
    super.value_description mapper desc'
  end;
  type_declaration = begin fun mapper type_decl ->
    let type_decl' =
      { type_decl with ptype_name = map_name type_decl.ptype_name }
    in
    let type_decl'' = match type_decl'.ptype_kind with
    | Ptype_record lst when !rename_labels ->
      { type_decl'
        with ptype_kind = Ptype_record (List.map (fun lbl ->
          { lbl with pld_name = map_name lbl.pld_name })
        lst) }
    | _ -> type_decl'
    in
    super.type_declaration mapper type_decl''
  end;
  typ = begin fun mapper typ ->
    super.typ mapper (map_core_type f typ)
  end;
  class_declaration = begin fun mapper class_decl ->
    let class_decl' =
      { class_decl
      with pci_name = map_name class_decl.pci_name
        ;  pci_expr = map_class_expr f class_decl.pci_expr
         }
    in
    super.class_declaration mapper class_decl'
  end;
  class_field = begin fun mapper class_field ->
    let class_field_desc' = match class_field.pcf_desc with
    | Pcf_inherit (ovf, e, lo) ->
      Pcf_inherit (ovf, map_class_expr f e, lo)
    | Pcf_val (lbl, mut, kind) ->
      Pcf_val ({lbl with txt = f lbl.txt}, mut, kind)
    | Pcf_method (lbl, priv, kind) ->
      Pcf_method ({lbl with txt = f lbl.txt}, priv, kind)
    | x -> x
    in
    super.class_field mapper { class_field with pcf_desc = class_field_desc' }
  end;
  class_type_field = begin fun mapper class_type_field ->
    let class_type_field_desc' = match class_type_field.pctf_desc with
    | Pctf_inherit class_type ->
      Pctf_inherit (map_class_type f class_type)
    | Pctf_val (lbl, mut, vf, ct) ->
      Pctf_val (f lbl, mut, vf, ct)
    | Pctf_method (lbl, pf, vf, ct) ->
      Pctf_method (f lbl, pf, vf, ct)
    | x -> x
    in
    super.class_type_field mapper
      { class_type_field
      with pctf_desc = class_type_field_desc' }
  end;
  class_type_declaration = begin fun mapper class_type_decl ->
    let class_type_decl' =
      { class_type_decl
      with pci_name = map_name class_type_decl.pci_name }
    in
    super.class_type_declaration mapper class_type_decl'
  end;
  module_type_declaration = begin fun mapper module_type_decl ->
    let module_type_decl' =
      { module_type_decl
        with pmtd_name = map_name module_type_decl.pmtd_name }
    in
    super.module_type_declaration mapper module_type_decl'
  end;
}

let remove_stylistic_attrs_mapper_maker super =
  let open Ast_404 in
  let open Ast_mapper in
{ super with
  expr = begin fun mapper expr ->
    let {Reason_attributes.stylisticAttrs; arityAttrs; docAttrs; stdAttrs; jsxAttrs} =
      Reason_attributes.partitionAttributes ~allowUncurry:false expr.pexp_attributes
    in
    let expr = if stylisticAttrs != [] then
      { expr with pexp_attributes = arityAttrs @ docAttrs @ stdAttrs @ jsxAttrs }
    else expr
    in
    super.expr mapper expr
  end;
  pat = begin fun mapper pat ->
    let {Reason_attributes.stylisticAttrs; arityAttrs; docAttrs; stdAttrs; jsxAttrs} =
      Reason_attributes.partitionAttributes ~allowUncurry:false pat.ppat_attributes
    in
    let pat = if stylisticAttrs != [] then
      { pat with ppat_attributes = arityAttrs @ docAttrs @ stdAttrs @ jsxAttrs }
    else pat
    in
    super.pat mapper pat
  end;
}

let remove_stylistic_attrs_mapper =
  remove_stylistic_attrs_mapper_maker Ast_mapper.default_mapper

(** escape_stars_slashes_mapper escapes all stars and slashes in an AST *)
let escape_stars_slashes_mapper =
  let escape_stars_slashes str =
    if String.contains str '/' then
      replace_string "/*" "/\\*" @@
      replace_string "*/" "*\\/" @@
      replace_string "//" "/\\/" @@
      str
    else
      str
  in
  identifier_mapper escape_stars_slashes

(* To be used in parser, transform a token into an ast node with different identifier
 *)
let reason_to_ml_swap_operator_mapper = identifier_mapper reason_to_ml_swap

(* To be used in printer, transform an ast node into a token with different identifier
 *)
let ml_to_reason_swap_operator_mapper = identifier_mapper ml_to_reason_swap

(* attribute_equals tests an attribute is txt
 *)
let attribute_equals to_compare = function
  | ({txt}, _) -> txt = to_compare

(* attribute_exists tests if an attribute exists in a list
 *)
let attribute_exists txt attributes = List.exists (attribute_equals txt) attributes

(* conflicted_attributes tests if both attribute1 and attribute2
 * exist
 *)
let attributes_conflicted attribute1 attribute2 attributes =
  attribute_exists attribute1 attributes &&
  attribute_exists attribute2 attributes

(* normalized_attributes removes attribute from a list of attributes
 *)
let normalized_attributes attribute attributes =
  List.filter (fun x -> not (attribute_equals attribute x)) attributes

(* apply_mapper family applies an ast_mapper to an ast *)
let apply_mapper_to_structure s mapper = mapper.structure mapper s
let apply_mapper_to_signature s mapper = mapper.signature mapper s
let apply_mapper_to_type      s mapper = mapper.typ       mapper s
let apply_mapper_to_expr      s mapper = mapper.expr      mapper s
let apply_mapper_to_pattern   s mapper = mapper.pat       mapper s

let apply_mapper_to_toplevel_phrase toplevel_phrase mapper =
  match toplevel_phrase with
  | Ptop_def x -> Ptop_def (apply_mapper_to_structure x mapper)
  | x -> x

let apply_mapper_to_use_file use_file mapper =
  List.map (fun x -> apply_mapper_to_toplevel_phrase x mapper) use_file

let map_first f = function
  | [] -> invalid_arg "Syntax_util.map_first: empty list"
  | x :: xs -> f x :: xs

let map_last f l =
  match List.rev l with
  | [] -> invalid_arg "Syntax_util.map_last: empty list"
  | x :: xs -> List.rev (f x :: xs)

let location_is_before loc1 loc2 =
  let open Location in
  loc1.loc_end.Lexing.pos_cnum <= loc2.loc_start.Lexing.pos_cnum

let location_contains loc1 loc2 =
  let open Location in
  loc1.loc_start.Lexing.pos_cnum <= loc2.loc_start.Lexing.pos_cnum &&
  loc1.loc_end.Lexing.pos_cnum >= loc2.loc_end.Lexing.pos_cnum

# 662 "reason_syntax_util.cppo.ml"
let split_compiler_error (err : Location.error) =
  (err.loc, err.msg)

# 666 "reason_syntax_util.cppo.ml"
let explode_str str =
  let rec loop acc i =
    if i < 0 then acc else loop (str.[i] :: acc) (i - 1)
  in
    loop [] (String.length str - 1)


# 674 "reason_syntax_util.cppo.ml"
module Clflags = struct
  include Clflags

# 680 "reason_syntax_util.cppo.ml"
end

end
module Reason_comment
= struct
#1 "reason_comment.ml"
open Location

type category =
  | EndOfLine
  | SingleLine
  | Regular

let string_of_category = function
  | Regular -> "Regular"
  | EndOfLine -> "End of Line"
  | SingleLine -> "SingleLine"

type t = {
  location: Location.t;
  category: category;
  text: string;
}

let category t = t.category

let location t = t.location

let dump ppf t =
  Format.fprintf ppf "%d (%d:%d)-%d (%d:%d) -- %s:||%s||"
    t.location.loc_start.pos_cnum
    t.location.loc_start.pos_lnum
    (t.location.loc_start.pos_cnum - t.location.loc_start.pos_bol)
    t.location.loc_end.pos_cnum
    t.location.loc_end.pos_lnum
    (t.location.loc_end.pos_cnum - t.location.loc_end.pos_bol)
    (string_of_category t.category)
    t.text

let dump_list ppf list =
  List.iter (Format.fprintf ppf "%a\n" dump) list

let wrap t =
  match t.text with
  | "" | "*" -> "/***/"
  | txt when Reason_syntax_util.isLineComment txt ->
    "//"
    (* single line comments of the form `// comment` have a `\n` at the end *)
    ^ (String.sub txt 0 (String.length txt - 1))
    ^ Reason_syntax_util.EOLMarker.string
  | txt when txt.[0] = '*' && txt.[1] <> '*' ->
    (*CHECK: this comment printing seems fishy.
      It apply to invalid docstrings.
      In this case, it will add a spurious '*'.
      E.g. /**
            * bla */
      In an invalid context is turned into
           /***
            * bla */
      I think this case should be removed.
    *)
    "/**" ^ txt ^ "*/"
  | txt -> "/*" ^ txt ^ "*/"

let is_doc t =
  String.length t.text > 0 && t.text.[0] == '*'

let make ~location category text =
  { text; category; location }

let isLineComment {category; text} = match category with
  | SingleLine -> Reason_syntax_util.isLineComment text
  | EndOfLine | Regular -> false

end
module Printer_maker
= struct
#1 "printer_maker.ml"
open Migrate_parsetree

type parse_itype = [ `ML | `Reason | `Binary | `BinaryReason | `Auto ]
type print_itype = [ `ML | `Reason | `Binary | `BinaryReason | `AST | `None ]

exception Invalid_config of string

module type PRINTER =
    sig
        type t

        val parse : use_stdin:bool ->
                    parse_itype ->
                    string ->
                    ((t * Reason_comment.t list) * bool)


        val print : print_itype ->
                    string ->
                    bool ->
                    out_channel ->
                    Format.formatter ->
                    ((t * Reason_comment.t list) -> unit)
    end

let err s = raise (Invalid_config s)

let prepare_output_file name =
    match name with
    | Some name -> open_out_bin name
    | None -> set_binary_mode_out stdout true; stdout

let close_output_file output_file output_chan =
    match output_file with
    | Some _ -> close_out output_chan
    | None -> ()

let ocamlBinaryParser use_stdin filename =
  let chan =
    match use_stdin with
      | true -> stdin
      | false ->
          let file_chan = open_in filename in
          seek_in file_chan 0;
          file_chan
  in
  match Ast_io.from_channel chan with
  | Result.Error _ -> assert false
  | Result.Ok (_, Ast_io.Impl ((module Version), ast)) ->
    let module Convert = Convert(Version)(OCaml_404) in
    ((Obj.magic (Convert.copy_structure ast), []), true, false)
  | Result.Ok (_, Ast_io.Intf ((module Version), ast)) ->
    let module Convert = Convert(Version)(OCaml_404) in
    ((Obj.magic (Convert.copy_signature ast), []), true, true)

let reasonBinaryParser use_stdin filename =
  let chan =
    match use_stdin with
      | true -> stdin
      | false ->
          let file_chan = open_in filename in
          seek_in file_chan 0;
          file_chan
  in
  let (_, _, ast, comments, parsedAsML, parsedAsInterface) = input_value chan in
  ((ast, comments), parsedAsML, parsedAsInterface)

end
module Reason_config
= struct
#1 "reason_config.ml"
(**
 * Copyright (c) 2015-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *)
 
let recoverable = ref false

let configure ~r = (
  recoverable := r;
)

end
module Ocaml_util
= struct
#1 "ocaml_util.ml"
let warn_latin1 lexbuf =
  Location.deprecated (Location.curr lexbuf) 
    "ISO-Latin1 characters in identifiers"

let print_loc ppf loc =
  Location.print_error ppf loc

let print_error loc f ppf x =
  let error = Location.error_of_printer loc f x in
  Location.report_error ppf error

end
module Reason_errors : sig 
#1 "reason_errors.mli"
(* There are three main categories of error:
   - _lexer errors_, thrown by Reason_lexer when the source **text is malformed**
     and no token can be produced
   - _concrete parsing errors_, thrown by the menhir parser / parsing loop
     when a **token is unexpected**
   - _abstract parsing errors_, thrown by hand-written semantic actions or
     further AST checks, when the source text was incorrect but this restriction
     was too fine to be captured by the grammar rules
*)

open Migrate_parsetree.Ast_404

type lexing_error =
  | Illegal_character of char
  | Illegal_escape of string
  | Unterminated_comment of Location.t
  | Unterminated_string
  | Unterminated_string_in_comment of Location.t * Location.t
  | Keyword_as_label of string
  | Literal_overflow of string
  | Invalid_literal of string

type ast_error =
  | Not_expecting of Location.t * string
  | Other_syntax_error of string
  | Variable_in_scope of Location.t * string
  | Applicative_path of Location.t

type parsing_error = string

type reason_error =
  | Lexing_error of lexing_error
  | Parsing_error of parsing_error
  | Ast_error of ast_error

exception Reason_error of reason_error * Location.t

val raise_error : reason_error -> Location.t -> unit
val raise_fatal_error : reason_error -> Location.t -> 'a

val recover_non_fatal_errors : (unit -> 'a) ->
  ('a, exn) Result.result * (reason_error * Location.t) list

val recover_parser_error :
  (Location.t -> string -> 'a) -> Location.t -> string -> 'a

val report_error : Format.formatter -> loc:Location.t -> reason_error -> unit

val error_extension_node_from_recovery :
  Location.t -> string -> string Location.loc * Parsetree.payload

val error_extension_node :
  Location.t -> string -> string Location.loc * Parsetree.payload


end = struct
#1 "reason_errors.ml"
(* There are three main categories of error:
   - _lexer errors_, thrown by Reason_lexer when the source **text is malformed**
     and no token can be produced
   - _concrete parsing errors_, thrown by the menhir parser / parsing loop
     when a **token is unexpected**
   - _abstract parsing errors_, thrown by hand-written semantic actions or
     further AST checks, when the source text was incorrect but this restriction
     was too fine to be captured by the grammar rules

   A fourth case is when unknown / unexpected error occurs.
*)

open Format

type lexing_error =
  | Illegal_character of char
  | Illegal_escape of string
  | Unterminated_comment of Location.t
  | Unterminated_string
  | Unterminated_string_in_comment of Location.t * Location.t
  | Keyword_as_label of string
  | Literal_overflow of string
  | Invalid_literal of string

type ast_error =
  | Not_expecting of Location.t * string
  | Other_syntax_error of string
  | Variable_in_scope of Location.t * string
  | Applicative_path of Location.t

type parsing_error = string

type reason_error =
  | Lexing_error of lexing_error
  | Parsing_error of parsing_error
  | Ast_error of ast_error

exception Reason_error of reason_error * Location.t

let catch_errors
  : (reason_error * Location.t) list ref option ref
  = ref None

let raise_error error loc =
  match !catch_errors with
  | None -> raise (Reason_error (error, loc))
  | Some caught -> caught := (error, loc) :: !caught

let raise_fatal_error error loc =
  raise (Reason_error (error, loc))

let recover_non_fatal_errors f =
  let catch_errors0 = !catch_errors in
  let errors = ref [] in
  catch_errors := Some errors;
  let result =
    match f () with
    | x -> Result.Ok x
    | exception exn -> Result.Error exn
  in
  catch_errors := catch_errors0;
  (result, List.rev !errors)

(* Report lexing errors *)

let format_lexing_error ppf = function
  | Illegal_character c ->
      fprintf ppf "Illegal character (%s)" (Char.escaped c)
  | Illegal_escape s ->
      fprintf ppf "Illegal backslash escape in string or character (%s)" s
  | Unterminated_comment _ ->
      fprintf ppf "Comment not terminated"
  | Unterminated_string ->
      fprintf ppf "String literal not terminated"
  | Unterminated_string_in_comment (_, loc) ->
      fprintf ppf "This comment contains an unterminated string literal@.\
                   %aString literal begins here"
        Ocaml_util.print_loc loc
  | Keyword_as_label kwd ->
      fprintf ppf "`%s' is a keyword, it cannot be used as label name" kwd
  | Literal_overflow ty ->
      fprintf ppf "Integer literal exceeds the range of representable \
                   integers of type %s" ty
  | Invalid_literal s ->
      fprintf ppf "Invalid literal %s" s

let format_parsing_error ppf msg =
  fprintf ppf "%s" msg

let format_ast_error ppf = function
  | Not_expecting (loc, nonterm) ->
    fprintf ppf
      "Syntax error: %a%s not expected."
      Ocaml_util.print_loc loc nonterm
  | Applicative_path loc ->
    fprintf ppf
      "Syntax error: %aapplicative paths of the form F(X).t \
       are not supported when the option -no-app-func is set."
      Ocaml_util.print_loc loc
  | Variable_in_scope (loc, var) ->
    fprintf ppf "%aIn this scoped type, variable '%s \
                 is reserved for the local type %s."
      Ocaml_util.print_loc loc var var
  | Other_syntax_error msg ->
    fprintf ppf "%s" msg

let format_error ppf = function
  | Lexing_error err -> format_lexing_error ppf err
  | Parsing_error err -> format_parsing_error ppf err
  | Ast_error err -> format_ast_error ppf err

let report_error ppf ~loc err =
  Format.fprintf ppf "@[%a@]@."
    (Ocaml_util.print_error loc format_error) err

let recover_parser_error f loc msg =
  if !Reason_config.recoverable
  then f loc msg
  else raise_fatal_error (Parsing_error msg) loc

let () =
  Printexc.register_printer (function
      | Reason_error (err, loc) ->
        let _ = Format.flush_str_formatter () in
        report_error Format.str_formatter ~loc err;
        Some (Format.flush_str_formatter ())
      | _ -> None
    )

open Migrate_parsetree.Ast_404

let str_eval_message text = {
  Parsetree.
  pstr_loc = Location.none;
  pstr_desc = Pstr_eval (
      { pexp_loc = Location.none;
        pexp_desc = Pexp_constant (Parsetree.Pconst_string (text, None));
        pexp_attributes = [];
      },
      []
    );
}

(** Generate a suitable extension node for Merlin's consumption,
    for the purposes of reporting a parse error - only used
    in recovery mode.
    Parse error will prevent Merlin from reporting subsequent errors, as they
    might be due wrong recovery decisions and will confuse the user.
 *)
let error_extension_node_from_recovery loc msg =
  recover_parser_error (fun loc msg ->
    let str = { Location. loc; txt = "merlin.syntax-error" } in
    let payload = [ str_eval_message msg ] in
    (str, Parsetree.PStr payload)
  ) loc msg

(** Generate a suitable extension node for OCaml consumption,
    for the purposes of reporting a syntax error.
    Contrary to [error_extension_node_from_recovery], these work both with
    OCaml and with Merlin.
 *)
let error_extension_node loc msg =
  recover_parser_error (fun loc msg ->
    let str = { Location. loc; txt = "ocaml.error" } in
    let payload = [
      str_eval_message msg;
      (* if_highlight *)
      str_eval_message msg;
    ] in
    (str, Parsetree.PStr payload)
  ) loc msg


end
module Reason_toolchain_conf
= struct
#1 "reason_toolchain_conf.ml"
open Migrate_parsetree
include Ast_404

module From_current = Convert(OCaml_current)(OCaml_404)
module To_current = Convert(OCaml_404)(OCaml_current)

module type Toolchain = sig
  (* Parsing *)
  val core_type_with_comments: Lexing.lexbuf -> (Parsetree.core_type * Reason_comment.t list)
  val implementation_with_comments: Lexing.lexbuf -> (Parsetree.structure * Reason_comment.t list)
  val interface_with_comments: Lexing.lexbuf -> (Parsetree.signature * Reason_comment.t list)

  val core_type: Lexing.lexbuf -> Parsetree.core_type
  val implementation: Lexing.lexbuf -> Parsetree.structure
  val interface: Lexing.lexbuf -> Parsetree.signature
  val toplevel_phrase: Lexing.lexbuf -> Parsetree.toplevel_phrase
  val use_file: Lexing.lexbuf -> Parsetree.toplevel_phrase list

  (* Printing *)
  val print_interface_with_comments: Format.formatter -> (Parsetree.signature * Reason_comment.t list) -> unit
  val print_implementation_with_comments: Format.formatter -> (Parsetree.structure * Reason_comment.t list) -> unit

end

module type Toolchain_spec = sig
  val safeguard_parsing: Lexing.lexbuf ->
    (unit -> ('a * Reason_comment.t list)) -> ('a * Reason_comment.t list)

  type token
  type invalid_docstrings

  module Lexer : sig
    type t
    val init: ?insert_completion_ident:Lexing.position ->
              Lexing.lexbuf -> t
    val get_comments: t -> invalid_docstrings -> (string * Location.t) list
  end

  val core_type: Lexer.t -> Parsetree.core_type * invalid_docstrings
  val implementation: Lexer.t -> Parsetree.structure * invalid_docstrings
  val interface: Lexer.t -> Parsetree.signature * invalid_docstrings
  val toplevel_phrase: Lexer.t -> Parsetree.toplevel_phrase * invalid_docstrings
  val use_file: Lexer.t -> Parsetree.toplevel_phrase list * invalid_docstrings

  val format_interface_with_comments: (Parsetree.signature * Reason_comment.t list) -> Format.formatter -> unit
  val format_implementation_with_comments: (Parsetree.structure * Reason_comment.t list) -> Format.formatter -> unit
end

let insert_completion_ident : Lexing.position option ref = ref None

end
module Reason_toolchain_ocaml
= struct
#1 "reason_toolchain_ocaml.ml"
open Reason_toolchain_conf

(* The OCaml parser keep doc strings in the comment list.
     To avoid duplicating comments, we need to filter comments that appear
     as doc strings is the AST out of the comment list. *)
let doc_comments_filter () =
  let open Ast_mapper in
  let open Parsetree in
  let seen = Hashtbl.create 7 in
  let attribute mapper = function
    | ({ Location. txt = ("ocaml.doc" | "ocaml.text")},
       PStr [{ pstr_desc = Pstr_eval ({ pexp_desc = Pexp_constant (Pconst_string(_text, None)) } , _);
               pstr_loc = loc }]) as attribute ->
       (* Workaround: OCaml 4.02.3 kept an initial '*' in docstrings.
        * For other versions, we have to put the '*' back. *)
       Hashtbl.add seen loc ();
       default_mapper.attribute mapper attribute
    | attribute -> default_mapper.attribute mapper attribute
  in
  let mapper = {default_mapper with attribute} in
  let filter (_text, loc) = not (Hashtbl.mem seen loc) in
  (mapper, filter)

module Lexer_impl = struct
  type t = Lexing.lexbuf
  let init ?insert_completion_ident:_ lexbuf =
    Lexer.init (); lexbuf
  let token = Lexer.token

  let filtered_comments = ref []
  let filter_comments filter =
    filtered_comments := List.filter filter (Lexer.comments ())
  let get_comments _lexbuf _docstrings = !filtered_comments
end
module OCaml_parser = Parser
type token = OCaml_parser.token
type invalid_docstrings = unit

(* OCaml parser parses into compiler-libs version of Ast.
     Parsetrees are converted to Reason version on the fly. *)

let parse_and_filter_doc_comments iter fn lexbuf=
  let it, filter = doc_comments_filter () in
  let result = fn lexbuf in
  ignore (iter it result);
  Lexer_impl.filter_comments filter;
  (result, ())

let implementation lexbuf =
  parse_and_filter_doc_comments
    (fun it -> it.Ast_mapper.structure it)
    (fun lexbuf -> From_current.copy_structure
                     (Parser.implementation Lexer.token lexbuf))
    lexbuf

let core_type lexbuf =
  parse_and_filter_doc_comments
    (fun it -> it.Ast_mapper.typ it)
    (fun lexbuf -> From_current.copy_core_type
                     (Parser.parse_core_type Lexer.token lexbuf))
    lexbuf

let interface lexbuf =
  parse_and_filter_doc_comments
    (fun it -> it.Ast_mapper.signature it)
    (fun lexbuf -> From_current.copy_signature
                     (Parser.interface Lexer.token lexbuf))
    lexbuf

let filter_toplevel_phrase it = function
  | Parsetree.Ptop_def str -> ignore (it.Ast_mapper.structure it str)
  | Parsetree.Ptop_dir _ -> ()

let toplevel_phrase lexbuf =
  parse_and_filter_doc_comments
    filter_toplevel_phrase
    (fun lexbuf -> From_current.copy_toplevel_phrase
                     (Parser.toplevel_phrase Lexer.token lexbuf))
    lexbuf

let use_file lexbuf =
  parse_and_filter_doc_comments
    (fun it result -> List.map (filter_toplevel_phrase it) result)
    (fun lexbuf ->
      List.map
        From_current.copy_toplevel_phrase
        (Parser.use_file Lexer.token lexbuf))
    lexbuf

(* Skip tokens to the end of the phrase *)
(* TODO: consolidate these copy-paste skip/trys into something that works for
 * every syntax (also see [Reason_syntax_util]). *)
let rec skip_phrase lexbuf =
  try
    match Lexer.token lexbuf with
      OCaml_parser.SEMISEMI | OCaml_parser.EOF -> ()
      | _ -> skip_phrase lexbuf
  with
  | Lexer.Error (Lexer.Unterminated_comment _, _)
    | Lexer.Error (Lexer.Unterminated_string, _)
    | Lexer.Error (Lexer.Unterminated_string_in_comment _, _)
    | Lexer.Error (Lexer.Illegal_character _, _) ->
     skip_phrase lexbuf

let maybe_skip_phrase lexbuf =
  if Parsing.is_current_lookahead OCaml_parser.SEMISEMI
     || Parsing.is_current_lookahead OCaml_parser.EOF
  then ()
  else skip_phrase lexbuf

let safeguard_parsing lexbuf fn =
  try fn ()
  with
  | Lexer.Error(Lexer.Illegal_character _, _) as err
       when !Location.input_name = "//toplevel//"->
     skip_phrase lexbuf;
     raise err
  | Syntaxerr.Error _ as err
       when !Location.input_name = "//toplevel//" ->
     maybe_skip_phrase lexbuf;
     raise err
  (* Escape error is raised as a general catchall when a syntax_error() is
       thrown in the parser.
   *)
  | Parsing.Parse_error | Syntaxerr.Escape_error ->
     let loc = Location.curr lexbuf in
     if !Location.input_name = "//toplevel//"
     then maybe_skip_phrase lexbuf;
     raise(Syntaxerr.Error(Syntaxerr.Other loc))

(* Unfortunately we drop the comments because there doesn't exist an ML
 * printer that formats comments *and* line wrapping! (yet) *)
let format_interface_with_comments (signature, _) formatter =
  Pprintast.signature formatter
    (To_current.copy_signature signature)
let format_implementation_with_comments (structure, _) formatter =
  let structure =
    Reason_syntax_util.(apply_mapper_to_structure structure remove_stylistic_attrs_mapper)
  in
  Pprintast.structure formatter
    (To_current.copy_structure structure)

module Lexer = Lexer_impl

end
module MenhirLib : sig 
#1 "menhirLib.mli"
module General : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This module offers general-purpose functions on lists and streams. *)

(* As of 2017/03/31, this module is DEPRECATED. It might be removed in
   the future. *)

(* --------------------------------------------------------------------------- *)

(* Lists. *)

(* [take n xs] returns the [n] first elements of the list [xs]. It is
   acceptable  for the list [xs] to have length less than [n], in
   which case [xs] itself is returned. *)

val take: int -> 'a list -> 'a list

(* [drop n xs] returns the list [xs], deprived of its [n] first elements.
   It is acceptable for the list [xs] to have length less than [n], in
   which case an empty list is returned. *)

val drop: int -> 'a list -> 'a list

(* [uniq cmp xs] assumes that the list [xs] is sorted according to the
   ordering [cmp] and returns the list [xs] deprived of any duplicate
   elements. *)

val uniq: ('a -> 'a -> int) -> 'a list -> 'a list

(* [weed cmp xs] returns the list [xs] deprived of any duplicate elements. *)

val weed: ('a -> 'a -> int) -> 'a list -> 'a list

(* --------------------------------------------------------------------------- *)

(* A stream is a list whose elements are produced on demand. *)

type 'a stream =
    'a head Lazy.t

and 'a head =
  | Nil
  | Cons of 'a * 'a stream

(* The length of a stream. *)

val length: 'a stream -> int

(* Folding over a stream. *)

val foldr: ('a -> 'b -> 'b) -> 'a stream -> 'b -> 'b
end
module Convert : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* An ocamlyacc-style, or Menhir-style, parser requires access to
   the lexer, which must be parameterized with a lexing buffer, and
   to the lexing buffer itself, where it reads position information. *)

(* This traditional API is convenient when used with ocamllex, but
   inelegant when used with other lexer generators. *)

type ('token, 'semantic_value) traditional =
    (Lexing.lexbuf -> 'token) -> Lexing.lexbuf -> 'semantic_value

(* This revised API is independent of any lexer generator. Here, the
   parser only requires access to the lexer, and the lexer takes no
   parameters. The tokens returned by the lexer may contain position
   information. *)

type ('token, 'semantic_value) revised =
    (unit -> 'token) -> 'semantic_value

(* --------------------------------------------------------------------------- *)

(* Converting a traditional parser, produced by ocamlyacc or Menhir,
   into a revised parser. *)

(* A token of the revised lexer is essentially a triple of a token
   of the traditional lexer (or raw token), a start position, and
   and end position. The three [get] functions are accessors. *)

(* We do not require the type ['token] to actually be a triple type.
   This enables complex applications where it is a record type with
   more than three fields. It also enables simple applications where
   positions are of no interest, so ['token] is just ['raw_token]
   and [get_startp] and [get_endp] return dummy positions. *)

val traditional2revised:
  ('token -> 'raw_token) ->
  ('token -> Lexing.position) ->
  ('token -> Lexing.position) ->
  ('raw_token, 'semantic_value) traditional ->
  ('token, 'semantic_value) revised

(* --------------------------------------------------------------------------- *)

(* Converting a revised parser back to a traditional parser. *)

val revised2traditional:
  ('raw_token -> Lexing.position -> Lexing.position -> 'token) ->
  ('token, 'semantic_value) revised ->
  ('raw_token, 'semantic_value) traditional

(* --------------------------------------------------------------------------- *)

(* Simplified versions of the above, where concrete triples are used. *)

module Simplified : sig

  val traditional2revised:
    ('token, 'semantic_value) traditional ->
    ('token * Lexing.position * Lexing.position, 'semantic_value) revised

  val revised2traditional:
    ('token * Lexing.position * Lexing.position, 'semantic_value) revised ->
    ('token, 'semantic_value) traditional

end
end
module IncrementalEngine : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

type position = Lexing.position

open General

(* This signature describes the incremental LR engine. *)

(* In this mode, the user controls the lexer, and the parser suspends
   itself when it needs to read a new token. *)

module type INCREMENTAL_ENGINE = sig

  type token

  (* A value of type [production] is (an index for) a production. The start
     productions (which do not exist in an \mly file, but are constructed by
     Menhir internally) are not part of this type. *)

  type production

  (* The type ['a checkpoint] represents an intermediate or final state of the
     parser. An intermediate checkpoint is a suspension: it records the parser's
     current state, and allows parsing to be resumed. The parameter ['a] is
     the type of the semantic value that will eventually be produced if the
     parser succeeds. *)

  (* [Accepted] and [Rejected] are final checkpoints. [Accepted] carries a
     semantic value. *)

  (* [InputNeeded] is an intermediate checkpoint. It means that the parser wishes
     to read one token before continuing. *)

  (* [Shifting] is an intermediate checkpoint. It means that the parser is taking
     a shift transition. It exposes the state of the parser before and after
     the transition. The Boolean parameter tells whether the parser intends to
     request a new token after this transition. (It always does, except when
     it is about to accept.) *)

  (* [AboutToReduce] is an intermediate checkpoint. It means that the parser is
     about to perform a reduction step. It exposes the parser's current
     state as well as the production that is about to be reduced. *)

  (* [HandlingError] is an intermediate checkpoint. It means that the parser has
     detected an error and is currently handling it, in several steps. *)

  (* A value of type ['a env] represents a configuration of the automaton:
     current state, stack, lookahead token, etc. The parameter ['a] is the
     type of the semantic value that will eventually be produced if the parser
     succeeds. *)

  (* In normal operation, the parser works with checkpoints: see the functions
     [offer] and [resume]. However, it is also possible to work directly with
     environments (see the functions [pop], [force_reduction], and [feed]) and
     to reconstruct a checkpoint out of an environment (see [input_needed]).
     This is considered advanced functionality; its purpose is to allow error
     recovery strategies to be programmed by the user. *)

  type 'a env

  type 'a checkpoint = private
    | InputNeeded of 'a env
    | Shifting of 'a env * 'a env * bool
    | AboutToReduce of 'a env * production
    | HandlingError of 'a env
    | Accepted of 'a
    | Rejected

  (* [offer] allows the user to resume the parser after it has suspended
     itself with a checkpoint of the form [InputNeeded env]. [offer] expects the
     old checkpoint as well as a new token and produces a new checkpoint. It does not
     raise any exception. *)

  val offer:
    'a checkpoint ->
    token * position * position ->
    'a checkpoint

  (* [resume] allows the user to resume the parser after it has suspended
     itself with a checkpoint of the form [AboutToReduce (env, prod)] or
     [HandlingError env]. [resume] expects the old checkpoint and produces a new
     checkpoint. It does not raise any exception. *)

  val resume:
    'a checkpoint ->
    'a checkpoint

  (* A token supplier is a function of no arguments which delivers a new token
     (together with its start and end positions) every time it is called. *)

  type supplier =
    unit -> token * position * position

  (* A pair of a lexer and a lexing buffer can be easily turned into a supplier. *)

  val lexer_lexbuf_to_supplier:
    (Lexing.lexbuf -> token) ->
    Lexing.lexbuf ->
    supplier

  (* The functions [offer] and [resume] are sufficient to write a parser loop.
     One can imagine many variations (which is why we expose these functions
     in the first place!). Here, we expose a few variations of the main loop,
     ready for use. *)

  (* [loop supplier checkpoint] begins parsing from [checkpoint], reading
     tokens from [supplier]. It continues parsing until it reaches a
     checkpoint of the form [Accepted v] or [Rejected]. In the former case, it
     returns [v]. In the latter case, it raises the exception [Error]. *)

  val loop: supplier -> 'a checkpoint -> 'a

  (* [loop_handle succeed fail supplier checkpoint] begins parsing from
     [checkpoint], reading tokens from [supplier]. It continues parsing until
     it reaches a checkpoint of the form [Accepted v] or [HandlingError env]
     (or [Rejected], but that should not happen, as [HandlingError _] will be
     observed first). In the former case, it calls [succeed v]. In the latter
     case, it calls [fail] with this checkpoint. It cannot raise [Error].

     This means that Menhir's traditional error-handling procedure (which pops
     the stack until a state that can act on the [error] token is found) does
     not get a chance to run. Instead, the user can implement her own error
     handling code, in the [fail] continuation. *)

  val loop_handle:
    ('a -> 'answer) ->
    ('a checkpoint -> 'answer) ->
    supplier -> 'a checkpoint -> 'answer

  (* [loop_handle_undo] is analogous to [loop_handle], except it passes a pair
     of checkpoints to the failure continuation.

     The first (and oldest) checkpoint is the last [InputNeeded] checkpoint that
     was encountered before the error was detected. The second (and newest)
     checkpoint is where the error was detected, as in [loop_handle]. Going back
     to the first checkpoint can be thought of as undoing any reductions that
     were performed after seeing the problematic token. (These reductions must
     be default reductions or spurious reductions.)

     [loop_handle_undo] must initially be applied to an [InputNeeded] checkpoint.
     The parser's initial checkpoints satisfy this constraint. *)

  val loop_handle_undo:
    ('a -> 'answer) ->
    ('a checkpoint -> 'a checkpoint -> 'answer) ->
    supplier -> 'a checkpoint -> 'answer

  (* [shifts checkpoint] assumes that [checkpoint] has been obtained by
     submitting a token to the parser. It runs the parser from [checkpoint],
     through an arbitrary number of reductions, until the parser either
     accepts this token (i.e., shifts) or rejects it (i.e., signals an error).
     If the parser decides to shift, then [Some env] is returned, where [env]
     is the parser's state just before shifting. Otherwise, [None] is
     returned. *)

  (* It is desirable that the semantic actions be side-effect free, or that
     their side-effects be harmless (replayable). *)

  val shifts: 'a checkpoint -> 'a env option

  (* The function [acceptable] allows testing, after an error has been
     detected, which tokens would have been accepted at this point. It is
     implemented using [shifts]. Its argument should be an [InputNeeded]
     checkpoint. *)

  (* For completeness, one must undo any spurious reductions before carrying out
     this test -- that is, one must apply [acceptable] to the FIRST checkpoint
     that is passed by [loop_handle_undo] to its failure continuation. *)

  (* This test causes some semantic actions to be run! The semantic actions
     should be side-effect free, or their side-effects should be harmless. *)

  (* The position [pos] is used as the start and end positions of the
     hypothetical token, and may be picked up by the semantic actions. We
     suggest using the position where the error was detected. *)

  val acceptable: 'a checkpoint -> token -> position -> bool

  (* The abstract type ['a lr1state] describes the non-initial states of the
     LR(1) automaton. The index ['a] represents the type of the semantic value
     associated with this state's incoming symbol. *)

  type 'a lr1state

  (* The states of the LR(1) automaton are numbered (from 0 and up). *)

  val number: _ lr1state -> int

  (* Productions are numbered. *)

  (* [find_production i] requires the index [i] to be valid. Use with care. *)

  val production_index: production -> int
  val find_production: int -> production

  (* An element is a pair of a non-initial state [s] and a semantic value [v]
     associated with the incoming symbol of this state. The idea is, the value
     [v] was pushed onto the stack just before the state [s] was entered. Thus,
     for some type ['a], the state [s] has type ['a lr1state] and the value [v]
     has type ['a]. In other words, the type [element] is an existential type. *)

  type element =
    | Element: 'a lr1state * 'a * position * position -> element

  (* The parser's stack is (or, more precisely, can be viewed as) a stream of
     elements. The type [stream] is defined by the module [General]. *)

  (* As of 2017/03/31, the types [stream] and [stack] and the function [stack]
     are DEPRECATED. They might be removed in the future. An alternative way
     of inspecting the stack is via the functions [top] and [pop]. *)

  type stack = (* DEPRECATED *)
    element stream

  (* This is the parser's stack, a stream of elements. This stream is empty if
     the parser is in an initial state; otherwise, it is non-empty.  The LR(1)
     automaton's current state is the one found in the top element of the
     stack. *)

  val stack: 'a env -> stack (* DEPRECATED *)

  (* [top env] returns the parser's top stack element. The state contained in
     this stack element is the current state of the automaton. If the stack is
     empty, [None] is returned. In that case, the current state of the
     automaton must be an initial state. *)

  val top: 'a env -> element option

  (* [pop_many i env] pops [i] cells off the automaton's stack. This is done
     via [i] successive invocations of [pop]. Thus, [pop_many 1] is [pop]. The
     index [i] must be nonnegative. The time complexity is O(i). *)

  val pop_many: int -> 'a env -> 'a env option

  (* [get i env] returns the parser's [i]-th stack element. The index [i] is
     0-based: thus, [get 0] is [top]. If [i] is greater than or equal to the
     number of elements in the stack, [None] is returned. The time complexity
     is O(i). *)

  val get: int -> 'a env -> element option

  (* [current_state_number env] is (the integer number of) the automaton's
     current state. This works even if the automaton's stack is empty, in
     which case the current state is an initial state. This number can be
     passed as an argument to a [message] function generated by [menhir
     --compile-errors]. *)

  val current_state_number: 'a env -> int

  (* [equal env1 env2] tells whether the parser configurations [env1] and
     [env2] are equal in the sense that the automaton's current state is the
     same in [env1] and [env2] and the stack is *physically* the same in
     [env1] and [env2]. If [equal env1 env2] is [true], then the sequence of
     the stack elements, as observed via [pop] and [top], must be the same in
     [env1] and [env2]. Also, if [equal env1 env2] holds, then the checkpoints
     [input_needed env1] and [input_needed env2] must be equivalent. The
     function [equal] has time complexity O(1). *)

  val equal: 'a env -> 'a env -> bool

  (* These are the start and end positions of the current lookahead token. If
     invoked in an initial state, this function returns a pair of twice the
     initial position. *)

  val positions: 'a env -> position * position

  (* When applied to an environment taken from a checkpoint of the form
     [AboutToReduce (env, prod)], the function [env_has_default_reduction]
     tells whether the reduction that is about to take place is a default
     reduction. *)

  val env_has_default_reduction: 'a env -> bool

  (* [state_has_default_reduction s] tells whether the state [s] has a default
     reduction. This includes the case where [s] is an accepting state. *)

  val state_has_default_reduction: _ lr1state -> bool

  (* [pop env] returns a new environment, where the parser's top stack cell
     has been popped off. (If the stack is empty, [None] is returned.) This
     amounts to pretending that the (terminal or nonterminal) symbol that
     corresponds to this stack cell has not been read. *)

  val pop: 'a env -> 'a env option

  (* [force_reduction prod env] should be called only if in the state [env]
     the parser is capable of reducing the production [prod]. If this
     condition is satisfied, then this production is reduced, which means that
     its semantic action is executed (this can have side effects!) and the
     automaton makes a goto (nonterminal) transition. If this condition is not
     satisfied, [Invalid_argument _] is raised. *)

  val force_reduction: production -> 'a env -> 'a env

  (* [input_needed env] returns [InputNeeded env]. That is, out of an [env]
     that might have been obtained via a series of calls to the functions
     [pop], [force_reduction], [feed], etc., it produces a checkpoint, which
     can be used to resume normal parsing, by supplying this checkpoint as an
     argument to [offer]. *)

  (* This function should be used with some care. It could "mess up the
     lookahead" in the sense that it allows parsing to resume in an arbitrary
     state [s] with an arbitrary lookahead symbol [t], even though Menhir's
     reachability analysis (menhir --list-errors) might well think that it is
     impossible to reach this particular configuration. If one is using
     Menhir's new error reporting facility, this could cause the parser to
     reach an error state for which no error message has been prepared. *)

  val input_needed: 'a env -> 'a checkpoint

end

(* This signature is a fragment of the inspection API that is made available
   to the user when [--inspection] is used. This fragment contains type
   definitions for symbols. *)

module type SYMBOLS = sig

  (* The type ['a terminal] represents a terminal symbol. The type ['a
     nonterminal] represents a nonterminal symbol. In both cases, the index
     ['a] represents the type of the semantic values associated with this
     symbol. The concrete definitions of these types are generated. *)

  type 'a terminal
  type 'a nonterminal

  (* The type ['a symbol] represents a terminal or nonterminal symbol. It is
     the disjoint union of the types ['a terminal] and ['a nonterminal]. *)

  type 'a symbol =
    | T : 'a terminal -> 'a symbol
    | N : 'a nonterminal -> 'a symbol

  (* The type [xsymbol] is an existentially quantified version of the type
     ['a symbol]. This type is useful in situations where the index ['a]
     is not statically known. *)

  type xsymbol =
    | X : 'a symbol -> xsymbol

end

(* This signature describes the inspection API that is made available to the
   user when [--inspection] is used. *)

module type INSPECTION = sig

  (* The types of symbols are described above. *)

  include SYMBOLS

  (* The type ['a lr1state] is meant to be the same as in [INCREMENTAL_ENGINE]. *)

  type 'a lr1state

  (* The type [production] is meant to be the same as in [INCREMENTAL_ENGINE].
     It represents a production of the grammar. A production can be examined
     via the functions [lhs] and [rhs] below. *)

  type production

  (* An LR(0) item is a pair of a production [prod] and a valid index [i] into
     this production. That is, if the length of [rhs prod] is [n], then [i] is
     comprised between 0 and [n], inclusive. *)

  type item =
      production * int

  (* Ordering functions. *)

  val compare_terminals: _ terminal -> _ terminal -> int
  val compare_nonterminals: _ nonterminal -> _ nonterminal -> int
  val compare_symbols: xsymbol -> xsymbol -> int
  val compare_productions: production -> production -> int
  val compare_items: item -> item -> int

  (* [incoming_symbol s] is the incoming symbol of the state [s], that is,
     the symbol that the parser must recognize before (has recognized when)
     it enters the state [s]. This function gives access to the semantic
     value [v] stored in a stack element [Element (s, v, _, _)]. Indeed,
     by case analysis on the symbol [incoming_symbol s], one discovers the
     type ['a] of the value [v]. *)

  val incoming_symbol: 'a lr1state -> 'a symbol

  (* [items s] is the set of the LR(0) items in the LR(0) core of the LR(1)
     state [s]. This set is not epsilon-closed. This set is presented as a
     list, in an arbitrary order. *)

  val items: _ lr1state -> item list

  (* [lhs prod] is the left-hand side of the production [prod]. This is
     always a non-terminal symbol. *)

  val lhs: production -> xsymbol

  (* [rhs prod] is the right-hand side of the production [prod]. This is
     a (possibly empty) sequence of (terminal or nonterminal) symbols. *)

  val rhs: production -> xsymbol list

  (* [nullable nt] tells whether the non-terminal symbol [nt] is nullable.
     That is, it is true if and only if this symbol produces the empty
     word [epsilon]. *)

  val nullable: _ nonterminal -> bool

  (* [first nt t] tells whether the FIRST set of the nonterminal symbol [nt]
     contains the terminal symbol [t]. That is, it is true if and only if
     [nt] produces a word that begins with [t]. *)

  val first: _ nonterminal -> _ terminal -> bool

  (* [xfirst] is analogous to [first], but expects a first argument of type
     [xsymbol] instead of [_ terminal]. *)

  val xfirst: xsymbol -> _ terminal -> bool

  (* [foreach_terminal] enumerates the terminal symbols, including [error].
     [foreach_terminal_but_error] enumerates the terminal symbols, excluding
     [error]. *)

  val foreach_terminal:           (xsymbol -> 'a -> 'a) -> 'a -> 'a
  val foreach_terminal_but_error: (xsymbol -> 'a -> 'a) -> 'a -> 'a

  (* The type [env] is meant to be the same as in [INCREMENTAL_ENGINE]. *)

  type 'a env

  (* [feed symbol startp semv endp env] causes the parser to consume the
     (terminal or nonterminal) symbol [symbol], accompanied with the semantic
     value [semv] and with the start and end positions [startp] and [endp].
     Thus, the automaton makes a transition, and reaches a new state. The
     stack grows by one cell. This operation is permitted only if the current
     state (as determined by [env]) has an outgoing transition labeled with
     [symbol]. Otherwise, [Invalid_argument _] is raised. *)

  val feed: 'a symbol -> position -> 'a -> position -> 'b env -> 'b env

end

(* This signature combines the incremental API and the inspection API. *)

module type EVERYTHING = sig

  include INCREMENTAL_ENGINE

  include INSPECTION
    with type 'a lr1state := 'a lr1state
    with type production := production
    with type 'a env := 'a env

end
end
module EngineTypes : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This file defines several types and module types that are used in the
   specification of module [Engine]. *)

(* --------------------------------------------------------------------------- *)

(* It would be nice if we could keep the structure of stacks and environments
   hidden. However, stacks and environments must be accessible to semantic
   actions, so the following data structure definitions must be public. *)

(* --------------------------------------------------------------------------- *)

(* A stack is a linked list of cells. A sentinel cell -- which is its own
   successor -- is used to mark the bottom of the stack. The sentinel cell
   itself is not significant -- it contains dummy values. *)

type ('state, 'semantic_value) stack = {

  (* The state that we should go back to if we pop this stack cell. *)

  (* This convention means that the state contained in the top stack cell is
     not the current state [env.current]. It also means that the state found
     within the sentinel is a dummy -- it is never consulted. This convention
     is the same as that adopted by the code-based back-end. *)

  state: 'state;

  (* The semantic value associated with the chunk of input that this cell
     represents. *)

  semv: 'semantic_value;

  (* The start and end positions of the chunk of input that this cell
     represents. *)

  startp: Lexing.position;
  endp: Lexing.position;

  (* The next cell down in the stack. If this is a self-pointer, then this
     cell is the sentinel, and the stack is conceptually empty. *)

  next: ('state, 'semantic_value) stack;

}

(* --------------------------------------------------------------------------- *)

(* A parsing environment contains all of the parser's state (except for the
   current program point). *)

type ('state, 'semantic_value, 'token) env = {

  (* If this flag is true, then the first component of [env.triple] should
     be ignored, as it has been logically overwritten with the [error]
     pseudo-token. *)

  error: bool;

  (* The last token that was obtained from the lexer, together with its start
     and end positions. Warning: before the first call to the lexer has taken
     place, a dummy (and possibly invalid) token is stored here. *)

  triple: 'token * Lexing.position * Lexing.position;

  (* The stack. In [CodeBackend], it is passed around on its own,
     whereas, here, it is accessed via the environment. *)

  stack: ('state, 'semantic_value) stack;

  (* The current state. In [CodeBackend], it is passed around on its
     own, whereas, here, it is accessed via the environment. *)

  current: 'state;

}

(* --------------------------------------------------------------------------- *)

(* This signature describes the parameters that must be supplied to the LR
   engine. *)

module type TABLE = sig

  (* The type of automaton states. *)

  type state

  (* States are numbered. *)

  val number: state -> int

  (* The type of tokens. These can be thought of as real tokens, that is,
     tokens returned by the lexer. They carry a semantic value. This type
     does not include the [error] pseudo-token. *)

  type token

  (* The type of terminal symbols. These can be thought of as integer codes.
     They do not carry a semantic value. This type does include the [error]
     pseudo-token. *)

  type terminal

  (* The type of nonterminal symbols. *)

  type nonterminal

  (* The type of semantic values. *)

  type semantic_value

  (* A token is conceptually a pair of a (non-[error]) terminal symbol and
     a semantic value. The following two functions are the pair projections. *)

  val token2terminal: token -> terminal
  val token2value: token -> semantic_value

  (* Even though the [error] pseudo-token is not a real token, it is a
     terminal symbol. Furthermore, for regularity, it must have a semantic
     value. *)

  val error_terminal: terminal
  val error_value: semantic_value

  (* [foreach_terminal] allows iterating over all terminal symbols. *)

  val foreach_terminal: (terminal -> 'a -> 'a) -> 'a -> 'a

  (* The type of productions. *)

  type production

  val production_index: production -> int
  val find_production: int -> production

  (* If a state [s] has a default reduction on production [prod], then, upon
     entering [s], the automaton should reduce [prod] without consulting the
     lookahead token. The following function allows determining which states
     have default reductions. *)

  (* Instead of returning a value of a sum type -- either [DefRed prod], or
     [NoDefRed] -- it accepts two continuations, and invokes just one of
     them. This mechanism allows avoiding a memory allocation. *)

  val default_reduction:
    state ->
    ('env -> production -> 'answer) ->
    ('env -> 'answer) ->
    'env -> 'answer

  (* An LR automaton can normally take three kinds of actions: shift, reduce,
     or fail. (Acceptance is a particular case of reduction: it consists in
     reducing a start production.) *)

  (* There are two variants of the shift action. [shift/discard s] instructs
     the automaton to discard the current token, request a new one from the
     lexer, and move to state [s]. [shift/nodiscard s] instructs it to move to
     state [s] without requesting a new token. This instruction should be used
     when [s] has a default reduction on [#]. See [CodeBackend.gettoken] for
     details. *)

  (* This is the automaton's action table. It maps a pair of a state and a
     terminal symbol to an action. *)

  (* Instead of returning a value of a sum type -- one of shift/discard,
     shift/nodiscard, reduce, or fail -- this function accepts three
     continuations, and invokes just one them. This mechanism allows avoiding
     a memory allocation. *)

  (* In summary, the parameters to [action] are as follows:

     - the first two parameters, a state and a terminal symbol, are used to
       look up the action table;

     - the next parameter is the semantic value associated with the above
       terminal symbol; it is not used, only passed along to the shift
       continuation, as explained below;

     - the shift continuation expects an environment; a flag that tells
       whether to discard the current token; the terminal symbol that
       is being shifted; its semantic value; and the target state of
       the transition;

     - the reduce continuation expects an environment and a production;

     - the fail continuation expects an environment;

     - the last parameter is the environment; it is not used, only passed
       along to the selected continuation. *)

  val action:
    state ->
    terminal ->
    semantic_value ->
    ('env -> bool -> terminal -> semantic_value -> state -> 'answer) ->
    ('env -> production -> 'answer) ->
    ('env -> 'answer) ->
    'env -> 'answer

  (* This is the automaton's goto table. This table maps a pair of a state
     and a nonterminal symbol to a new state. By extension, it also maps a
     pair of a state and a production to a new state. *)

  (* The function [goto_nt] can be applied to [s] and [nt] ONLY if the state
     [s] has an outgoing transition labeled [nt]. Otherwise, its result is
     undefined. Similarly, the call [goto_prod prod s] is permitted ONLY if
     the state [s] has an outgoing transition labeled with the nonterminal
     symbol [lhs prod]. The function [maybe_goto_nt] involves an additional
     dynamic check and CAN be called even if there is no outgoing transition. *)

  val       goto_nt  : state -> nonterminal -> state
  val       goto_prod: state -> production  -> state
  val maybe_goto_nt:   state -> nonterminal -> state option

  (* [is_start prod] tells whether the production [prod] is a start production. *)

  val is_start: production -> bool

  (* By convention, a semantic action is responsible for:

     1. fetching whatever semantic values and positions it needs off the stack;

     2. popping an appropriate number of cells off the stack, as dictated
        by the length of the right-hand side of the production;

     3. computing a new semantic value, as well as new start and end positions;

     4. pushing a new stack cell, which contains the three values
        computed in step 3;

     5. returning the new stack computed in steps 2 and 4.

     Point 1 is essentially forced upon us: if semantic values were fetched
     off the stack by this interpreter, then the calling convention for
     semantic actions would be variadic: not all semantic actions would have
     the same number of arguments. The rest follows rather naturally. *)

  (* Semantic actions are allowed to raise [Error]. *)

  exception Error

  type semantic_action =
      (state, semantic_value, token) env -> (state, semantic_value) stack

  val semantic_action: production -> semantic_action

  (* [may_reduce state prod] tests whether the state [state] is capable of
     reducing the production [prod]. This function is currently costly and
     is not used by the core LR engine. It is used in the implementation
     of certain functions, such as [force_reduction], which allow the engine
     to be driven programmatically. *)

  val may_reduce: state -> production -> bool

  (* The LR engine requires a number of hooks, which are used for logging. *)

  (* The comments below indicate the conventional messages that correspond
     to these hooks in the code-based back-end; see [CodeBackend]. *)

  (* If the flag [log] is false, then the logging functions are not called.
     If it is [true], then they are called. *)

  val log : bool

  module Log : sig

    (* State %d: *)

    val state: state -> unit

    (* Shifting (<terminal>) to state <state> *)

    val shift: terminal -> state -> unit

    (* Reducing a production should be logged either as a reduction
       event (for regular productions) or as an acceptance event (for
       start productions). *)

    (* Reducing production <production> / Accepting *)

    val reduce_or_accept: production -> unit

    (* Lookahead token is now <terminal> (<pos>-<pos>) *)

    val lookahead_token: terminal -> Lexing.position -> Lexing.position -> unit

    (* Initiating error handling *)

    val initiating_error_handling: unit -> unit

    (* Resuming error handling *)

    val resuming_error_handling: unit -> unit

    (* Handling error in state <state> *)

    val handling_error: state -> unit

  end

end

(* --------------------------------------------------------------------------- *)

(* This signature describes the monolithic (traditional) LR engine. *)

(* In this interface, the parser controls the lexer. *)

module type MONOLITHIC_ENGINE = sig

  type state

  type token

  type semantic_value

  (* An entry point to the engine requires a start state, a lexer, and a lexing
     buffer. It either succeeds and produces a semantic value, or fails and
     raises [Error]. *)

  exception Error

  val entry:
    state ->
    (Lexing.lexbuf -> token) ->
    Lexing.lexbuf ->
    semantic_value

end

(* --------------------------------------------------------------------------- *)

(* The following signatures describe the incremental LR engine. *)

(* First, see [INCREMENTAL_ENGINE] in the file [IncrementalEngine.ml]. *)

(* The [start] function is set apart because we do not wish to publish
   it as part of the generated [parser.mli] file. Instead, the table
   back-end will publish specialized versions of it, with a suitable
   type cast. *)

module type INCREMENTAL_ENGINE_START = sig

  (* [start] is an entry point. It requires a start state and a start position
     and begins the parsing process. If the lexer is based on an OCaml lexing
     buffer, the start position should be [lexbuf.lex_curr_p]. [start] produces
     a checkpoint, which usually will be an [InputNeeded] checkpoint. (It could
     be [Accepted] if this starting state accepts only the empty word. It could
     be [Rejected] if this starting state accepts no word at all.) It does not
     raise any exception. *)

  (* [start s pos] should really produce a checkpoint of type ['a checkpoint],
     for a fixed ['a] that depends on the state [s]. We cannot express this, so
     we use [semantic_value checkpoint], which is safe. The table back-end uses
     [Obj.magic] to produce safe specialized versions of [start]. *)

  type state
  type semantic_value
  type 'a checkpoint

  val start:
    state ->
    Lexing.position ->
    semantic_value checkpoint

end

(* --------------------------------------------------------------------------- *)

(* This signature describes the LR engine, which combines the monolithic
   and incremental interfaces. *)

module type ENGINE = sig

  include MONOLITHIC_ENGINE

  include IncrementalEngine.INCREMENTAL_ENGINE
    with type token := token
     and type 'a lr1state = state (* useful for us; hidden from the end user *)

  include INCREMENTAL_ENGINE_START
    with type state := state
     and type semantic_value := semantic_value
     and type 'a checkpoint := 'a checkpoint

end
end
module Engine : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

open EngineTypes

(* The LR parsing engine. *)

module Make (T : TABLE)
: ENGINE
  with type state = T.state
   and type token = T.token
   and type semantic_value = T.semantic_value
   and type production = T.production
   and type 'a env = (T.state, T.semantic_value, T.token) EngineTypes.env

(* We would prefer not to expose the definition of the type [env].
   However, it must be exposed because some of the code in the
   inspection API needs access to the engine's internals; see
   [InspectionTableInterpreter]. Everything would be simpler if
   --inspection was always ON, but that would lead to bigger parse
   tables for everybody. *)
end
module ErrorReports : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* -------------------------------------------------------------------------- *)

(* The following functions help keep track of the start and end positions of
   the last two tokens in a two-place buffer. This is used to nicely display
   where a syntax error took place. *)

type 'a buffer

(* [wrap lexer] returns a pair of a new (initially empty) buffer and a lexer
   which internally relies on [lexer] and updates [buffer] on the fly whenever
   a token is demanded. *)

open Lexing

val wrap:
  (lexbuf -> 'token) ->
  (position * position) buffer * (lexbuf -> 'token)

(* [show f buffer] prints the contents of the buffer, producing a string that
   is typically of the form "after '%s' and before '%s'". The function [f] is
   used to print an element. The buffer MUST be nonempty. *)

val show: ('a -> string) -> 'a buffer -> string

(* [last buffer] returns the last element of the buffer. The buffer MUST be
   nonempty. *)

val last: 'a buffer -> 'a

(* -------------------------------------------------------------------------- *)
end
module Printers : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This module is part of MenhirLib. *)

module Make

  (I : IncrementalEngine.EVERYTHING)

  (User : sig

    (* [print s] is supposed to send the string [s] to some output channel. *)

    val print: string -> unit

    (* [print_symbol s] is supposed to print a representation of the symbol [s]. *)

    val print_symbol: I.xsymbol -> unit

    (* [print_element e] is supposed to print a representation of the element [e].
       This function is optional; if it is not provided, [print_element_as_symbol]
       (defined below) is used instead. *)

    val print_element: (I.element -> unit) option

  end)

: sig

  open I

  (* Printing a list of symbols. *)

  val print_symbols: xsymbol list -> unit

  (* Printing an element as a symbol. This prints just the symbol
     that this element represents; nothing more. *)

  val print_element_as_symbol: element -> unit

  (* Printing a stack as a list of elements. This function needs an element
     printer. It uses [print_element] if provided by the user; otherwise
     it uses [print_element_as_symbol]. (Ending with a newline.) *)

  val print_stack: 'a env -> unit

  (* Printing an item. (Ending with a newline.) *)

  val print_item: item -> unit

  (* Printing a production. (Ending with a newline.) *)

  val print_production: production -> unit

  (* Printing the current LR(1) state. The current state is first displayed
     as a number; then the list of its LR(0) items is printed. (Ending with
     a newline.) *)

  val print_current_state: 'a env -> unit

  (* Printing a summary of the stack and current state. This function just
     calls [print_stack] and [print_current_state] in succession. *)

  val print_env: 'a env -> unit

end
end
module InfiniteArray : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(** This module implements infinite arrays. **)
type 'a t

(** [make x] creates an infinite array, where every slot contains [x]. **)
val make: 'a -> 'a t

(** [get a i] returns the element contained at offset [i] in the array [a].
   Slots are numbered 0 and up. **)
val get: 'a t -> int -> 'a

(** [set a i x] sets the element contained at offset [i] in the array
    [a] to [x]. Slots are numbered 0 and up. **)
val set: 'a t -> int -> 'a -> unit

(** [extent a] is the length of an initial segment of the array [a]
    that is sufficiently large to contain all [set] operations ever
    performed. In other words, all elements beyond that segment have
    the default value. *)
val extent: 'a t -> int

(** [domain a] is a fresh copy of an initial segment of the array [a]
    whose length is [extent a]. *)
val domain: 'a t -> 'a array
end
module PackedIntArray : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* A packed integer array is represented as a pair of an integer [k] and
   a string [s]. The integer [k] is the number of bits per integer that we
   use. The string [s] is just an array of bits, which is read in 8-bit
   chunks. *)

(* The ocaml programming language treats string literals and array literals
   in slightly different ways: the former are statically allocated, while
   the latter are dynamically allocated. (This is rather arbitrary.) In the
   context of Menhir's table-based back-end, where compact, immutable
   integer arrays are needed, ocaml strings are preferable to ocaml arrays. *)

type t =
  int * string

(* [pack a] turns an array of integers into a packed integer array. *)

(* Because the sign bit is the most significant bit, the magnitude of
   any negative number is the word size. In other words, [pack] does
   not achieve any space savings as soon as [a] contains any negative
   numbers, even if they are ``small''. *)

val pack: int array -> t

(* [get t i] returns the integer stored in the packed array [t] at index [i]. *)

(* Together, [pack] and [get] satisfy the following property: if the index [i]
   is within bounds, then [get (pack a) i] equals [a.(i)]. *)

val get: t -> int -> int

(* [get1 t i] returns the integer stored in the packed array [t] at index [i].
   It assumes (and does not check) that the array's bit width is [1]. The
   parameter [t] is just a string. *)

val get1: string -> int -> int

(* [unflatten1 (n, data) i j] accesses the two-dimensional bitmap
   represented by [(n, data)] at indices [i] and [j]. The integer
   [n] is the width of the bitmap; the string [data] is the second
   component of the packed array obtained by encoding the table as
   a one-dimensional array. *)

val unflatten1: int * string -> int -> int -> int

end
module RowDisplacement : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This module compresses a two-dimensional table, where some values
   are considered insignificant, via row displacement. *)

(* A compressed table is represented as a pair of arrays. The
   displacement array is an array of offsets into the data array. *)

type 'a table =
    int array * (* displacement *)
     'a array   (* data *)

(* [compress equal insignificant dummy m n t] turns the two-dimensional table
   [t] into a compressed table. The parameter [equal] is equality of data
   values. The parameter [wildcard] tells which data values are insignificant,
   and can thus be overwritten with other values. The parameter [dummy] is
   used to fill holes in the data array. [m] and [n] are the integer
   dimensions of the table [t]. *)

val compress:
  ('a -> 'a -> bool) ->
  ('a -> bool) ->
  'a ->
  int -> int ->
  'a array array ->
  'a table

(* [get ct i j] returns the value found at indices [i] and [j] in the
   compressed table [ct]. This function call is permitted only if the
   value found at indices [i] and [j] in the original table is
   significant -- otherwise, it could fail abruptly. *)

(* Together, [compress] and [get] have the property that, if the value
   found at indices [i] and [j] in an uncompressed table [t] is
   significant, then [get (compress t) i j] is equal to that value. *)

val get:
  'a table ->
  int -> int ->
  'a

(* [getget] is a variant of [get] which only requires read access,
   via accessors, to the two components of the table. *)

val getget:
  ('displacement -> int -> int) ->
  ('data -> int -> 'a) ->
  'displacement * 'data ->
  int -> int ->
  'a

end
module LinearizedArray : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* An array of arrays (of possibly different lengths!) can be ``linearized'',
   i.e., encoded as a data array (by concatenating all of the little arrays)
   and an entry array (which contains offsets into the data array). *)

type 'a t =
  (* data: *)   'a array *
  (* entry: *) int array

(* [make a] turns the array of arrays [a] into a linearized array. *)

val make: 'a array array -> 'a t

(* [read la i j] reads the linearized array [la] at indices [i] and [j].
   Thus, [read (make a) i j] is equivalent to [a.(i).(j)]. *)

val read: 'a t -> int -> int -> 'a

(* [write la i j v] writes the value [v] into the linearized array [la]
   at indices [i] and [j]. *)

val write: 'a t -> int -> int -> 'a -> unit

(* [length la] is the number of rows of the array [la]. Thus, [length (make
   a)] is equivalent to [Array.length a]. *)

val length: 'a t -> int

(* [row_length la i] is the length of the row at index [i] in the linearized
   array [la]. Thus, [row_length (make a) i] is equivalent to [Array.length
   a.(i)]. *)

val row_length: 'a t -> int -> int

(* [read_row la i] reads the row at index [i], producing a list. Thus,
   [read_row (make a) i] is equivalent to [Array.to_list a.(i)]. *)

val read_row: 'a t -> int -> 'a list

(* The following variants read the linearized array via accessors
   [get_data : int -> 'a] and [get_entry : int -> int]. *)

val row_length_via:
  (* get_entry: *) (int -> int) ->
  (* i: *)         int ->
                   int

val read_via:
  (* get_data: *)  (int -> 'a) ->
  (* get_entry: *) (int -> int) ->
  (* i: *)         int ->
  (* j: *)         int ->
                   'a

val read_row_via:
  (* get_data: *)  (int -> 'a) ->
  (* get_entry: *) (int -> int) ->
  (* i: *)         int ->
                   'a list

end
module TableFormat : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This signature defines the format of the parse tables. It is used as
   an argument to [TableInterpreter.Make]. *)

module type TABLES = sig

  (* This is the parser's type of tokens. *)

  type token

  (* This maps a token to its internal (generation-time) integer code. *)

  val token2terminal: token -> int

  (* This is the integer code for the error pseudo-token. *)

  val error_terminal: int

  (* This maps a token to its semantic value. *)

  val token2value: token -> Obj.t

  (* Traditionally, an LR automaton is described by two tables, namely, an
     action table and a goto table. See, for instance, the Dragon book.

     The action table is a two-dimensional matrix that maps a state and a
     lookahead token to an action. An action is one of: shift to a certain
     state, reduce a certain production, accept, or fail.

     The goto table is a two-dimensional matrix that maps a state and a
     non-terminal symbol to either a state or undefined. By construction, this
     table is sparse: its undefined entries are never looked up. A compression
     technique is free to overlap them with other entries.

     In Menhir, things are slightly different. If a state has a default
     reduction on token [#], then that reduction must be performed without
     consulting the lookahead token. As a result, we must first determine
     whether that is the case, before we can obtain a lookahead token and use it
     as an index in the action table.

     Thus, Menhir's tables are as follows.

     A one-dimensional default reduction table maps a state to either ``no
     default reduction'' (encoded as: 0) or ``by default, reduce prod''
     (encoded as: 1 + prod). The action table is looked up only when there
     is no default reduction. *)

  val default_reduction: PackedIntArray.t

  (* Menhir follows Dencker, Dürre and Heuft, who point out that, although the
     action table is not sparse by nature (i.e., the error entries are
     significant), it can be made sparse by first factoring out a binary error
     matrix, then replacing the error entries in the action table with undefined
     entries. Thus:

     A two-dimensional error bitmap maps a state and a terminal to either
     ``fail'' (encoded as: 0) or ``do not fail'' (encoded as: 1). The action
     table, which is now sparse, is looked up only in the latter case. *)

  (* The error bitmap is flattened into a one-dimensional table; its width is
     recorded so as to allow indexing. The table is then compressed via
     [PackedIntArray]. The bit width of the resulting packed array must be
     [1], so it is not explicitly recorded. *)

  (* The error bitmap does not contain a column for the [#] pseudo-terminal.
     Thus, its width is [Terminal.n - 1]. We exploit the fact that the integer
     code assigned to [#] is greatest: the fact that the right-most column
     in the bitmap is missing does not affect the code for accessing it. *)

  val error: int (* width of the bitmap *) * string (* second component of [PackedIntArray.t] *)

  (* A two-dimensional action table maps a state and a terminal to one of
     ``shift to state s and discard the current token'' (encoded as: s | 10),
     ``shift to state s without discarding the current token'' (encoded as: s |
     11), or ``reduce prod'' (encoded as: prod | 01). *)

  (* The action table is first compressed via [RowDisplacement], then packed
     via [PackedIntArray]. *)

  (* Like the error bitmap, the action table does not contain a column for the
     [#] pseudo-terminal. *)

  val action: PackedIntArray.t * PackedIntArray.t

  (* A one-dimensional lhs table maps a production to its left-hand side (a
     non-terminal symbol). *)

  val lhs: PackedIntArray.t

  (* A two-dimensional goto table maps a state and a non-terminal symbol to
     either undefined (encoded as: 0) or a new state s (encoded as: 1 + s). *)

  (* The goto table is first compressed via [RowDisplacement], then packed
     via [PackedIntArray]. *)

  val goto: PackedIntArray.t * PackedIntArray.t

  (* The number of start productions. A production [prod] is a start
     production if and only if [prod < start] holds. This is also the
     number of start symbols. A nonterminal symbol [nt] is a start
     symbol if and only if [nt < start] holds. *)

  val start: int

  (* A one-dimensional semantic action table maps productions to semantic
     actions. The calling convention for semantic actions is described in
     [EngineTypes]. This table contains ONLY NON-START PRODUCTIONS, so the
     indexing is off by [start]. Be careful. *)

  val semantic_action: ((int, Obj.t, token) EngineTypes.env ->
                        (int, Obj.t)        EngineTypes.stack) array

  (* The parser defines its own [Error] exception. This exception can be
     raised by semantic actions and caught by the engine, and raised by the
     engine towards the final user. *)

  exception Error

  (* The parser indicates whether to generate a trace. Generating a
     trace requires two extra tables, which respectively map a
     terminal symbol and a production to a string. *)

  val trace: (string array * string array) option

end
end
module InspectionTableFormat : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This signature defines the format of the tables that are produced (in
   addition to the tables described in [TableFormat]) when the command line
   switch [--inspection] is enabled. It is used as an argument to
   [InspectionTableInterpreter.Make]. *)

module type TABLES = sig

  (* The types of symbols. *)

  include IncrementalEngine.SYMBOLS

  (* The type ['a lr1state] describes an LR(1) state. The generated parser defines
     it internally as [int]. *)

  type 'a lr1state

  (* Some of the tables that follow use encodings of (terminal and
     nonterminal) symbols as integers. So, we need functions that
     map the integer encoding of a symbol to its algebraic encoding. *)

  val    terminal: int -> xsymbol
  val nonterminal: int -> xsymbol

  (* The left-hand side of every production already appears in the
     signature [TableFormat.TABLES], so we need not repeat it here. *)

  (* The right-hand side of every production. This a linearized array
     of arrays of integers, whose [data] and [entry] components have
     been packed. The encoding of symbols as integers in described in
     [TableBackend]. *)

  val rhs: PackedIntArray.t * PackedIntArray.t

  (* A mapping of every (non-initial) state to its LR(0) core. *)

  val lr0_core: PackedIntArray.t

  (* A mapping of every LR(0) state to its set of LR(0) items. Each item is
     represented in its packed form (see [Item]) as an integer. Thus the
     mapping is an array of arrays of integers, which is linearized and
     packed, like [rhs]. *)

  val lr0_items: PackedIntArray.t * PackedIntArray.t

  (* A mapping of every LR(0) state to its incoming symbol, if it has one. *)

  val lr0_incoming: PackedIntArray.t

  (* A table that tells which non-terminal symbols are nullable. *)

  val nullable: string
    (* This is a packed int array of bit width 1. It can be read
       using [PackedIntArray.get1]. *)

  (* A two-table dimensional table, indexed by a nonterminal symbol and
     by a terminal symbol (other than [#]), encodes the FIRST sets. *)

  val first: int (* width of the bitmap *) * string (* second component of [PackedIntArray.t] *)

end

end
module InspectionTableInterpreter : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This functor is invoked inside the generated parser, in [--table] mode. It
   produces no code! It simply constructs the types [symbol] and [xsymbol] on
   top of the generated types [terminal] and [nonterminal]. *)

module Symbols (T : sig

  type 'a terminal
  type 'a nonterminal

end)

: IncrementalEngine.SYMBOLS
  with type 'a terminal := 'a T.terminal
   and type 'a nonterminal := 'a T.nonterminal

(* This functor is invoked inside the generated parser, in [--table] mode. It
   constructs the inspection API on top of the inspection tables described in
   [InspectionTableFormat]. *)

module Make
  (TT : TableFormat.TABLES)
  (IT : InspectionTableFormat.TABLES
        with type 'a lr1state = int)
  (ET : EngineTypes.TABLE
        with type terminal = int
         and type nonterminal = int
         and type semantic_value = Obj.t)
  (E : sig
     type 'a env = (ET.state, ET.semantic_value, ET.token) EngineTypes.env
   end)

: IncrementalEngine.INSPECTION
  with type 'a terminal := 'a IT.terminal
   and type 'a nonterminal := 'a IT.nonterminal
   and type 'a lr1state := 'a IT.lr1state
   and type production := int
   and type 'a env := 'a E.env
end
module TableInterpreter : sig
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This module provides a thin decoding layer for the generated tables, thus
   providing an API that is suitable for use by [Engine.Make]. It is part of
   [MenhirLib]. *)

(* The exception [Error] is declared within the generated parser. This is
   preferable to pre-declaring it here, as it ensures that each parser gets
   its own, distinct [Error] exception. This is consistent with the code-based
   back-end. *)

(* This functor is invoked by the generated parser. *)

module MakeEngineTable
  (T : TableFormat.TABLES)
: EngineTypes.TABLE
    with type state = int
     and type token = T.token
     and type semantic_value = Obj.t
     and type production = int
     and type terminal = int
     and type nonterminal = int
end
module StaticVersion : sig
val require_20190924 : unit
end

end = struct
#1 "menhirLib.ml"
module General = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* --------------------------------------------------------------------------- *)

(* Lists. *)

let rec take n xs =
  match n, xs with
  | 0, _
  | _, [] ->
      []
  | _, (x :: xs as input) ->
     let xs' = take (n - 1) xs in
     if xs == xs' then
       input
     else
       x :: xs'

let rec drop n xs =
  match n, xs with
  | 0, _ ->
      xs
  | _, [] ->
      []
  | _, _ :: xs ->
      drop (n - 1) xs

let rec uniq1 cmp x ys =
  match ys with
  | [] ->
      []
  | y :: ys ->
      if cmp x y = 0 then
        uniq1 compare x ys
      else
        y :: uniq1 cmp y ys

let uniq cmp xs =
  match xs with
  | [] ->
      []
  | x :: xs ->
      x :: uniq1 cmp x xs

let weed cmp xs =
  uniq cmp (List.sort cmp xs)

(* --------------------------------------------------------------------------- *)

(* Streams. *)

type 'a stream =
    'a head Lazy.t

and 'a head =
  | Nil
  | Cons of 'a * 'a stream

(* The length of a stream. *)

let rec length xs =
  match Lazy.force xs with
  | Nil ->
      0
  | Cons (_, xs) ->
      1 + length xs

(* Folding over a stream. *)

let rec foldr f xs accu =
  match Lazy.force xs with
  | Nil ->
      accu
  | Cons (x, xs) ->
      f x (foldr f xs accu)

end
module Convert = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* An ocamlyacc-style, or Menhir-style, parser requires access to
   the lexer, which must be parameterized with a lexing buffer, and
   to the lexing buffer itself, where it reads position information. *)

(* This traditional API is convenient when used with ocamllex, but
   inelegant when used with other lexer generators. *)

type ('token, 'semantic_value) traditional =
    (Lexing.lexbuf -> 'token) -> Lexing.lexbuf -> 'semantic_value

(* This revised API is independent of any lexer generator. Here, the
   parser only requires access to the lexer, and the lexer takes no
   parameters. The tokens returned by the lexer may contain position
   information. *)

type ('token, 'semantic_value) revised =
    (unit -> 'token) -> 'semantic_value

(* --------------------------------------------------------------------------- *)

(* Converting a traditional parser, produced by ocamlyacc or Menhir,
   into a revised parser. *)

(* A token of the revised lexer is essentially a triple of a token
   of the traditional lexer (or raw token), a start position, and
   and end position. The three [get] functions are accessors. *)

(* We do not require the type ['token] to actually be a triple type.
   This enables complex applications where it is a record type with
   more than three fields. It also enables simple applications where
   positions are of no interest, so ['token] is just ['raw_token]
   and [get_startp] and [get_endp] return dummy positions. *)

let traditional2revised
  (get_raw_token : 'token -> 'raw_token)
  (get_startp    : 'token -> Lexing.position)
  (get_endp      : 'token -> Lexing.position)
  (parser : ('raw_token, 'semantic_value) traditional)
: ('token, 'semantic_value) revised =

  (* Accept a revised lexer. *)

  fun (lexer : unit -> 'token) ->

    (* Create a dummy lexing buffer. *)

    let lexbuf : Lexing.lexbuf =
      Lexing.from_string ""
    in

    (* Wrap the revised lexer as a traditional lexer. A traditional
       lexer returns a raw token and updates the fields of the lexing
       buffer with new positions, which will be read by the parser. *)

    let lexer (lexbuf : Lexing.lexbuf) : 'raw_token =
      let token : 'token = lexer() in
      lexbuf.Lexing.lex_start_p <- get_startp token;
      lexbuf.Lexing.lex_curr_p <- get_endp token;
      get_raw_token token
    in

    (* Invoke the traditional parser. *)

    parser lexer lexbuf

(* --------------------------------------------------------------------------- *)

(* Converting a revised parser back to a traditional parser. *)

let revised2traditional
  (make_token : 'raw_token -> Lexing.position -> Lexing.position -> 'token)
  (parser : ('token, 'semantic_value) revised)
: ('raw_token, 'semantic_value) traditional =

  (* Accept a traditional lexer and a lexing buffer. *)

  fun (lexer : Lexing.lexbuf -> 'raw_token) (lexbuf : Lexing.lexbuf) ->

    (* Wrap the traditional lexer as a revised lexer. *)

    let lexer () : 'token =
      let token : 'raw_token = lexer lexbuf in
      make_token token lexbuf.Lexing.lex_start_p lexbuf.Lexing.lex_curr_p
    in

    (* Invoke the revised parser. *)

    parser lexer

(* --------------------------------------------------------------------------- *)

(* Simplified versions of the above, where concrete triples are used. *)

module Simplified = struct

  let traditional2revised parser =
    traditional2revised
      (fun (token, _, _)  -> token)
      (fun (_, startp, _) -> startp)
      (fun (_, _, endp)   -> endp)
      parser

  let revised2traditional parser =
    revised2traditional
      (fun token startp endp -> (token, startp, endp))
      parser

end
end
module IncrementalEngine = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

type position = Lexing.position

open General

(* This signature describes the incremental LR engine. *)

(* In this mode, the user controls the lexer, and the parser suspends
   itself when it needs to read a new token. *)

module type INCREMENTAL_ENGINE = sig

  type token

  (* A value of type [production] is (an index for) a production. The start
     productions (which do not exist in an \mly file, but are constructed by
     Menhir internally) are not part of this type. *)

  type production

  (* The type ['a checkpoint] represents an intermediate or final state of the
     parser. An intermediate checkpoint is a suspension: it records the parser's
     current state, and allows parsing to be resumed. The parameter ['a] is
     the type of the semantic value that will eventually be produced if the
     parser succeeds. *)

  (* [Accepted] and [Rejected] are final checkpoints. [Accepted] carries a
     semantic value. *)

  (* [InputNeeded] is an intermediate checkpoint. It means that the parser wishes
     to read one token before continuing. *)

  (* [Shifting] is an intermediate checkpoint. It means that the parser is taking
     a shift transition. It exposes the state of the parser before and after
     the transition. The Boolean parameter tells whether the parser intends to
     request a new token after this transition. (It always does, except when
     it is about to accept.) *)

  (* [AboutToReduce] is an intermediate checkpoint. It means that the parser is
     about to perform a reduction step. It exposes the parser's current
     state as well as the production that is about to be reduced. *)

  (* [HandlingError] is an intermediate checkpoint. It means that the parser has
     detected an error and is currently handling it, in several steps. *)

  (* A value of type ['a env] represents a configuration of the automaton:
     current state, stack, lookahead token, etc. The parameter ['a] is the
     type of the semantic value that will eventually be produced if the parser
     succeeds. *)

  (* In normal operation, the parser works with checkpoints: see the functions
     [offer] and [resume]. However, it is also possible to work directly with
     environments (see the functions [pop], [force_reduction], and [feed]) and
     to reconstruct a checkpoint out of an environment (see [input_needed]).
     This is considered advanced functionality; its purpose is to allow error
     recovery strategies to be programmed by the user. *)

  type 'a env

  type 'a checkpoint = private
    | InputNeeded of 'a env
    | Shifting of 'a env * 'a env * bool
    | AboutToReduce of 'a env * production
    | HandlingError of 'a env
    | Accepted of 'a
    | Rejected

  (* [offer] allows the user to resume the parser after it has suspended
     itself with a checkpoint of the form [InputNeeded env]. [offer] expects the
     old checkpoint as well as a new token and produces a new checkpoint. It does not
     raise any exception. *)

  val offer:
    'a checkpoint ->
    token * position * position ->
    'a checkpoint

  (* [resume] allows the user to resume the parser after it has suspended
     itself with a checkpoint of the form [AboutToReduce (env, prod)] or
     [HandlingError env]. [resume] expects the old checkpoint and produces a new
     checkpoint. It does not raise any exception. *)

  val resume:
    'a checkpoint ->
    'a checkpoint

  (* A token supplier is a function of no arguments which delivers a new token
     (together with its start and end positions) every time it is called. *)

  type supplier =
    unit -> token * position * position

  (* A pair of a lexer and a lexing buffer can be easily turned into a supplier. *)

  val lexer_lexbuf_to_supplier:
    (Lexing.lexbuf -> token) ->
    Lexing.lexbuf ->
    supplier

  (* The functions [offer] and [resume] are sufficient to write a parser loop.
     One can imagine many variations (which is why we expose these functions
     in the first place!). Here, we expose a few variations of the main loop,
     ready for use. *)

  (* [loop supplier checkpoint] begins parsing from [checkpoint], reading
     tokens from [supplier]. It continues parsing until it reaches a
     checkpoint of the form [Accepted v] or [Rejected]. In the former case, it
     returns [v]. In the latter case, it raises the exception [Error]. *)

  val loop: supplier -> 'a checkpoint -> 'a

  (* [loop_handle succeed fail supplier checkpoint] begins parsing from
     [checkpoint], reading tokens from [supplier]. It continues parsing until
     it reaches a checkpoint of the form [Accepted v] or [HandlingError env]
     (or [Rejected], but that should not happen, as [HandlingError _] will be
     observed first). In the former case, it calls [succeed v]. In the latter
     case, it calls [fail] with this checkpoint. It cannot raise [Error].

     This means that Menhir's traditional error-handling procedure (which pops
     the stack until a state that can act on the [error] token is found) does
     not get a chance to run. Instead, the user can implement her own error
     handling code, in the [fail] continuation. *)

  val loop_handle:
    ('a -> 'answer) ->
    ('a checkpoint -> 'answer) ->
    supplier -> 'a checkpoint -> 'answer

  (* [loop_handle_undo] is analogous to [loop_handle], except it passes a pair
     of checkpoints to the failure continuation.

     The first (and oldest) checkpoint is the last [InputNeeded] checkpoint that
     was encountered before the error was detected. The second (and newest)
     checkpoint is where the error was detected, as in [loop_handle]. Going back
     to the first checkpoint can be thought of as undoing any reductions that
     were performed after seeing the problematic token. (These reductions must
     be default reductions or spurious reductions.)

     [loop_handle_undo] must initially be applied to an [InputNeeded] checkpoint.
     The parser's initial checkpoints satisfy this constraint. *)

  val loop_handle_undo:
    ('a -> 'answer) ->
    ('a checkpoint -> 'a checkpoint -> 'answer) ->
    supplier -> 'a checkpoint -> 'answer

  (* [shifts checkpoint] assumes that [checkpoint] has been obtained by
     submitting a token to the parser. It runs the parser from [checkpoint],
     through an arbitrary number of reductions, until the parser either
     accepts this token (i.e., shifts) or rejects it (i.e., signals an error).
     If the parser decides to shift, then [Some env] is returned, where [env]
     is the parser's state just before shifting. Otherwise, [None] is
     returned. *)

  (* It is desirable that the semantic actions be side-effect free, or that
     their side-effects be harmless (replayable). *)

  val shifts: 'a checkpoint -> 'a env option

  (* The function [acceptable] allows testing, after an error has been
     detected, which tokens would have been accepted at this point. It is
     implemented using [shifts]. Its argument should be an [InputNeeded]
     checkpoint. *)

  (* For completeness, one must undo any spurious reductions before carrying out
     this test -- that is, one must apply [acceptable] to the FIRST checkpoint
     that is passed by [loop_handle_undo] to its failure continuation. *)

  (* This test causes some semantic actions to be run! The semantic actions
     should be side-effect free, or their side-effects should be harmless. *)

  (* The position [pos] is used as the start and end positions of the
     hypothetical token, and may be picked up by the semantic actions. We
     suggest using the position where the error was detected. *)

  val acceptable: 'a checkpoint -> token -> position -> bool

  (* The abstract type ['a lr1state] describes the non-initial states of the
     LR(1) automaton. The index ['a] represents the type of the semantic value
     associated with this state's incoming symbol. *)

  type 'a lr1state

  (* The states of the LR(1) automaton are numbered (from 0 and up). *)

  val number: _ lr1state -> int

  (* Productions are numbered. *)

  (* [find_production i] requires the index [i] to be valid. Use with care. *)

  val production_index: production -> int
  val find_production: int -> production

  (* An element is a pair of a non-initial state [s] and a semantic value [v]
     associated with the incoming symbol of this state. The idea is, the value
     [v] was pushed onto the stack just before the state [s] was entered. Thus,
     for some type ['a], the state [s] has type ['a lr1state] and the value [v]
     has type ['a]. In other words, the type [element] is an existential type. *)

  type element =
    | Element: 'a lr1state * 'a * position * position -> element

  (* The parser's stack is (or, more precisely, can be viewed as) a stream of
     elements. The type [stream] is defined by the module [General]. *)

  (* As of 2017/03/31, the types [stream] and [stack] and the function [stack]
     are DEPRECATED. They might be removed in the future. An alternative way
     of inspecting the stack is via the functions [top] and [pop]. *)

  type stack = (* DEPRECATED *)
    element stream

  (* This is the parser's stack, a stream of elements. This stream is empty if
     the parser is in an initial state; otherwise, it is non-empty.  The LR(1)
     automaton's current state is the one found in the top element of the
     stack. *)

  val stack: 'a env -> stack (* DEPRECATED *)

  (* [top env] returns the parser's top stack element. The state contained in
     this stack element is the current state of the automaton. If the stack is
     empty, [None] is returned. In that case, the current state of the
     automaton must be an initial state. *)

  val top: 'a env -> element option

  (* [pop_many i env] pops [i] cells off the automaton's stack. This is done
     via [i] successive invocations of [pop]. Thus, [pop_many 1] is [pop]. The
     index [i] must be nonnegative. The time complexity is O(i). *)

  val pop_many: int -> 'a env -> 'a env option

  (* [get i env] returns the parser's [i]-th stack element. The index [i] is
     0-based: thus, [get 0] is [top]. If [i] is greater than or equal to the
     number of elements in the stack, [None] is returned. The time complexity
     is O(i). *)

  val get: int -> 'a env -> element option

  (* [current_state_number env] is (the integer number of) the automaton's
     current state. This works even if the automaton's stack is empty, in
     which case the current state is an initial state. This number can be
     passed as an argument to a [message] function generated by [menhir
     --compile-errors]. *)

  val current_state_number: 'a env -> int

  (* [equal env1 env2] tells whether the parser configurations [env1] and
     [env2] are equal in the sense that the automaton's current state is the
     same in [env1] and [env2] and the stack is *physically* the same in
     [env1] and [env2]. If [equal env1 env2] is [true], then the sequence of
     the stack elements, as observed via [pop] and [top], must be the same in
     [env1] and [env2]. Also, if [equal env1 env2] holds, then the checkpoints
     [input_needed env1] and [input_needed env2] must be equivalent. The
     function [equal] has time complexity O(1). *)

  val equal: 'a env -> 'a env -> bool

  (* These are the start and end positions of the current lookahead token. If
     invoked in an initial state, this function returns a pair of twice the
     initial position. *)

  val positions: 'a env -> position * position

  (* When applied to an environment taken from a checkpoint of the form
     [AboutToReduce (env, prod)], the function [env_has_default_reduction]
     tells whether the reduction that is about to take place is a default
     reduction. *)

  val env_has_default_reduction: 'a env -> bool

  (* [state_has_default_reduction s] tells whether the state [s] has a default
     reduction. This includes the case where [s] is an accepting state. *)

  val state_has_default_reduction: _ lr1state -> bool

  (* [pop env] returns a new environment, where the parser's top stack cell
     has been popped off. (If the stack is empty, [None] is returned.) This
     amounts to pretending that the (terminal or nonterminal) symbol that
     corresponds to this stack cell has not been read. *)

  val pop: 'a env -> 'a env option

  (* [force_reduction prod env] should be called only if in the state [env]
     the parser is capable of reducing the production [prod]. If this
     condition is satisfied, then this production is reduced, which means that
     its semantic action is executed (this can have side effects!) and the
     automaton makes a goto (nonterminal) transition. If this condition is not
     satisfied, [Invalid_argument _] is raised. *)

  val force_reduction: production -> 'a env -> 'a env

  (* [input_needed env] returns [InputNeeded env]. That is, out of an [env]
     that might have been obtained via a series of calls to the functions
     [pop], [force_reduction], [feed], etc., it produces a checkpoint, which
     can be used to resume normal parsing, by supplying this checkpoint as an
     argument to [offer]. *)

  (* This function should be used with some care. It could "mess up the
     lookahead" in the sense that it allows parsing to resume in an arbitrary
     state [s] with an arbitrary lookahead symbol [t], even though Menhir's
     reachability analysis (menhir --list-errors) might well think that it is
     impossible to reach this particular configuration. If one is using
     Menhir's new error reporting facility, this could cause the parser to
     reach an error state for which no error message has been prepared. *)

  val input_needed: 'a env -> 'a checkpoint

end

(* This signature is a fragment of the inspection API that is made available
   to the user when [--inspection] is used. This fragment contains type
   definitions for symbols. *)

module type SYMBOLS = sig

  (* The type ['a terminal] represents a terminal symbol. The type ['a
     nonterminal] represents a nonterminal symbol. In both cases, the index
     ['a] represents the type of the semantic values associated with this
     symbol. The concrete definitions of these types are generated. *)

  type 'a terminal
  type 'a nonterminal

  (* The type ['a symbol] represents a terminal or nonterminal symbol. It is
     the disjoint union of the types ['a terminal] and ['a nonterminal]. *)

  type 'a symbol =
    | T : 'a terminal -> 'a symbol
    | N : 'a nonterminal -> 'a symbol

  (* The type [xsymbol] is an existentially quantified version of the type
     ['a symbol]. This type is useful in situations where the index ['a]
     is not statically known. *)

  type xsymbol =
    | X : 'a symbol -> xsymbol

end

(* This signature describes the inspection API that is made available to the
   user when [--inspection] is used. *)

module type INSPECTION = sig

  (* The types of symbols are described above. *)

  include SYMBOLS

  (* The type ['a lr1state] is meant to be the same as in [INCREMENTAL_ENGINE]. *)

  type 'a lr1state

  (* The type [production] is meant to be the same as in [INCREMENTAL_ENGINE].
     It represents a production of the grammar. A production can be examined
     via the functions [lhs] and [rhs] below. *)

  type production

  (* An LR(0) item is a pair of a production [prod] and a valid index [i] into
     this production. That is, if the length of [rhs prod] is [n], then [i] is
     comprised between 0 and [n], inclusive. *)

  type item =
      production * int

  (* Ordering functions. *)

  val compare_terminals: _ terminal -> _ terminal -> int
  val compare_nonterminals: _ nonterminal -> _ nonterminal -> int
  val compare_symbols: xsymbol -> xsymbol -> int
  val compare_productions: production -> production -> int
  val compare_items: item -> item -> int

  (* [incoming_symbol s] is the incoming symbol of the state [s], that is,
     the symbol that the parser must recognize before (has recognized when)
     it enters the state [s]. This function gives access to the semantic
     value [v] stored in a stack element [Element (s, v, _, _)]. Indeed,
     by case analysis on the symbol [incoming_symbol s], one discovers the
     type ['a] of the value [v]. *)

  val incoming_symbol: 'a lr1state -> 'a symbol

  (* [items s] is the set of the LR(0) items in the LR(0) core of the LR(1)
     state [s]. This set is not epsilon-closed. This set is presented as a
     list, in an arbitrary order. *)

  val items: _ lr1state -> item list

  (* [lhs prod] is the left-hand side of the production [prod]. This is
     always a non-terminal symbol. *)

  val lhs: production -> xsymbol

  (* [rhs prod] is the right-hand side of the production [prod]. This is
     a (possibly empty) sequence of (terminal or nonterminal) symbols. *)

  val rhs: production -> xsymbol list

  (* [nullable nt] tells whether the non-terminal symbol [nt] is nullable.
     That is, it is true if and only if this symbol produces the empty
     word [epsilon]. *)

  val nullable: _ nonterminal -> bool

  (* [first nt t] tells whether the FIRST set of the nonterminal symbol [nt]
     contains the terminal symbol [t]. That is, it is true if and only if
     [nt] produces a word that begins with [t]. *)

  val first: _ nonterminal -> _ terminal -> bool

  (* [xfirst] is analogous to [first], but expects a first argument of type
     [xsymbol] instead of [_ terminal]. *)

  val xfirst: xsymbol -> _ terminal -> bool

  (* [foreach_terminal] enumerates the terminal symbols, including [error].
     [foreach_terminal_but_error] enumerates the terminal symbols, excluding
     [error]. *)

  val foreach_terminal:           (xsymbol -> 'a -> 'a) -> 'a -> 'a
  val foreach_terminal_but_error: (xsymbol -> 'a -> 'a) -> 'a -> 'a

  (* The type [env] is meant to be the same as in [INCREMENTAL_ENGINE]. *)

  type 'a env

  (* [feed symbol startp semv endp env] causes the parser to consume the
     (terminal or nonterminal) symbol [symbol], accompanied with the semantic
     value [semv] and with the start and end positions [startp] and [endp].
     Thus, the automaton makes a transition, and reaches a new state. The
     stack grows by one cell. This operation is permitted only if the current
     state (as determined by [env]) has an outgoing transition labeled with
     [symbol]. Otherwise, [Invalid_argument _] is raised. *)

  val feed: 'a symbol -> position -> 'a -> position -> 'b env -> 'b env

end

(* This signature combines the incremental API and the inspection API. *)

module type EVERYTHING = sig

  include INCREMENTAL_ENGINE

  include INSPECTION
    with type 'a lr1state := 'a lr1state
    with type production := production
    with type 'a env := 'a env

end
end
module EngineTypes = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This file defines several types and module types that are used in the
   specification of module [Engine]. *)

(* --------------------------------------------------------------------------- *)

(* It would be nice if we could keep the structure of stacks and environments
   hidden. However, stacks and environments must be accessible to semantic
   actions, so the following data structure definitions must be public. *)

(* --------------------------------------------------------------------------- *)

(* A stack is a linked list of cells. A sentinel cell -- which is its own
   successor -- is used to mark the bottom of the stack. The sentinel cell
   itself is not significant -- it contains dummy values. *)

type ('state, 'semantic_value) stack = {

  (* The state that we should go back to if we pop this stack cell. *)

  (* This convention means that the state contained in the top stack cell is
     not the current state [env.current]. It also means that the state found
     within the sentinel is a dummy -- it is never consulted. This convention
     is the same as that adopted by the code-based back-end. *)

  state: 'state;

  (* The semantic value associated with the chunk of input that this cell
     represents. *)

  semv: 'semantic_value;

  (* The start and end positions of the chunk of input that this cell
     represents. *)

  startp: Lexing.position;
  endp: Lexing.position;

  (* The next cell down in the stack. If this is a self-pointer, then this
     cell is the sentinel, and the stack is conceptually empty. *)

  next: ('state, 'semantic_value) stack;

}

(* --------------------------------------------------------------------------- *)

(* A parsing environment contains all of the parser's state (except for the
   current program point). *)

type ('state, 'semantic_value, 'token) env = {

  (* If this flag is true, then the first component of [env.triple] should
     be ignored, as it has been logically overwritten with the [error]
     pseudo-token. *)

  error: bool;

  (* The last token that was obtained from the lexer, together with its start
     and end positions. Warning: before the first call to the lexer has taken
     place, a dummy (and possibly invalid) token is stored here. *)

  triple: 'token * Lexing.position * Lexing.position;

  (* The stack. In [CodeBackend], it is passed around on its own,
     whereas, here, it is accessed via the environment. *)

  stack: ('state, 'semantic_value) stack;

  (* The current state. In [CodeBackend], it is passed around on its
     own, whereas, here, it is accessed via the environment. *)

  current: 'state;

}

(* --------------------------------------------------------------------------- *)

(* This signature describes the parameters that must be supplied to the LR
   engine. *)

module type TABLE = sig

  (* The type of automaton states. *)

  type state

  (* States are numbered. *)

  val number: state -> int

  (* The type of tokens. These can be thought of as real tokens, that is,
     tokens returned by the lexer. They carry a semantic value. This type
     does not include the [error] pseudo-token. *)

  type token

  (* The type of terminal symbols. These can be thought of as integer codes.
     They do not carry a semantic value. This type does include the [error]
     pseudo-token. *)

  type terminal

  (* The type of nonterminal symbols. *)

  type nonterminal

  (* The type of semantic values. *)

  type semantic_value

  (* A token is conceptually a pair of a (non-[error]) terminal symbol and
     a semantic value. The following two functions are the pair projections. *)

  val token2terminal: token -> terminal
  val token2value: token -> semantic_value

  (* Even though the [error] pseudo-token is not a real token, it is a
     terminal symbol. Furthermore, for regularity, it must have a semantic
     value. *)

  val error_terminal: terminal
  val error_value: semantic_value

  (* [foreach_terminal] allows iterating over all terminal symbols. *)

  val foreach_terminal: (terminal -> 'a -> 'a) -> 'a -> 'a

  (* The type of productions. *)

  type production

  val production_index: production -> int
  val find_production: int -> production

  (* If a state [s] has a default reduction on production [prod], then, upon
     entering [s], the automaton should reduce [prod] without consulting the
     lookahead token. The following function allows determining which states
     have default reductions. *)

  (* Instead of returning a value of a sum type -- either [DefRed prod], or
     [NoDefRed] -- it accepts two continuations, and invokes just one of
     them. This mechanism allows avoiding a memory allocation. *)

  val default_reduction:
    state ->
    ('env -> production -> 'answer) ->
    ('env -> 'answer) ->
    'env -> 'answer

  (* An LR automaton can normally take three kinds of actions: shift, reduce,
     or fail. (Acceptance is a particular case of reduction: it consists in
     reducing a start production.) *)

  (* There are two variants of the shift action. [shift/discard s] instructs
     the automaton to discard the current token, request a new one from the
     lexer, and move to state [s]. [shift/nodiscard s] instructs it to move to
     state [s] without requesting a new token. This instruction should be used
     when [s] has a default reduction on [#]. See [CodeBackend.gettoken] for
     details. *)

  (* This is the automaton's action table. It maps a pair of a state and a
     terminal symbol to an action. *)

  (* Instead of returning a value of a sum type -- one of shift/discard,
     shift/nodiscard, reduce, or fail -- this function accepts three
     continuations, and invokes just one them. This mechanism allows avoiding
     a memory allocation. *)

  (* In summary, the parameters to [action] are as follows:

     - the first two parameters, a state and a terminal symbol, are used to
       look up the action table;

     - the next parameter is the semantic value associated with the above
       terminal symbol; it is not used, only passed along to the shift
       continuation, as explained below;

     - the shift continuation expects an environment; a flag that tells
       whether to discard the current token; the terminal symbol that
       is being shifted; its semantic value; and the target state of
       the transition;

     - the reduce continuation expects an environment and a production;

     - the fail continuation expects an environment;

     - the last parameter is the environment; it is not used, only passed
       along to the selected continuation. *)

  val action:
    state ->
    terminal ->
    semantic_value ->
    ('env -> bool -> terminal -> semantic_value -> state -> 'answer) ->
    ('env -> production -> 'answer) ->
    ('env -> 'answer) ->
    'env -> 'answer

  (* This is the automaton's goto table. This table maps a pair of a state
     and a nonterminal symbol to a new state. By extension, it also maps a
     pair of a state and a production to a new state. *)

  (* The function [goto_nt] can be applied to [s] and [nt] ONLY if the state
     [s] has an outgoing transition labeled [nt]. Otherwise, its result is
     undefined. Similarly, the call [goto_prod prod s] is permitted ONLY if
     the state [s] has an outgoing transition labeled with the nonterminal
     symbol [lhs prod]. The function [maybe_goto_nt] involves an additional
     dynamic check and CAN be called even if there is no outgoing transition. *)

  val       goto_nt  : state -> nonterminal -> state
  val       goto_prod: state -> production  -> state
  val maybe_goto_nt:   state -> nonterminal -> state option

  (* [is_start prod] tells whether the production [prod] is a start production. *)

  val is_start: production -> bool

  (* By convention, a semantic action is responsible for:

     1. fetching whatever semantic values and positions it needs off the stack;

     2. popping an appropriate number of cells off the stack, as dictated
        by the length of the right-hand side of the production;

     3. computing a new semantic value, as well as new start and end positions;

     4. pushing a new stack cell, which contains the three values
        computed in step 3;

     5. returning the new stack computed in steps 2 and 4.

     Point 1 is essentially forced upon us: if semantic values were fetched
     off the stack by this interpreter, then the calling convention for
     semantic actions would be variadic: not all semantic actions would have
     the same number of arguments. The rest follows rather naturally. *)

  (* Semantic actions are allowed to raise [Error]. *)

  exception Error

  type semantic_action =
      (state, semantic_value, token) env -> (state, semantic_value) stack

  val semantic_action: production -> semantic_action

  (* [may_reduce state prod] tests whether the state [state] is capable of
     reducing the production [prod]. This function is currently costly and
     is not used by the core LR engine. It is used in the implementation
     of certain functions, such as [force_reduction], which allow the engine
     to be driven programmatically. *)

  val may_reduce: state -> production -> bool

  (* The LR engine requires a number of hooks, which are used for logging. *)

  (* The comments below indicate the conventional messages that correspond
     to these hooks in the code-based back-end; see [CodeBackend]. *)

  (* If the flag [log] is false, then the logging functions are not called.
     If it is [true], then they are called. *)

  val log : bool

  module Log : sig

    (* State %d: *)

    val state: state -> unit

    (* Shifting (<terminal>) to state <state> *)

    val shift: terminal -> state -> unit

    (* Reducing a production should be logged either as a reduction
       event (for regular productions) or as an acceptance event (for
       start productions). *)

    (* Reducing production <production> / Accepting *)

    val reduce_or_accept: production -> unit

    (* Lookahead token is now <terminal> (<pos>-<pos>) *)

    val lookahead_token: terminal -> Lexing.position -> Lexing.position -> unit

    (* Initiating error handling *)

    val initiating_error_handling: unit -> unit

    (* Resuming error handling *)

    val resuming_error_handling: unit -> unit

    (* Handling error in state <state> *)

    val handling_error: state -> unit

  end

end

(* --------------------------------------------------------------------------- *)

(* This signature describes the monolithic (traditional) LR engine. *)

(* In this interface, the parser controls the lexer. *)

module type MONOLITHIC_ENGINE = sig

  type state

  type token

  type semantic_value

  (* An entry point to the engine requires a start state, a lexer, and a lexing
     buffer. It either succeeds and produces a semantic value, or fails and
     raises [Error]. *)

  exception Error

  val entry:
    state ->
    (Lexing.lexbuf -> token) ->
    Lexing.lexbuf ->
    semantic_value

end

(* --------------------------------------------------------------------------- *)

(* The following signatures describe the incremental LR engine. *)

(* First, see [INCREMENTAL_ENGINE] in the file [IncrementalEngine.ml]. *)

(* The [start] function is set apart because we do not wish to publish
   it as part of the generated [parser.mli] file. Instead, the table
   back-end will publish specialized versions of it, with a suitable
   type cast. *)

module type INCREMENTAL_ENGINE_START = sig

  (* [start] is an entry point. It requires a start state and a start position
     and begins the parsing process. If the lexer is based on an OCaml lexing
     buffer, the start position should be [lexbuf.lex_curr_p]. [start] produces
     a checkpoint, which usually will be an [InputNeeded] checkpoint. (It could
     be [Accepted] if this starting state accepts only the empty word. It could
     be [Rejected] if this starting state accepts no word at all.) It does not
     raise any exception. *)

  (* [start s pos] should really produce a checkpoint of type ['a checkpoint],
     for a fixed ['a] that depends on the state [s]. We cannot express this, so
     we use [semantic_value checkpoint], which is safe. The table back-end uses
     [Obj.magic] to produce safe specialized versions of [start]. *)

  type state
  type semantic_value
  type 'a checkpoint

  val start:
    state ->
    Lexing.position ->
    semantic_value checkpoint

end

(* --------------------------------------------------------------------------- *)

(* This signature describes the LR engine, which combines the monolithic
   and incremental interfaces. *)

module type ENGINE = sig

  include MONOLITHIC_ENGINE

  include IncrementalEngine.INCREMENTAL_ENGINE
    with type token := token
     and type 'a lr1state = state (* useful for us; hidden from the end user *)

  include INCREMENTAL_ENGINE_START
    with type state := state
     and type semantic_value := semantic_value
     and type 'a checkpoint := 'a checkpoint

end
end
module Engine = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

type position = Lexing.position
open EngineTypes

(* The LR parsing engine. *)

(* This module is used:

   - at compile time, if so requested by the user, via the --interpret options;
   - at run time, in the table-based back-end. *)

module Make (T : TABLE) = struct

  (* This propagates type and exception definitions. The functions [number],
     [production_index], [find_production], too, are defined by this [include]
     declaration. *)

  include T

  type 'a env =
      (state, semantic_value, token) EngineTypes.env

  (* ------------------------------------------------------------------------ *)

  (* The type [checkpoint] represents an intermediate or final result of the
     parser. See [EngineTypes]. *)

  (* The type [checkpoint] is presented to the user as a private type (see
     [IncrementalEngine]). This prevents the user from manufacturing
     checkpoints (i.e., continuations) that do not make sense. (Such
     continuations could potentially violate the LR invariant and lead to
     crashes.) *)

  (* 2017/03/29 Although [checkpoint] is a private type, we now expose a
     constructor function, [input_needed]. This function allows manufacturing
     a checkpoint out of an environment. For this reason, the type [env] must
     also be parameterized with ['a]. *)

  type 'a checkpoint =
    | InputNeeded of 'a env
    | Shifting of 'a env * 'a env * bool
    | AboutToReduce of 'a env * production
    | HandlingError of 'a env
    | Accepted of 'a
    | Rejected

  (* ------------------------------------------------------------------------ *)

  (* In the code-based back-end, the [run] function is sometimes responsible
     for pushing a new cell on the stack. This is motivated by code sharing
     concerns. In this interpreter, there is no such concern; [run]'s caller
     is always responsible for updating the stack. *)

  (* In the code-based back-end, there is a [run] function for each state
     [s]. This function can behave in two slightly different ways, depending
     on when it is invoked, or (equivalently) depending on [s].

     If [run] is invoked after shifting a terminal symbol (or, equivalently,
     if [s] has a terminal incoming symbol), then [run] discards a token,
     unless [s] has a default reduction on [#]. (Indeed, in that case,
     requesting the next token might drive the lexer off the end of the input
     stream.)

     If, on the other hand, [run] is invoked after performing a goto
     transition, or invoked directly by an entry point, then there is nothing
     to discard.

     These two cases are reflected in [CodeBackend.gettoken].

     Here, the code is structured in a slightly different way. It is up to the
     caller of [run] to indicate whether to discard a token, via the parameter
     [please_discard]. This flag is set when [s] is being entered by shifting
     a terminal symbol and [s] does not have a default reduction on [#]. *)

  (* The following recursive group of functions are tail recursive, produce a
     checkpoint of type [semantic_value checkpoint], and cannot raise an
     exception. A semantic action can raise [Error], but this exception is
     immediately caught within [reduce]. *)

  let rec run env please_discard : semantic_value checkpoint =

    (* Log the fact that we just entered this state. *)

    if log then
      Log.state env.current;

    (* If [please_discard] is set, we discard the current lookahead token and
       fetch the next one. In order to request a token from the user, we
       return an [InputNeeded] continuation, which, when invoked by the user,
       will take us to [discard]. If [please_discard] is not set, we skip this
       step and jump directly to [check_for_default_reduction]. *)

    if please_discard then
      InputNeeded env
    else
      check_for_default_reduction env

  (* [discard env triple] stores [triple] into [env], overwriting the previous
     token. It is invoked by [offer], which itself is invoked by the user in
     response to an [InputNeeded] checkpoint. *)

  and discard env triple =
    if log then begin
      let (token, startp, endp) = triple in
      Log.lookahead_token (T.token2terminal token) startp endp
    end;
    let env = { env with error = false; triple } in
    check_for_default_reduction env

  and check_for_default_reduction env =

    (* Examine what situation we are in. This case analysis is analogous to
       that performed in [CodeBackend.gettoken], in the sub-case where we do
       not have a terminal incoming symbol. *)

    T.default_reduction
      env.current
      announce_reduce       (* there is a default reduction; perform it *)
      check_for_error_token (* there is none; continue below *)
      env

  and check_for_error_token env =

    (* There is no default reduction. Consult the current lookahead token
       so as to determine which action should be taken. *)

    (* Peeking at the first input token, without taking it off the input
       stream, is done by reading [env.triple]. We are careful to first
       check [env.error]. *)

    (* Note that, if [please_discard] was true, then we have just called
       [discard], so the lookahead token cannot be [error]. *)

    (* Returning [HandlingError env] is equivalent to calling [error env]
       directly, except it allows the user to regain control. *)

    if env.error then begin
      if log then
        Log.resuming_error_handling();
      HandlingError env
    end
    else
      let (token, _, _) = env.triple in

      (* We consult the two-dimensional action table, indexed by the
         current state and the current lookahead token, in order to
         determine which action should be taken. *)

      T.action
        env.current                    (* determines a row *)
        (T.token2terminal token)       (* determines a column *)
        (T.token2value token)
        shift                          (* shift continuation *)
        announce_reduce                (* reduce continuation *)
        initiate                       (* failure continuation *)
        env

  (* ------------------------------------------------------------------------ *)

  (* This function takes care of shift transitions along a terminal symbol.
     (Goto transitions are taken care of within [reduce] below.) The symbol
     can be either an actual token or the [error] pseudo-token. *)

  (* Here, the lookahead token CAN be [error]. *)

  and shift env
      (please_discard : bool)
      (terminal : terminal)
      (value : semantic_value)
      (s' : state) =

    (* Log the transition. *)

    if log then
      Log.shift terminal s';

    (* Push a new cell onto the stack, containing the identity of the
       state that we are leaving. *)

    let (_, startp, endp) = env.triple in
    let stack = {
      state = env.current;
      semv = value;
      startp;
      endp;
      next = env.stack;
    } in

    (* Switch to state [s']. *)

    let new_env = { env with stack; current = s' } in

    (* Expose the transition to the user. (In principle, we have a choice
       between exposing the transition before we take it, after we take
       it, or at some point in between. This affects the number and type
       of the parameters carried by [Shifting]. Here, we choose to expose
       the transition after we take it; this allows [Shifting] to carry
       only three parameters, whose meaning is simple.) *)

    Shifting (env, new_env, please_discard)

  (* ------------------------------------------------------------------------ *)

  (* The function [announce_reduce] stops the parser and returns a checkpoint
     which allows the parser to be resumed by calling [reduce]. *)

  (* Only ordinary productions are exposed to the user. Start productions
     are not exposed to the user. Reducing a start production simply leads
     to the successful termination of the parser. *)

  and announce_reduce env (prod : production) =
    if T.is_start prod then
      accept env prod
    else
      AboutToReduce (env, prod)

  (* The function [reduce] takes care of reductions. It is invoked by
     [resume] after an [AboutToReduce] event has been produced. *)

  (* Here, the lookahead token CAN be [error]. *)

  (* The production [prod] CANNOT be a start production. *)

  and reduce env (prod : production) =

    (* Log a reduction event. *)

    if log then
      Log.reduce_or_accept prod;

    (* Invoke the semantic action. The semantic action is responsible for
       truncating the stack and pushing a new cell onto the stack, which
       contains a new semantic value. It can raise [Error]. *)

    (* If the semantic action terminates normally, it returns a new stack,
       which becomes the current stack. *)

    (* If the semantic action raises [Error], we catch it and initiate error
       handling. *)

    (* This [match/with/exception] construct requires OCaml 4.02. *)

    match T.semantic_action prod env with
    | stack ->

        (* By our convention, the semantic action has produced an updated
           stack. The state now found in the top stack cell is the return
           state. *)

        (* Perform a goto transition. The target state is determined
           by consulting the goto table at the return state and at
           production [prod]. *)

        let current = T.goto_prod stack.state prod in
        let env = { env with stack; current } in
        run env false

    | exception Error ->
        initiate env

  and accept env prod =
    (* Log an accept event. *)
    if log then
      Log.reduce_or_accept prod;
    (* Extract the semantic value out of the stack. *)
    let v = env.stack.semv in
    (* Finish. *)
    Accepted v

  (* ------------------------------------------------------------------------ *)

  (* The following functions deal with errors. *)

  (* [initiate] initiates or resumes error handling. *)

  (* Here, the lookahead token CAN be [error]. *)

  and initiate env =
    if log then
      Log.initiating_error_handling();
    let env = { env with error = true } in
    HandlingError env

  (* [error] handles errors. *)

  and error env =
    assert env.error;

    (* Consult the column associated with the [error] pseudo-token in the
       action table. *)

    T.action
      env.current                    (* determines a row *)
      T.error_terminal               (* determines a column *)
      T.error_value
      error_shift                    (* shift continuation *)
      error_reduce                   (* reduce continuation *)
      error_fail                     (* failure continuation *)
      env

  and error_shift env please_discard terminal value s' =

    (* Here, [terminal] is [T.error_terminal],
       and [value] is [T.error_value]. *)

    assert (terminal = T.error_terminal && value = T.error_value);

    (* This state is capable of shifting the [error] token. *)

    if log then
      Log.handling_error env.current;
    shift env please_discard terminal value s'

  and error_reduce env prod =

    (* This state is capable of performing a reduction on [error]. *)

    if log then
      Log.handling_error env.current;
    reduce env prod
      (* Intentionally calling [reduce] instead of [announce_reduce].
         It does not seem very useful, and it could be confusing, to
         expose the reduction steps taken during error handling. *)

  and error_fail env =

    (* This state is unable to handle errors. Attempt to pop a stack
       cell. *)

    let cell = env.stack in
    let next = cell.next in
    if next == cell then

      (* The stack is empty. Die. *)

      Rejected

    else begin

      (* The stack is nonempty. Pop a cell, updating the current state
         with that found in the popped cell, and try again. *)

      let env = { env with
        stack = next;
        current = cell.state
      } in
      HandlingError env

    end

  (* End of the nest of tail recursive functions. *)

  (* ------------------------------------------------------------------------ *)
  (* ------------------------------------------------------------------------ *)

  (* The incremental interface. See [EngineTypes]. *)

  (* [start s] begins the parsing process. *)

  let start (s : state) (initial : position) : semantic_value checkpoint =

    (* Build an empty stack. This is a dummy cell, which is its own successor.
       Its [next] field WILL be accessed by [error_fail] if an error occurs and
       is propagated all the way until the stack is empty. Its [endp] field WILL
       be accessed (by a semantic action) if an epsilon production is reduced
       when the stack is empty. *)

    let rec empty = {
      state = s;                          (* dummy *)
      semv = T.error_value;               (* dummy *)
      startp = initial;                   (* dummy *)
      endp = initial;
      next = empty;
    } in

    (* Build an initial environment. *)

    (* Unfortunately, there is no type-safe way of constructing a
       dummy token. Tokens carry semantic values, which in general
       we cannot manufacture. This instance of [Obj.magic] could
       be avoided by adopting a different representation (e.g., no
       [env.error] field, and an option in the first component of
       [env.triple]), but I like this representation better. *)

    let dummy_token = Obj.magic () in
    let env = {
      error = false;
      triple = (dummy_token, initial, initial); (* dummy *)
      stack = empty;
      current = s;
    } in

    (* Begin parsing. *)

    (* The parameter [please_discard] here is [true], which means we know
       that we must read at least one token. This claim relies on the fact
       that we have ruled out the two special cases where a start symbol
       recognizes the empty language or the singleton language {epsilon}. *)

    run env true

  (* [offer checkpoint triple] is invoked by the user in response to a
     checkpoint of the form [InputNeeded env]. It checks that [checkpoint] is
     indeed of this form, and invokes [discard]. *)

  (* [resume checkpoint] is invoked by the user in response to a checkpoint of
     the form [AboutToReduce (env, prod)] or [HandlingError env]. It checks
     that [checkpoint] is indeed of this form, and invokes [reduce] or
     [error], as appropriate. *)

  (* In reality, [offer] and [resume] accept an argument of type
     [semantic_value checkpoint] and produce a checkpoint of the same type.
     The choice of [semantic_value] is forced by the fact that this is the
     parameter of the checkpoint [Accepted]. *)

  (* We change this as follows. *)

  (* We change the argument and result type of [offer] and [resume] from
     [semantic_value checkpoint] to ['a checkpoint]. This is safe, in this
     case, because we give the user access to values of type [t checkpoint]
     only if [t] is indeed the type of the eventual semantic value for this
     run. (More precisely, by examining the signatures [INCREMENTAL_ENGINE]
     and [INCREMENTAL_ENGINE_START], one finds that the user can build a value
     of type ['a checkpoint] only if ['a] is [semantic_value]. The table
     back-end goes further than this and produces versions of [start] composed
     with a suitable cast, which give the user access to a value of type
     [t checkpoint] where [t] is the type of the start symbol.) *)

  let offer : 'a . 'a checkpoint ->
                   token * position * position ->
                   'a checkpoint
  = function
    | InputNeeded env ->
        Obj.magic discard env
    | _ ->
        invalid_arg "offer expects InputNeeded"

  let resume : 'a . 'a checkpoint -> 'a checkpoint = function
    | HandlingError env ->
        Obj.magic error env
    | Shifting (_, env, please_discard) ->
        Obj.magic run env please_discard
    | AboutToReduce (env, prod) ->
        Obj.magic reduce env prod
    | _ ->
        invalid_arg "resume expects HandlingError | Shifting | AboutToReduce"

  (* ------------------------------------------------------------------------ *)
  (* ------------------------------------------------------------------------ *)

  (* The traditional interface. See [EngineTypes]. *)

  (* ------------------------------------------------------------------------ *)

  (* Wrapping a lexer and lexbuf as a token supplier. *)

  type supplier =
    unit -> token * position * position

  let lexer_lexbuf_to_supplier
      (lexer : Lexing.lexbuf -> token)
      (lexbuf : Lexing.lexbuf)
  : supplier =
    fun () ->
      let token = lexer lexbuf in
      let startp = lexbuf.Lexing.lex_start_p
      and endp = lexbuf.Lexing.lex_curr_p in
      token, startp, endp

  (* ------------------------------------------------------------------------ *)

  (* The main loop repeatedly handles intermediate checkpoints, until a final
     checkpoint is obtained. This allows implementing the monolithic interface
     ([entry]) in terms of the incremental interface ([start], [offer],
     [handle], [reduce]). *)

  (* By convention, acceptance is reported by returning a semantic value,
     whereas rejection is reported by raising [Error]. *)

  (* [loop] is polymorphic in ['a]. No cheating is involved in achieving this.
     All of the cheating resides in the types assigned to [offer] and [handle]
     above. *)

  let rec loop : 'a . supplier -> 'a checkpoint -> 'a =
    fun read checkpoint ->
    match checkpoint with
    | InputNeeded _ ->
        (* The parser needs a token. Request one from the lexer,
           and offer it to the parser, which will produce a new
           checkpoint. Then, repeat. *)
        let triple = read() in
        let checkpoint = offer checkpoint triple in
        loop read checkpoint
    | Shifting _
    | AboutToReduce _
    | HandlingError _ ->
        (* The parser has suspended itself, but does not need
           new input. Just resume the parser. Then, repeat. *)
        let checkpoint = resume checkpoint in
        loop read checkpoint
    | Accepted v ->
        (* The parser has succeeded and produced a semantic value.
           Return this semantic value to the user. *)
        v
    | Rejected ->
        (* The parser rejects this input. Raise an exception. *)
        raise Error

  let entry (s : state) lexer lexbuf : semantic_value =
    let initial = lexbuf.Lexing.lex_curr_p in
    loop (lexer_lexbuf_to_supplier lexer lexbuf) (start s initial)

  (* ------------------------------------------------------------------------ *)

  (* [loop_handle] stops if it encounters an error, and at this point, invokes
     its failure continuation, without letting Menhir do its own traditional
     error-handling (which involves popping the stack, etc.). *)

  let rec loop_handle succeed fail read checkpoint =
    match checkpoint with
    | InputNeeded _ ->
        let triple = read() in
        let checkpoint = offer checkpoint triple in
        loop_handle succeed fail read checkpoint
    | Shifting _
    | AboutToReduce _ ->
        let checkpoint = resume checkpoint in
        loop_handle succeed fail read checkpoint
    | HandlingError _
    | Rejected ->
        (* The parser has detected an error. Invoke the failure continuation. *)
        fail checkpoint
    | Accepted v ->
        (* The parser has succeeded and produced a semantic value. Invoke the
           success continuation. *)
        succeed v

  (* ------------------------------------------------------------------------ *)

  (* [loop_handle_undo] is analogous to [loop_handle], except it passes a pair
     of checkpoints to the failure continuation.

     The first (and oldest) checkpoint is the last [InputNeeded] checkpoint
     that was encountered before the error was detected. The second (and
     newest) checkpoint is where the error was detected, as in [loop_handle].
     Going back to the first checkpoint can be thought of as undoing any
     reductions that were performed after seeing the problematic token. (These
     reductions must be default reductions or spurious reductions.) *)

  let rec loop_handle_undo succeed fail read (inputneeded, checkpoint) =
    match checkpoint with
    | InputNeeded _ ->
        (* Update the last recorded [InputNeeded] checkpoint. *)
        let inputneeded = checkpoint in
        let triple = read() in
        let checkpoint = offer checkpoint triple in
        loop_handle_undo succeed fail read (inputneeded, checkpoint)
    | Shifting _
    | AboutToReduce _ ->
        let checkpoint = resume checkpoint in
        loop_handle_undo succeed fail read (inputneeded, checkpoint)
    | HandlingError _
    | Rejected ->
        fail inputneeded checkpoint
    | Accepted v ->
        succeed v

  (* For simplicity, we publish a version of [loop_handle_undo] that takes a
     single checkpoint as an argument, instead of a pair of checkpoints. We
     check that the argument is [InputNeeded _], and duplicate it. *)

  (* The parser cannot accept or reject before it asks for the very first
     character of input. (Indeed, we statically reject a symbol that
     generates the empty language or the singleton language {epsilon}.)
     So, the [start] checkpoint must match [InputNeeded _]. Hence, it is
     permitted to call [loop_handle_undo] with a [start] checkpoint. *)

  let loop_handle_undo succeed fail read checkpoint =
    assert (match checkpoint with InputNeeded _ -> true | _ -> false);
    loop_handle_undo succeed fail read (checkpoint, checkpoint)

  (* ------------------------------------------------------------------------ *)

  let rec shifts checkpoint =
    match checkpoint with
    | Shifting (env, _, _) ->
        (* The parser is about to shift, which means it is willing to
           consume the terminal symbol that we have fed it. Return the
           state just before this transition. *)
        Some env
    | AboutToReduce _ ->
        (* The parser wishes to reduce. Just follow. *)
        shifts (resume checkpoint)
    | HandlingError _ ->
        (* The parser fails, which means it rejects the terminal symbol
           that we have fed it. *)
        None
    | InputNeeded _
    | Accepted _
    | Rejected ->
        (* None of these cases can arise. Indeed, after a token is submitted
           to it, the parser must shift, reduce, or signal an error, before
           it can request another token or terminate. *)
        assert false

  let acceptable checkpoint token pos =
    let triple = (token, pos, pos) in
    let checkpoint = offer checkpoint triple in
    match shifts checkpoint with
    | None      -> false
    | Some _env -> true

  (* ------------------------------------------------------------------------ *)

  (* The type ['a lr1state] describes the (non-initial) states of the LR(1)
     automaton. The index ['a] represents the type of the semantic value
     associated with the state's incoming symbol. *)

  (* The type ['a lr1state] is defined as an alias for [state], which itself
     is usually defined as [int] (see [TableInterpreter]). So, ['a lr1state]
     is technically a phantom type, but should really be thought of as a GADT
     whose data constructors happen to be represented as integers. It is
     presented to the user as an abstract type (see [IncrementalEngine]). *)

  type 'a lr1state =
      state

  (* ------------------------------------------------------------------------ *)

  (* Stack inspection. *)

  (* We offer a read-only view of the parser's state as a stream of elements.
     Each element contains a pair of a (non-initial) state and a semantic
     value associated with (the incoming symbol of) this state. Note that the
     type [element] is an existential type. *)

  (* As of 2017/03/31, the type [stack] and the function [stack] are DEPRECATED.
     If desired, they could now be implemented outside Menhir, by relying on
     the functions [top] and [pop]. *)

  type element =
    | Element: 'a lr1state * 'a * position * position -> element

  open General

  type stack =
    element stream

  (* If [current] is the current state and [cell] is the top stack cell,
     then [stack cell current] is a view of the parser's state as a stream
     of elements. *)

  let rec stack cell current : element stream =
    lazy (
      (* The stack is empty iff the top stack cell is its own successor. In
         that case, the current state [current] should be an initial state
         (which has no incoming symbol).
         We do not allow the user to inspect this state. *)
      let next = cell.next in
      if next == cell then
        Nil
      else
        (* Construct an element containing the current state [current] as well
           as the semantic value contained in the top stack cell. This semantic
           value is associated with the incoming symbol of this state, so it
           makes sense to pair them together. The state has type ['a state] and
           the semantic value has type ['a], for some type ['a]. Here, the OCaml
           type-checker thinks ['a] is [semantic_value] and considers this code
           well-typed. Outside, we will use magic to provide the user with a way
           of inspecting states and recovering the value of ['a]. *)
        let element = Element (
          current,
          cell.semv,
          cell.startp,
          cell.endp
        ) in
        Cons (element, stack next cell.state)
    )

  let stack env : element stream =
    stack env.stack env.current

  (* As explained above, the function [top] allows access to the top stack
     element only if the stack is nonempty, i.e., only if the current state
     is not an initial state. *)

  let top env : element option =
    let cell = env.stack in
    let next = cell.next in
    if next == cell then
      None
    else
      Some (Element (env.current, cell.semv, cell.startp, cell.endp))

  (* [equal] compares the stacks for physical equality, and compares the
     current states via their numbers (this seems cleaner than using OCaml's
     polymorphic equality). *)

  (* The two fields that are not compared by [equal], namely [error] and
     [triple], are overwritten by the function [discard], which handles
     [InputNeeded] checkpoints. Thus, if [equal env1 env2] holds, then the
     checkpoints [input_needed env1] and [input_needed env2] are
     equivalent: they lead the parser to behave in the same way. *)

  let equal env1 env2 =
    env1.stack == env2.stack &&
    number env1.current = number env2.current

  let current_state_number env =
    number env.current

  (* ------------------------------------------------------------------------ *)

  (* Access to the position of the lookahead token. *)

  let positions { triple = (_, startp, endp); _ } =
    startp, endp

  (* ------------------------------------------------------------------------ *)

  (* Access to information about default reductions. *)

  (* This can be a function of states, or a function of environments.
     We offer both. *)

  (* Instead of a Boolean result, we could return a [production option].
     However, we would have to explicitly test whether [prod] is a start
     production, and in that case, return [None], I suppose. Indeed, we
     have decided not to expose the start productions. *)

  let state_has_default_reduction (state : _ lr1state) : bool =
    T.default_reduction state
      (fun _env _prod -> true)
      (fun _env -> false)
      ()

  let env_has_default_reduction env =
    state_has_default_reduction env.current

  (* ------------------------------------------------------------------------ *)

  (* The following functions work at the level of environments (as opposed to
     checkpoints). The function [pop] causes the automaton to go back into the
     past, pretending that the last input symbol has never been read. The
     function [force_reduction] causes the automaton to re-interpret the past,
     by recognizing the right-hand side of a production and reducing this
     production. The function [feed] causes the automaton to progress into the
     future by pretending that a (terminal or nonterminal) symbol has been
     read. *)

  (* The function [feed] would ideally be defined here. However, for this
     function to be type-safe, the GADT ['a symbol] is needed. For this
     reason, we move its definition to [InspectionTableInterpreter], where
     the inspection API is available. *)

  (* [pop] pops one stack cell. It cannot go wrong. *)

  let pop (env : 'a env) : 'a env option =
    let cell = env.stack in
    let next = cell.next in
    if next == cell then
      (* The stack is empty. *)
      None
    else
      (* The stack is nonempty. Pop off one cell. *)
      Some { env with stack = next; current = cell.state }

  (* [force_reduction] is analogous to [reduce], except that it does not
     continue by calling [run env] or [initiate env]. Instead, it returns
     [env] to the user. *)

  (* [force_reduction] is dangerous insofar as it executes a semantic action.
     This semantic action could have side effects: nontermination, state,
     exceptions, input/output, etc. *)

  let force_reduction prod (env : 'a env) : 'a env =
    (* Check if this reduction is permitted. This check is REALLY important.
       The stack must have the correct shape: that is, it must be sufficiently
       high, and must contain semantic values of appropriate types, otherwise
       the semantic action will crash and burn. *)
    (* We currently check whether the current state is WILLING to reduce this
       production (i.e., there is a reduction action in the action table row
       associated with this state), whereas it would be more liberal to check
       whether this state is CAPABLE of reducing this production (i.e., the
       stack has an appropriate shape). We currently have no means of
       performing such a check. *)
    if not (T.may_reduce env.current prod) then
      invalid_arg "force_reduction: this reduction is not permitted in this state"
    else begin
      (* We do not expose the start productions to the user, so this cannot be
         a start production. Hence, it has a semantic action. *)
      assert (not (T.is_start prod));
      (* Invoke the semantic action. *)
      let stack = T.semantic_action prod env in
      (* Perform a goto transition. *)
      let current = T.goto_prod stack.state prod in
      { env with stack; current }
    end

  (* The environment manipulation functions -- [pop] and [force_reduction]
     above, plus [feed] -- manipulate the automaton's stack and current state,
     but do not affect the automaton's lookahead symbol. When the function
     [input_needed] is used to go back from an environment to a checkpoint
     (and therefore, resume normal parsing), the lookahead symbol is clobbered
     anyway, since the only action that the user can take is to call [offer].
     So far, so good. One problem, though, is that this call to [offer] may
     well place the automaton in a configuration of a state [s] and a
     lookahead symbol [t] that is normally unreachable. Also, perhaps the
     state [s] is a state where an input symbol normally is never demanded, so
     this [InputNeeded] checkpoint is fishy. There does not seem to be a deep
     problem here, but, when programming an error recovery strategy, one
     should pay some attention to this issue. Ideally, perhaps, one should use
     [input_needed] only in a state [s] where an input symbol is normally
     demanded, that is, a state [s] whose incoming symbol is a terminal symbol
     and which does not have a default reduction on [#]. *)

  let input_needed (env : 'a env) : 'a checkpoint =
    InputNeeded env

  (* The following functions are compositions of [top] and [pop]. *)

  let rec pop_many i env =
    if i = 0 then
      Some env
    else match pop env with
    | None ->
        None
    | Some env ->
        pop_many (i - 1) env

  let get i env =
    match pop_many i env with
    | None ->
        None
    | Some env ->
        top env

end
end
module ErrorReports = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* -------------------------------------------------------------------------- *)

(* A two-place buffer stores zero, one, or two elements. *)

type 'a content =
| Zero
| One of 'a
| Two of 'a * (* most recent: *) 'a

type 'a buffer =
  'a content ref

(* [update buffer x] pushes [x] into [buffer], causing the buffer to slide. *)

let update buffer x =
  buffer :=
    match !buffer, x with
    | Zero, _ ->
        One x
    | One x1, x2
    | Two (_, x1), x2 ->
        Two (x1, x2)

(* [show f buffer] prints the contents of the buffer. The function [f] is
   used to print an element. *)

let show f buffer : string =
  match !buffer with
  | Zero ->
      (* The buffer cannot be empty. If we have read no tokens,
         we cannot have detected a syntax error. *)
      assert false
  | One invalid ->
      (* It is unlikely, but possible, that we have read just one token. *)
      Printf.sprintf "before '%s'" (f invalid)
  | Two (valid, invalid) ->
      (* In the most likely case, we have read two tokens. *)
      Printf.sprintf "after '%s' and before '%s'" (f valid) (f invalid)

(* [last buffer] returns the last element of the buffer (that is, the invalid
   token). *)

let last buffer =
  match !buffer with
  | Zero ->
      (* The buffer cannot be empty. If we have read no tokens,
         we cannot have detected a syntax error. *)
      assert false
  | One invalid
  | Two (_, invalid) ->
      invalid

(* [wrap buffer lexer] *)

open Lexing

let wrap lexer =
  let buffer = ref Zero in
  buffer,
  fun lexbuf ->
    let token = lexer lexbuf in
    update buffer (lexbuf.lex_start_p, lexbuf.lex_curr_p);
    token

(* -------------------------------------------------------------------------- *)
end
module Printers = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

module Make
  (I : IncrementalEngine.EVERYTHING)
  (User : sig
    val print: string -> unit
    val print_symbol: I.xsymbol -> unit
    val print_element: (I.element -> unit) option
  end)
= struct

  let arrow = " -> "
  let dot = "."
  let space = " "
  let newline = "\n"

  open User
  open I

  (* Printing a list of symbols. An optional dot is printed at offset
     [i] into the list [symbols], if this offset lies between [0] and
     the length of the list (included). *)

  let rec print_symbols i symbols =
    if i = 0 then begin
      print dot;
      print space;
      print_symbols (-1) symbols
    end
    else begin
      match symbols with
      | [] ->
          ()
      | symbol :: symbols ->
          print_symbol symbol;
          print space;
          print_symbols (i - 1) symbols
    end

  (* Printing an element as a symbol. *)

  let print_element_as_symbol element =
    match element with
    | Element (s, _, _, _) ->
        print_symbol (X (incoming_symbol s))

  (* Some of the functions that follow need an element printer. They use
     [print_element] if provided by the user; otherwise they use
     [print_element_as_symbol]. *)

  let print_element =
    match print_element with
    | Some print_element ->
        print_element
    | None ->
        print_element_as_symbol

  (* Printing a stack as a list of symbols. Stack bottom on the left,
     stack top on the right. *)

  let rec print_stack env =
    match top env, pop env with
    | Some element, Some env ->
        print_stack env;
        print space;
        print_element element
    | _, _ ->
        ()

  let print_stack env =
    print_stack env;
    print newline

  (* Printing an item. *)

  let print_item (prod, i) =
    print_symbol (lhs prod);
    print arrow;
    print_symbols i (rhs prod);
    print newline

  (* Printing a list of symbols (public version). *)

  let print_symbols symbols =
    print_symbols (-1) symbols

  (* Printing a production (without a dot). *)

  let print_production prod =
    print_item (prod, -1)

  (* Printing the current LR(1) state. *)

  let print_current_state env =
    print "Current LR(1) state: ";
    match top env with
    | None ->
        print "<some initial state>"; (* TEMPORARY unsatisfactory *)
        print newline
    | Some (Element (current, _, _, _)) ->
        print (string_of_int (number current));
        print newline;
        List.iter print_item (items current)

  let print_env env =
    print_stack env;
    print_current_state env;
    print newline

end
end
module InfiniteArray = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(** This module implements infinite arrays, that is, arrays that grow
    transparently upon demand. *)

type 'a t = {
    default: 'a;
    mutable table: 'a array;
    mutable extent: int; (* the index of the greatest [set] ever, plus one *)
  }

let default_size =
  16384 (* must be non-zero *)

let make x = {
  default = x;
  table = Array.make default_size x;
  extent = 0;
}

let rec new_length length i =
  if i < length then
    length
  else
    new_length (2 * length) i

let ensure a i =
  assert (0 <= i);
  let table = a.table in
  let length = Array.length table in
  if i >= length then begin
    let table' = Array.make (new_length (2 * length) i) a.default in
    Array.blit table 0 table' 0 length;
    a.table <- table'
  end

let get a i =
  ensure a i;
  Array.unsafe_get a.table (i)

let set a i x =
  ensure a i;
  Array.unsafe_set a.table (i) x;
  if a.extent <= i then
    a.extent <- i + 1

let extent a =
  a.extent

let domain a =
  Array.sub a.table 0 a.extent

end
module PackedIntArray = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* A packed integer array is represented as a pair of an integer [k] and
   a string [s]. The integer [k] is the number of bits per integer that we
   use. The string [s] is just an array of bits, which is read in 8-bit
   chunks. *)

(* The ocaml programming language treats string literals and array literals
   in slightly different ways: the former are statically allocated, while
   the latter are dynamically allocated. (This is rather arbitrary.) In the
   context of Menhir's table-based back-end, where compact, immutable
   integer arrays are needed, ocaml strings are preferable to ocaml arrays. *)

type t =
  int * string

(* The magnitude [k] of an integer [v] is the number of bits required
   to represent [v]. It is rounded up to the nearest power of two, so
   that [k] divides [Sys.word_size]. *)

let magnitude (v : int) =
  if v < 0 then
    Sys.word_size
  else
    let rec check k max = (* [max] equals [2^k] *)
      if (max <= 0) || (v < max) then
        k
          (* if [max] just overflew, then [v] requires a full ocaml
             integer, and [k] is the number of bits in an ocaml integer
             plus one, that is, [Sys.word_size]. *)
      else
        check (2 * k) (max * max)
    in
    check 1 2

(* [pack a] turns an array of integers into a packed integer array. *)

(* Because the sign bit is the most significant bit, the magnitude of
   any negative number is the word size. In other words, [pack] does
   not achieve any space savings as soon as [a] contains any negative
   numbers, even if they are ``small''. *)

let pack (a : int array) : t =

  let m = Array.length a in

  (* Compute the maximum magnitude of the array elements. This tells
     us how many bits per element we are going to use. *)

  let k =
    Array.fold_left (fun k v ->
      max k (magnitude v)
    ) 1 a
  in

  (* Because access to ocaml strings is performed on an 8-bit basis,
     two cases arise. If [k] is less than 8, then we can pack multiple
     array entries into a single character. If [k] is greater than 8,
     then we must use multiple characters to represent a single array
     entry. *)

  if k <= 8 then begin

    (* [w] is the number of array entries that we pack in a character. *)

    assert (8 mod k = 0);
    let w = 8 / k in

    (* [n] is the length of the string that we allocate. *)

    let n =
      if m mod w = 0 then
        m / w
      else
        m / w + 1
    in

    let s =
      Bytes.create n
    in

    (* Define a reader for the source array. The reader might run off
       the end if [w] does not divide [m]. *)

    let i = ref 0 in
    let next () =
      let ii = !i in
      if ii = m then
        0 (* ran off the end, pad with zeroes *)
      else
        let v = a.(ii) in
        i := ii + 1;
        v
    in

    (* Fill up the string. *)

    for j = 0 to n - 1 do
      let c = ref 0 in
      for _x = 1 to w do
        c := (!c lsl k) lor next()
      done;
      Bytes.set s j (Char.chr !c)
    done;

    (* Done. *)

    k, Bytes.unsafe_to_string s

  end
  else begin (* k > 8 *)

    (* [w] is the number of characters that we use to encode an array entry. *)

    assert (k mod 8 = 0);
    let w = k / 8 in

    (* [n] is the length of the string that we allocate. *)

    let n =
      m * w
    in

    let s =
      Bytes.create n
    in

    (* Fill up the string. *)

    for i = 0 to m - 1 do
      let v = ref a.(i) in
      for x = 1 to w do
        Bytes.set s ((i + 1) * w - x) (Char.chr (!v land 255));
        v := !v lsr 8
      done
    done;

    (* Done. *)

    k, Bytes.unsafe_to_string s

  end

(* Access to a string. *)

let read (s : string) (i : int) : int =
  Char.code (String.unsafe_get s i)

(* [get1 t i] returns the integer stored in the packed array [t] at index [i].
   It assumes (and does not check) that the array's bit width is [1]. The
   parameter [t] is just a string. *)

let get1 (s : string) (i : int) : int =
  let c = read s (i lsr 3) in
  let c = c lsr ((lnot i) land 0b111) in
  let c = c land 0b1 in
  c

(* [get t i] returns the integer stored in the packed array [t] at index [i]. *)

(* Together, [pack] and [get] satisfy the following property: if the index [i]
   is within bounds, then [get (pack a) i] equals [a.(i)]. *)

let get ((k, s) : t) (i : int) : int =
  match k with
  | 1 ->
      get1 s i
  | 2 ->
      let c = read s (i lsr 2) in
      let c = c lsr (2 * ((lnot i) land 0b11)) in
      let c = c land 0b11 in
      c
  | 4 ->
      let c = read s (i lsr 1) in
      let c = c lsr (4 * ((lnot i) land 0b1)) in
      let c = c land 0b1111 in
      c
  | 8 ->
      read s i
  | 16 ->
      let j = 2 * i in
      (read s j) lsl 8 + read s (j + 1)
  | _ ->
      assert (k = 32); (* 64 bits unlikely, not supported *)
      let j = 4 * i in
      (((read s j lsl 8) + read s (j + 1)) lsl 8 + read s (j + 2)) lsl 8 + read s (j + 3)

(* [unflatten1 (n, data) i j] accesses the two-dimensional bitmap
   represented by [(n, data)] at indices [i] and [j]. The integer
   [n] is the width of the bitmap; the string [data] is the second
   component of the packed array obtained by encoding the table as
   a one-dimensional array. *)

let unflatten1 (n, data) i j =
   get1 data (n * i + j)

end
module RowDisplacement = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This module compresses a two-dimensional table, where some values
   are considered insignificant, via row displacement. *)

(* This idea reportedly appears in Aho and Ullman's ``Principles
   of Compiler Design'' (1977). It is evaluated in Tarjan and Yao's
   ``Storing a Sparse Table'' (1979) and in Dencker, Dürre, and Heuft's
   ``Optimization of Parser Tables for Portable Compilers'' (1984). *)

(* A compressed table is represented as a pair of arrays. The
   displacement array is an array of offsets into the data array. *)

type 'a table =
    int array * (* displacement *)
     'a array   (* data *)

(* In a natural version of this algorithm, displacements would be greater
   than (or equal to) [-n]. However, in the particular setting of Menhir,
   both arrays are intended to be compressed with [PackedIntArray], which
   does not efficiently support negative numbers. For this reason, we are
   careful not to produce negative displacements. *)

(* In order to avoid producing negative displacements, we simply use the
   least significant bit as the sign bit. This is implemented by [encode]
   and [decode] below. *)

(* One could also think, say, of adding [n] to every displacement, so as
   to ensure that all displacements are nonnegative. This would work, but
   would require [n] to be published, for use by the decoder. *)

let encode (displacement : int) : int =
  if displacement >= 0 then
    displacement lsl 1
  else
    (-displacement) lsl 1 + 1

let decode (displacement : int) : int =
  if displacement land 1 = 0 then
    displacement lsr 1
  else
    -(displacement lsr 1)

(* It is reasonable to assume that, as matrices grow large, their
   density becomes low, i.e., they have many insignificant entries.
   As a result, it is important to work with a sparse data structure
   for rows. We internally represent a row as a list of its
   significant entries, where each entry is a pair of a [j] index and
   an element. *)

type 'a row =
    (int * 'a) list

(* [compress equal insignificant dummy m n t] turns the two-dimensional table
   [t] into a compressed table. The parameter [equal] is equality of data
   values. The parameter [wildcard] tells which data values are insignificant,
   and can thus be overwritten with other values. The parameter [dummy] is
   used to fill holes in the data array. [m] and [n] are the integer
   dimensions of the table [t]. *)

let compress
    (equal : 'a -> 'a -> bool)
    (insignificant : 'a -> bool)
    (dummy : 'a)
    (m : int) (n : int)
    (t : 'a array array)
    : 'a table =

  (* Be defensive. *)

  assert (Array.length t = m);
  assert begin
    for i = 0 to m - 1 do
      assert (Array.length t.(i) = n)
    done;
    true
  end;

  (* This turns a row-as-array into a row-as-sparse-list. The row is
     accompanied by its index [i] and by its rank (the number of its
     significant entries, that is, the length of the row-as-a-list. *)

  let sparse (i : int) (line : 'a array) : int * int * 'a row (* index, rank, row *) =

    let rec loop (j : int) (rank : int) (row : 'a row) =
      if j < 0 then
        i, rank, row
      else
        let x = line.(j) in
        if insignificant x then
          loop (j - 1) rank row
        else
          loop (j - 1) (1 + rank) ((j, x) :: row)
    in

    loop (n - 1) 0 []

  in

  (* Construct an array of all rows, together with their index and rank. *)

  let rows : (int * int * 'a row) array = (* index, rank, row *)
    Array.mapi sparse t
  in

  (* Sort this array by decreasing rank. This does not have any impact
     on correctness, but reportedly improves compression. The
     intuitive idea is that rows with few significant elements are
     easy to fit, so they should be inserted last, after the problem
     has become quite constrained by fitting the heavier rows. This
     heuristic is attributed to Ziegler. *)

  Array.fast_sort (fun (_, rank1, _) (_, rank2, _) ->
    compare rank2 rank1
  ) rows;

  (* Allocate a one-dimensional array of displacements. *)

  let displacement : int array =
    Array.make m 0
  in

  (* Allocate a one-dimensional, infinite array of values. Indices
     into this array are written [k]. *)

  let data : 'a InfiniteArray.t =
    InfiniteArray.make dummy
  in

  (* Determine whether [row] fits at offset [k] within the current [data]
     array, up to extension of this array. *)

  (* Note that this check always succeeds when [k] equals the length of
     the [data] array. Indeed, the loop is then skipped. This property
     guarantees the termination of the recursive function [fit] below. *)

  let fits k (row : 'a row) : bool =

    let d = InfiniteArray.extent data in

    let rec loop = function
      | [] ->
          true
      | (j, x) :: row ->

          (* [x] is a significant element. *)

          (* By hypothesis, [k + j] is nonnegative. If it is greater than or
             equal to the current length of the data array, stop -- the row
             fits. *)

          assert (k + j >= 0);

          if k + j >= d then
            true

          (* We now know that [k + j] is within bounds of the data
             array. Check whether it is compatible with the element [y] found
             there. If it is, continue. If it isn't, stop -- the row does not
             fit. *)

          else
            let y = InfiniteArray.get data (k + j) in
            if insignificant y || equal x y then
              loop row
            else
              false

    in
    loop row

  in

  (* Find the leftmost position where a row fits. *)

  (* If the leftmost significant element in this row is at offset [j],
     then we can hope to fit as far left as [-j] -- so this element
     lands at offset [0] in the data array. *)

  (* Note that displacements may be negative. This means that, for
     insignificant elements, accesses to the data array could fail: they could
     be out of bounds, either towards the left or towards the right. This is
     not a problem, as long as [get] is invoked only at significant
     elements. *)

  let rec fit k row : int =
    if fits k row then
      k
    else
      fit (k + 1) row
  in

  let fit row =
    match row with
    | [] ->
        0 (* irrelevant *)
    | (j, _) :: _ ->
        fit (-j) row
  in

  (* Write [row] at (compatible) offset [k]. *)

  let rec write k = function
    | [] ->
        ()
    | (j, x) :: row ->
        InfiniteArray.set data (k + j) x;
        write k row
  in

  (* Iterate over the sorted array of rows. Fit and write each row at
     the leftmost compatible offset. Update the displacement table. *)

  Array.iter (fun (i, _, row) ->
    let k = fit row in (* if [row] has leading insignificant elements, then [k] can be negative *)
    write k row;
    displacement.(i) <- encode k
  ) rows;

  (* Return the compressed tables. *)

  displacement, InfiniteArray.domain data

(* [get ct i j] returns the value found at indices [i] and [j] in the
   compressed table [ct]. This function call is permitted only if the
   value found at indices [i] and [j] in the original table is
   significant -- otherwise, it could fail abruptly. *)

(* Together, [compress] and [get] have the property that, if the value
   found at indices [i] and [j] in an uncompressed table [t] is
   significant, then [get (compress t) i j] is equal to that value. *)

let get (displacement, data) i j =
  assert (0 <= i && i < Array.length displacement);
  let k = decode displacement.(i) in
  assert (0 <= k + j && k + j < Array.length data);
    (* failure of this assertion indicates an attempt to access an
       insignificant element that happens to be mapped out of the bounds
       of the [data] array. *)
  data.(k + j)

(* [getget] is a variant of [get] which only requires read access,
   via accessors, to the two components of the table. *)

let getget get_displacement get_data (displacement, data) i j =
  let k = decode (get_displacement displacement i) in
  get_data data (k + j)
end
module LinearizedArray = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* The [entry] array contains offsets into the [data] array. It has [n+1]
   elements if the original (unencoded) array has [n] elements. The value
   of [entry.(n)] is the length of the [data] array. This convention is
   natural and allows avoiding a special case. *)

type 'a t =
  (* data: *)   'a array *
  (* entry: *) int array

let make (a : 'a array array) : 'a t =
  let n = Array.length a in
  (* Build the entry array. *)
  let size = ref 0 in
  let entry = Array.init (n + 1) (fun i ->
    let s = !size in
    if i < n then
      size := s + Array.length a.(i);
    s
  ) in
  assert (entry.(n) = !size);
  (* Build the data array. *)
  let i = ref 0
  and j = ref 0 in
  let data = Array.init !size (fun _ ->
    while !j = Array.length a.(!i) do
      i := !i + 1;
      j := 0;
    done;
    let x = a.(!i).(!j) in
    j := !j + 1;
    x
  ) in
  data, entry

let length ((_, entry) : 'a t) : int =
  Array.length entry

let row_length ((_, entry) : 'a t) i : int =
  entry.(i + 1) - entry.(i)

let row_length_via get_entry i =
  get_entry (i + 1) - get_entry i

let read ((data, entry) as la : 'a t) i j : 'a =
  assert (0 <= j && j < row_length la i);
  data.(entry.(i) + j)

let read_via get_data get_entry i j =
  assert (0 <= j && j < row_length_via get_entry i);
  get_data (get_entry i + j)

let write ((data, entry) as la : 'a t) i j (v : 'a) : unit =
  assert (0 <= j && j < row_length la i);
  data.(entry.(i) + j) <- v

let rec read_interval_via get_data i j =
  if i = j then
    []
  else
    get_data i :: read_interval_via get_data (i + 1) j

let read_row_via get_data get_entry i =
  read_interval_via get_data (get_entry i) (get_entry (i + 1))

let read_row ((data, entry) : 'a t) i : 'a list =
  read_row_via (Array.get data) (Array.get entry) i

end
module TableFormat = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This signature defines the format of the parse tables. It is used as
   an argument to [TableInterpreter.Make]. *)

module type TABLES = sig

  (* This is the parser's type of tokens. *)

  type token

  (* This maps a token to its internal (generation-time) integer code. *)

  val token2terminal: token -> int

  (* This is the integer code for the error pseudo-token. *)

  val error_terminal: int

  (* This maps a token to its semantic value. *)

  val token2value: token -> Obj.t

  (* Traditionally, an LR automaton is described by two tables, namely, an
     action table and a goto table. See, for instance, the Dragon book.

     The action table is a two-dimensional matrix that maps a state and a
     lookahead token to an action. An action is one of: shift to a certain
     state, reduce a certain production, accept, or fail.

     The goto table is a two-dimensional matrix that maps a state and a
     non-terminal symbol to either a state or undefined. By construction, this
     table is sparse: its undefined entries are never looked up. A compression
     technique is free to overlap them with other entries.

     In Menhir, things are slightly different. If a state has a default
     reduction on token [#], then that reduction must be performed without
     consulting the lookahead token. As a result, we must first determine
     whether that is the case, before we can obtain a lookahead token and use it
     as an index in the action table.

     Thus, Menhir's tables are as follows.

     A one-dimensional default reduction table maps a state to either ``no
     default reduction'' (encoded as: 0) or ``by default, reduce prod''
     (encoded as: 1 + prod). The action table is looked up only when there
     is no default reduction. *)

  val default_reduction: PackedIntArray.t

  (* Menhir follows Dencker, Dürre and Heuft, who point out that, although the
     action table is not sparse by nature (i.e., the error entries are
     significant), it can be made sparse by first factoring out a binary error
     matrix, then replacing the error entries in the action table with undefined
     entries. Thus:

     A two-dimensional error bitmap maps a state and a terminal to either
     ``fail'' (encoded as: 0) or ``do not fail'' (encoded as: 1). The action
     table, which is now sparse, is looked up only in the latter case. *)

  (* The error bitmap is flattened into a one-dimensional table; its width is
     recorded so as to allow indexing. The table is then compressed via
     [PackedIntArray]. The bit width of the resulting packed array must be
     [1], so it is not explicitly recorded. *)

  (* The error bitmap does not contain a column for the [#] pseudo-terminal.
     Thus, its width is [Terminal.n - 1]. We exploit the fact that the integer
     code assigned to [#] is greatest: the fact that the right-most column
     in the bitmap is missing does not affect the code for accessing it. *)

  val error: int (* width of the bitmap *) * string (* second component of [PackedIntArray.t] *)

  (* A two-dimensional action table maps a state and a terminal to one of
     ``shift to state s and discard the current token'' (encoded as: s | 10),
     ``shift to state s without discarding the current token'' (encoded as: s |
     11), or ``reduce prod'' (encoded as: prod | 01). *)

  (* The action table is first compressed via [RowDisplacement], then packed
     via [PackedIntArray]. *)

  (* Like the error bitmap, the action table does not contain a column for the
     [#] pseudo-terminal. *)

  val action: PackedIntArray.t * PackedIntArray.t

  (* A one-dimensional lhs table maps a production to its left-hand side (a
     non-terminal symbol). *)

  val lhs: PackedIntArray.t

  (* A two-dimensional goto table maps a state and a non-terminal symbol to
     either undefined (encoded as: 0) or a new state s (encoded as: 1 + s). *)

  (* The goto table is first compressed via [RowDisplacement], then packed
     via [PackedIntArray]. *)

  val goto: PackedIntArray.t * PackedIntArray.t

  (* The number of start productions. A production [prod] is a start
     production if and only if [prod < start] holds. This is also the
     number of start symbols. A nonterminal symbol [nt] is a start
     symbol if and only if [nt < start] holds. *)

  val start: int

  (* A one-dimensional semantic action table maps productions to semantic
     actions. The calling convention for semantic actions is described in
     [EngineTypes]. This table contains ONLY NON-START PRODUCTIONS, so the
     indexing is off by [start]. Be careful. *)

  val semantic_action: ((int, Obj.t, token) EngineTypes.env ->
                        (int, Obj.t)        EngineTypes.stack) array

  (* The parser defines its own [Error] exception. This exception can be
     raised by semantic actions and caught by the engine, and raised by the
     engine towards the final user. *)

  exception Error

  (* The parser indicates whether to generate a trace. Generating a
     trace requires two extra tables, which respectively map a
     terminal symbol and a production to a string. *)

  val trace: (string array * string array) option

end
end
module InspectionTableFormat = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* This signature defines the format of the tables that are produced (in
   addition to the tables described in [TableFormat]) when the command line
   switch [--inspection] is enabled. It is used as an argument to
   [InspectionTableInterpreter.Make]. *)

module type TABLES = sig

  (* The types of symbols. *)

  include IncrementalEngine.SYMBOLS

  (* The type ['a lr1state] describes an LR(1) state. The generated parser defines
     it internally as [int]. *)

  type 'a lr1state

  (* Some of the tables that follow use encodings of (terminal and
     nonterminal) symbols as integers. So, we need functions that
     map the integer encoding of a symbol to its algebraic encoding. *)

  val    terminal: int -> xsymbol
  val nonterminal: int -> xsymbol

  (* The left-hand side of every production already appears in the
     signature [TableFormat.TABLES], so we need not repeat it here. *)

  (* The right-hand side of every production. This a linearized array
     of arrays of integers, whose [data] and [entry] components have
     been packed. The encoding of symbols as integers in described in
     [TableBackend]. *)

  val rhs: PackedIntArray.t * PackedIntArray.t

  (* A mapping of every (non-initial) state to its LR(0) core. *)

  val lr0_core: PackedIntArray.t

  (* A mapping of every LR(0) state to its set of LR(0) items. Each item is
     represented in its packed form (see [Item]) as an integer. Thus the
     mapping is an array of arrays of integers, which is linearized and
     packed, like [rhs]. *)

  val lr0_items: PackedIntArray.t * PackedIntArray.t

  (* A mapping of every LR(0) state to its incoming symbol, if it has one. *)

  val lr0_incoming: PackedIntArray.t

  (* A table that tells which non-terminal symbols are nullable. *)

  val nullable: string
    (* This is a packed int array of bit width 1. It can be read
       using [PackedIntArray.get1]. *)

  (* A two-table dimensional table, indexed by a nonterminal symbol and
     by a terminal symbol (other than [#]), encodes the FIRST sets. *)

  val first: int (* width of the bitmap *) * string (* second component of [PackedIntArray.t] *)

end

end
module InspectionTableInterpreter = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

(* -------------------------------------------------------------------------- *)

(* The type functor. *)

module Symbols (T : sig

  type 'a terminal
  type 'a nonterminal

end) = struct

  open T

  (* This should be the only place in the whole library (and generator!)
     where these types are defined. *)

  type 'a symbol =
    | T : 'a terminal -> 'a symbol
    | N : 'a nonterminal -> 'a symbol

  type xsymbol =
    | X : 'a symbol -> xsymbol

end

(* -------------------------------------------------------------------------- *)

(* The code functor. *)

module Make
  (TT : TableFormat.TABLES)
  (IT : InspectionTableFormat.TABLES
        with type 'a lr1state = int)
  (ET : EngineTypes.TABLE
        with type terminal = int
         and type nonterminal = int
         and type semantic_value = Obj.t)
  (E : sig
     type 'a env = (ET.state, ET.semantic_value, ET.token) EngineTypes.env
   end)
= struct

  (* Including [IT] is an easy way of inheriting the definitions of the types
     [symbol] and [xsymbol]. *)

  include IT

  (* This auxiliary function decodes a packed linearized array, as created by
     [TableBackend.linearize_and_marshal1]. Here, we read a row all at once. *)

  let read_packed_linearized
    (data, entry : PackedIntArray.t * PackedIntArray.t) (i : int) : int list
  =
    LinearizedArray.read_row_via
      (PackedIntArray.get data)
      (PackedIntArray.get entry)
      i

  (* This auxiliary function decodes a symbol. The encoding was done by
     [encode_symbol] or [encode_symbol_option] in the table back-end. *)

  let decode_symbol (symbol : int) : IT.xsymbol =
    (* If [symbol] is 0, then we have no symbol. This could mean e.g.
       that the function [incoming_symbol] has been applied to an
       initial state. In principle, this cannot happen. *)
    assert (symbol > 0);
    (* The low-order bit distinguishes terminal and nonterminal symbols. *)
    let kind = symbol land 1 in
    let symbol = symbol lsr 1 in
    if kind = 0 then
      IT.terminal (symbol - 1)
    else
      IT.nonterminal symbol

  (* These auxiliary functions convert a symbol to its integer code. For speed
     and for convenience, we use an unsafe type cast. This relies on the fact
     that the data constructors of the [terminal] and [nonterminal] GADTs are
     declared in an order that reflects their internal code. In the case of
     nonterminal symbols, we add [start] to account for the presence of the
     start symbols. *)

  let n2i (nt : 'a IT.nonterminal) : int =
    let answer = TT.start + Obj.magic nt in
    (* For safety, check that the above cast produced a correct result. *)
    assert (IT.nonterminal answer = X (N nt));
    answer

  let t2i (t : 'a IT.terminal) : int =
    let answer = Obj.magic t in
    (* For safety, check that the above cast produced a correct result. *)
    assert (IT.terminal answer = X (T t));
    answer

  (* Ordering functions. *)

  let compare_terminals t1 t2 =
    (* Subtraction is safe because overflow is impossible. *)
    t2i t1 - t2i t2

  let compare_nonterminals nt1 nt2 =
    (* Subtraction is safe because overflow is impossible. *)
    n2i nt1 - n2i nt2

  let compare_symbols symbol1 symbol2 =
    match symbol1, symbol2 with
    | X (T _), X (N _) ->
        -1
    | X (N _), X (T _) ->
        1
    | X (T t1), X (T t2) ->
        compare_terminals t1 t2
    | X (N nt1), X (N nt2) ->
        compare_nonterminals nt1 nt2

  let compare_productions prod1 prod2 =
    (* Subtraction is safe because overflow is impossible. *)
    prod1 - prod2

  let compare_items (prod1, index1) (prod2, index2) =
    let c = compare_productions prod1 prod2 in
    (* Subtraction is safe because overflow is impossible. *)
    if c <> 0 then c else index1 - index2

  (* The function [incoming_symbol] goes through the tables [IT.lr0_core] and
     [IT.lr0_incoming]. This yields a representation of type [xsymbol], out of
     which we strip the [X] quantifier, so as to get a naked symbol. This last
     step is ill-typed and potentially dangerous. It is safe only because this
     function is used at type ['a lr1state -> 'a symbol], which forces an
     appropriate choice of ['a]. *)

  let incoming_symbol (s : 'a IT.lr1state) : 'a IT.symbol =
    let core = PackedIntArray.get IT.lr0_core s in
    let symbol = decode_symbol (PackedIntArray.get IT.lr0_incoming core) in
    match symbol with
    | IT.X symbol ->
        Obj.magic symbol

  (* The function [lhs] reads the table [TT.lhs] and uses [IT.nonterminal]
     to decode the symbol. *)

  let lhs prod =
    IT.nonterminal (PackedIntArray.get TT.lhs prod)

  (* The function [rhs] reads the table [IT.rhs] and uses [decode_symbol]
     to decode the symbol. *)

  let rhs prod =
    List.map decode_symbol (read_packed_linearized IT.rhs prod)

  (* The function [items] maps the LR(1) state [s] to its LR(0) core,
     then uses [core] as an index into the table [IT.lr0_items]. The
     items are then decoded by the function [export] below, which is
     essentially a copy of [Item.export]. *)

  type item =
      int * int

  let export t : item =
    (t lsr 7, t mod 128)

  let items s =
    (* Map [s] to its LR(0) core. *)
    let core = PackedIntArray.get IT.lr0_core s in
    (* Now use [core] to look up the table [IT.lr0_items]. *)
    List.map export (read_packed_linearized IT.lr0_items core)

  (* The function [nullable] maps the nonterminal symbol [nt] to its
     integer code, which it uses to look up the array [IT.nullable].
     This yields 0 or 1, which we map back to a Boolean result. *)

  let decode_bool i =
    assert (i = 0 || i = 1);
    i = 1

  let nullable nt =
    decode_bool (PackedIntArray.get1 IT.nullable (n2i nt))

  (* The function [first] maps the symbols [nt] and [t] to their integer
     codes, which it uses to look up the matrix [IT.first]. *)

  let first nt t =
    decode_bool (PackedIntArray.unflatten1 IT.first (n2i nt) (t2i t))

  let xfirst symbol t =
    match symbol with
    | X (T t') ->
        compare_terminals t t' = 0
    | X (N nt) ->
        first nt t

  (* The function [foreach_terminal] exploits the fact that the
     first component of [TT.error] is [Terminal.n - 1], i.e., the
     number of terminal symbols, including [error] but not [#]. *)

  let rec foldij i j f accu =
    if i = j then
      accu
    else
      foldij (i + 1) j f (f i accu)

  let foreach_terminal f accu =
    let n, _ = TT.error in
    foldij 0 n (fun i accu ->
      f (IT.terminal i) accu
    ) accu

  let foreach_terminal_but_error f accu =
    let n, _ = TT.error in
    foldij 0 n (fun i accu ->
      if i = TT.error_terminal then
        accu
      else
        f (IT.terminal i) accu
    ) accu

  (* ------------------------------------------------------------------------ *)

  (* The following is the implementation of the function [feed]. This function
     is logically part of the LR engine, so it would be nice if it were placed
     in the module [Engine], but it must be placed here because, to ensure
     type safety, its arguments must be a symbol of type ['a symbol] and a
     semantic value of type ['a]. The type ['a symbol] is not available in
     [Engine]. It is available here. *)

  open EngineTypes
  open ET
  open E

  (* [feed] fails if the current state does not have an outgoing transition
     labeled with the desired symbol. This check is carried out at runtime. *)

  let feed_failure () =
    invalid_arg "feed: outgoing transition does not exist"

  (* Feeding a nonterminal symbol [nt]. Here, [nt] has type [nonterminal],
     which is a synonym for [int], and [semv] has type [semantic_value],
     which is a synonym for [Obj.t]. This type is unsafe, because pushing
     a semantic value of arbitrary type into the stack can later cause a
     semantic action to crash and burn. The function [feed] is given a safe
     type below. *)

  let feed_nonterminal
        (nt : nonterminal) startp (semv : semantic_value) endp (env : 'b env)
      : 'b env
  =
    (* Check if the source state has an outgoing transition labeled [nt].
       This is done by consulting the [goto] table. *)
    let source = env.current in
    match ET.maybe_goto_nt source nt with
    | None ->
        feed_failure()
    | Some target ->
        (* Push a new cell onto the stack, containing the identity of the state
           that we are leaving. The semantic value [semv] and positions [startp]
           and [endp] contained in the new cell are provided by the caller. *)
        let stack = { state = source; semv; startp; endp; next = env.stack } in
        (* Move to the target state. *)
        { env with stack; current = target }

  let reduce   _env _prod = feed_failure()
  let initiate _env       = feed_failure()

  let feed_terminal
        (terminal : terminal) startp (semv : semantic_value) endp (env : 'b env)
      : 'b env
  =
    (* Check if the source state has an outgoing transition labeled [terminal].
       This is done by consulting the [action] table. *)
    let source = env.current in
    ET.action source terminal semv
      (fun env _please_discard _terminal semv target ->
        (* There is indeed a transition toward the state [target].
           Push a new cell onto the stack and move to the target state. *)
        let stack = { state = source; semv; startp; endp; next = env.stack } in
        { env with stack; current = target }
      ) reduce initiate env

  (* The type assigned to [feed] ensures that the type of the semantic value
     [semv] is appropriate: it must be the semantic-value type of the symbol
     [symbol]. *)

  let feed (symbol : 'a symbol) startp (semv : 'a) endp env =
    let semv : semantic_value = Obj.repr semv in
    match symbol with
    | N nt ->
        feed_nonterminal (n2i nt) startp semv endp env
    | T terminal ->
        feed_terminal (t2i terminal) startp semv endp env

end
end
module TableInterpreter = struct
(******************************************************************************)
(*                                                                            *)
(*                                   Menhir                                   *)
(*                                                                            *)
(*                       François Pottier, Inria Paris                        *)
(*              Yann Régis-Gianas, PPS, Université Paris Diderot              *)
(*                                                                            *)
(*  Copyright Inria. All rights reserved. This file is distributed under the  *)
(*  terms of the GNU Library General Public License version 2, with a         *)
(*  special exception on linking, as described in the file LICENSE.           *)
(*                                                                            *)
(******************************************************************************)

module MakeEngineTable (T : TableFormat.TABLES) = struct

  type state =
      int

  let number s = s

  type token =
      T.token

  type terminal =
      int

  type nonterminal =
      int

  type semantic_value =
      Obj.t

  let token2terminal =
    T.token2terminal

  let token2value =
    T.token2value

  let error_terminal =
    T.error_terminal

  let error_value =
    Obj.repr ()

  (* The function [foreach_terminal] exploits the fact that the
     first component of [T.error] is [Terminal.n - 1], i.e., the
     number of terminal symbols, including [error] but not [#]. *)

  (* There is similar code in [InspectionTableInterpreter]. The
     code there contains an additional conversion of the type
     [terminal] to the type [xsymbol]. *)

  let rec foldij i j f accu =
    if i = j then
      accu
    else
      foldij (i + 1) j f (f i accu)

  let foreach_terminal f accu =
    let n, _ = T.error in
    foldij 0 n (fun i accu ->
      f i accu
    ) accu

  type production =
      int

  (* In principle, only non-start productions are exposed to the user,
     at type [production] or at type [int]. This is checked dynamically. *)
  let non_start_production i =
    assert (T.start <= i && i - T.start < Array.length T.semantic_action)

  let production_index i =
    non_start_production i;
    i

  let find_production i =
    non_start_production i;
    i

  let default_reduction state defred nodefred env =
    let code = PackedIntArray.get T.default_reduction state in
    if code = 0 then
      nodefred env
    else
      defred env (code - 1)

  let is_start prod =
    prod < T.start

  (* This auxiliary function helps access a compressed, two-dimensional
     matrix, like the action and goto tables. *)

  let unmarshal2 table i j =
    RowDisplacement.getget
      PackedIntArray.get
      PackedIntArray.get
      table
      i j

  let action state terminal value shift reduce fail env =
    match PackedIntArray.unflatten1 T.error state terminal with
    | 1 ->
        let action = unmarshal2 T.action state terminal in
        let opcode = action land 0b11
        and param = action lsr 2 in
        if opcode >= 0b10 then
          (* 0b10 : shift/discard *)
          (* 0b11 : shift/nodiscard *)
          let please_discard = (opcode = 0b10) in
          shift env please_discard terminal value param
        else
          (* 0b01 : reduce *)
          (* 0b00 : cannot happen *)
          reduce env param
    | c ->
        assert (c = 0);
        fail env

  let goto_nt state nt =
    let code = unmarshal2 T.goto state nt in
    (* code = 1 + state *)
    code - 1

  let goto_prod state prod =
    goto_nt state (PackedIntArray.get T.lhs prod)

  let maybe_goto_nt state nt =
    let code = unmarshal2 T.goto state nt in
    (* If [code] is 0, there is no outgoing transition.
       If [code] is [1 + state], there is a transition towards [state]. *)
    assert (0 <= code);
    if code = 0 then None else Some (code - 1)

  exception Error =
        T.Error

  type semantic_action =
      (state, semantic_value, token) EngineTypes.env ->
      (state, semantic_value)        EngineTypes.stack

  let semantic_action prod =
    (* Indexing into the array [T.semantic_action] is off by [T.start],
       because the start productions do not have entries in this array. *)
    T.semantic_action.(prod - T.start)

  (* [may_reduce state prod] tests whether the state [state] is capable of
     reducing the production [prod]. This information could be determined
     in constant time if we were willing to create a bitmap for it, but
     that would take up a lot of space. Instead, we obtain this information
     by iterating over a line in the action table. This is costly, but this
     function is not normally used by the LR engine anyway; it is supposed
     to be used only by programmers who wish to develop error recovery
     strategies. *)

  (* In the future, if desired, we could memoize this function, so as
     to pay the cost in (memory) space only if and where this function
     is actually used. We could also replace [foreach_terminal] with a
     function [exists_terminal] which stops as soon as the accumulator
     is [true]. *)

  let may_reduce state prod =
    (* Test if there is a default reduction of [prod]. *)
    default_reduction state
      (fun () prod' -> prod = prod')
      (fun () ->
        (* If not, then for each terminal [t], ... *)
        foreach_terminal (fun t accu ->
          accu ||
          (* ... test if there is a reduction of [prod] on [t]. *)
          action state t ()
            (* shift:  *) (fun () _ _ () _ -> false)
            (* reduce: *) (fun () prod' -> prod = prod')
            (* fail:   *) (fun () -> false)
            ()
        ) false
      )
      ()

  (* If [T.trace] is [None], then the logging functions do nothing. *)

  let log =
    match T.trace with Some _ -> true | None -> false

  module Log = struct

    open Printf

    let state state =
      match T.trace with
      | Some _ ->
          fprintf stderr "State %d:\n%!" state
      | None ->
          ()

    let shift terminal state =
      match T.trace with
      | Some (terminals, _) ->
          fprintf stderr "Shifting (%s) to state %d\n%!" terminals.(terminal) state
      | None ->
          ()

    let reduce_or_accept prod =
      match T.trace with
      | Some (_, productions) ->
          fprintf stderr "%s\n%!" productions.(prod)
      | None ->
          ()

    let lookahead_token token startp endp =
      match T.trace with
      | Some (terminals, _) ->
          fprintf stderr "Lookahead token is now %s (%d-%d)\n%!"
            terminals.(token)
            startp.Lexing.pos_cnum
            endp.Lexing.pos_cnum
      | None ->
          ()

    let initiating_error_handling () =
      match T.trace with
      | Some _ ->
          fprintf stderr "Initiating error handling\n%!"
      | None ->
          ()

    let resuming_error_handling () =
      match T.trace with
      | Some _ ->
          fprintf stderr "Resuming error handling\n%!"
      | None ->
          ()

    let handling_error state =
      match T.trace with
      | Some _ ->
          fprintf stderr "Handling error in state %d\n%!" state
      | None ->
          ()

  end

end
end
module StaticVersion = struct
let require_20190924 = ()
end

end
module Reason_parser_def
= struct
#1 "reason_parser_def.ml"
open Migrate_parsetree.OCaml_404.Ast

type labelled_parameter =
  | Term of Asttypes.arg_label * Parsetree.expression option * Parsetree.pattern
  | Type of string

type let_bindings = {
  lbs_bindings: Parsetree.value_binding list;
  lbs_rec: Asttypes.rec_flag;
  lbs_extension: (Parsetree.attributes * string Asttypes.loc) option;
  lbs_loc: Location.t;
}

end
module Reason_string
= struct
#1 "reason_string.ml"
module String = struct
  include String
end

end
module Reason_parser : sig 
#1 "reason_parser.mli"

(* The type of tokens. *)

type token = 
  | WITH
  | WHILE
  | WHEN
  | VIRTUAL
  | VAL
  | UNDERSCORE
  | UIDENT of (string)
  | TYPE
  | TRY
  | TRUE
  | TO
  | TILDE
  | THEN
  | SWITCH
  | STRUCT
  | STRING of (string * string option * string option)
  | STAR
  | SLASHGREATER
  | SIG
  | SHARPOP of (string)
  | SHARPEQUAL
  | SHARP
  | SEMISEMI
  | SEMI
  | RPAREN
  | REC
  | RBRACKET
  | RBRACE
  | QUOTE
  | QUESTION
  | PUB
  | PRI
  | PREFIXOP of (string)
  | POSTFIXOP of (string)
  | PLUSEQ
  | PLUSDOT
  | PLUS
  | PERCENT
  | OR
  | OPEN
  | OF
  | OBJECT
  | NONREC
  | NEW
  | NATIVEINT of (nativeint)
  | MUTABLE
  | MODULE
  | MINUSGREATER
  | MINUSDOT
  | MINUS
  | LPAREN
  | LIDENT of (string)
  | LET
  | LESSSLASHIDENTGREATER of (string)
  | LESSSLASHGREATER
  | LESSIDENT of (string)
  | LESSGREATER
  | LESSDOTDOTGREATER
  | LESS
  | LBRACKETPERCENTPERCENT
  | LBRACKETPERCENT
  | LBRACKETLESS
  | LBRACKETGREATER
  | LBRACKETBAR
  | LBRACKETAT
  | LBRACKET
  | LBRACELESS
  | LBRACE
  | LAZY
  | INT of (string * char option)
  | INITIALIZER
  | INHERIT
  | INFIXOP4 of (string)
  | INFIXOP3 of (string)
  | INFIXOP2 of (string)
  | INFIXOP1 of (string)
  | INFIXOP0 of (string)
  | INCLUDE
  | IN
  | IF
  | GREATERRBRACE
  | GREATERDOTDOTDOT
  | GREATER
  | FUNCTOR
  | FUNCTION
  | FUN
  | FOR
  | FLOAT of (string * char option)
  | FALSE
  | EXTERNAL
  | EXCEPTION
  | ES6_FUN
  | EQUALGREATER
  | EQUAL
  | EOL
  | EOF
  | END
  | ELSE
  | DOWNTO
  | DOTDOTDOT
  | DOTDOT
  | DOT
  | DONE
  | DOCSTRING of (string)
  | DO
  | CONSTRAINT
  | COMMENT of (string * Location.t)
  | COMMA
  | COLONGREATER
  | COLONEQUAL
  | COLONCOLON
  | COLON
  | CLASS
  | CHAR of (char)
  | BEGIN
  | BARRBRACKET
  | BARBAR
  | BAR
  | BANG
  | BACKQUOTE
  | ASSERT
  | AS
  | AND
  | AMPERSAND
  | AMPERAMPER

(* This exception is raised by the monolithic API functions. *)

exception Error

(* The monolithic API. *)

val use_file: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list)

val toplevel_phrase: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase)

val parse_pattern: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Migrate_parsetree.Ast_404.Parsetree.pattern)

val parse_expression: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Migrate_parsetree.Ast_404.Parsetree.expression)

val parse_core_type: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Migrate_parsetree.Ast_404.Parsetree.core_type)

val interface: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Migrate_parsetree.Ast_404.Parsetree.signature)

val implementation: (Lexing.lexbuf -> token) -> Lexing.lexbuf -> (Migrate_parsetree.Ast_404.Parsetree.structure)

module MenhirInterpreter : sig
  
  (* The incremental API. *)
  
  include MenhirLib.IncrementalEngine.INCREMENTAL_ENGINE
    with type token = token
  
  (* The indexed type of terminal symbols. *)
  
  type _ terminal = 
    | T_error : unit terminal
    | T_WITH : unit terminal
    | T_WHILE : unit terminal
    | T_WHEN : unit terminal
    | T_VIRTUAL : unit terminal
    | T_VAL : unit terminal
    | T_UNDERSCORE : unit terminal
    | T_UIDENT : (string) terminal
    | T_TYPE : unit terminal
    | T_TRY : unit terminal
    | T_TRUE : unit terminal
    | T_TO : unit terminal
    | T_TILDE : unit terminal
    | T_THEN : unit terminal
    | T_SWITCH : unit terminal
    | T_STRUCT : unit terminal
    | T_STRING : (string * string option * string option) terminal
    | T_STAR : unit terminal
    | T_SLASHGREATER : unit terminal
    | T_SIG : unit terminal
    | T_SHARPOP : (string) terminal
    | T_SHARPEQUAL : unit terminal
    | T_SHARP : unit terminal
    | T_SEMISEMI : unit terminal
    | T_SEMI : unit terminal
    | T_RPAREN : unit terminal
    | T_REC : unit terminal
    | T_RBRACKET : unit terminal
    | T_RBRACE : unit terminal
    | T_QUOTE : unit terminal
    | T_QUESTION : unit terminal
    | T_PUB : unit terminal
    | T_PRI : unit terminal
    | T_PREFIXOP : (string) terminal
    | T_POSTFIXOP : (string) terminal
    | T_PLUSEQ : unit terminal
    | T_PLUSDOT : unit terminal
    | T_PLUS : unit terminal
    | T_PERCENT : unit terminal
    | T_OR : unit terminal
    | T_OPEN : unit terminal
    | T_OF : unit terminal
    | T_OBJECT : unit terminal
    | T_NONREC : unit terminal
    | T_NEW : unit terminal
    | T_NATIVEINT : (nativeint) terminal
    | T_MUTABLE : unit terminal
    | T_MODULE : unit terminal
    | T_MINUSGREATER : unit terminal
    | T_MINUSDOT : unit terminal
    | T_MINUS : unit terminal
    | T_LPAREN : unit terminal
    | T_LIDENT : (string) terminal
    | T_LET : unit terminal
    | T_LESSSLASHIDENTGREATER : (string) terminal
    | T_LESSSLASHGREATER : unit terminal
    | T_LESSIDENT : (string) terminal
    | T_LESSGREATER : unit terminal
    | T_LESSDOTDOTGREATER : unit terminal
    | T_LESS : unit terminal
    | T_LBRACKETPERCENTPERCENT : unit terminal
    | T_LBRACKETPERCENT : unit terminal
    | T_LBRACKETLESS : unit terminal
    | T_LBRACKETGREATER : unit terminal
    | T_LBRACKETBAR : unit terminal
    | T_LBRACKETAT : unit terminal
    | T_LBRACKET : unit terminal
    | T_LBRACELESS : unit terminal
    | T_LBRACE : unit terminal
    | T_LAZY : unit terminal
    | T_INT : (string * char option) terminal
    | T_INITIALIZER : unit terminal
    | T_INHERIT : unit terminal
    | T_INFIXOP4 : (string) terminal
    | T_INFIXOP3 : (string) terminal
    | T_INFIXOP2 : (string) terminal
    | T_INFIXOP1 : (string) terminal
    | T_INFIXOP0 : (string) terminal
    | T_INCLUDE : unit terminal
    | T_IN : unit terminal
    | T_IF : unit terminal
    | T_GREATERRBRACE : unit terminal
    | T_GREATERDOTDOTDOT : unit terminal
    | T_GREATER : unit terminal
    | T_FUNCTOR : unit terminal
    | T_FUNCTION : unit terminal
    | T_FUN : unit terminal
    | T_FOR : unit terminal
    | T_FLOAT : (string * char option) terminal
    | T_FALSE : unit terminal
    | T_EXTERNAL : unit terminal
    | T_EXCEPTION : unit terminal
    | T_ES6_FUN : unit terminal
    | T_EQUALGREATER : unit terminal
    | T_EQUAL : unit terminal
    | T_EOL : unit terminal
    | T_EOF : unit terminal
    | T_END : unit terminal
    | T_ELSE : unit terminal
    | T_DOWNTO : unit terminal
    | T_DOTDOTDOT : unit terminal
    | T_DOTDOT : unit terminal
    | T_DOT : unit terminal
    | T_DONE : unit terminal
    | T_DOCSTRING : (string) terminal
    | T_DO : unit terminal
    | T_CONSTRAINT : unit terminal
    | T_COMMENT : (string * Location.t) terminal
    | T_COMMA : unit terminal
    | T_COLONGREATER : unit terminal
    | T_COLONEQUAL : unit terminal
    | T_COLONCOLON : unit terminal
    | T_COLON : unit terminal
    | T_CLASS : unit terminal
    | T_CHAR : (char) terminal
    | T_BEGIN : unit terminal
    | T_BARRBRACKET : unit terminal
    | T_BARBAR : unit terminal
    | T_BAR : unit terminal
    | T_BANG : unit terminal
    | T_BACKQUOTE : unit terminal
    | T_ASSERT : unit terminal
    | T_AS : unit terminal
    | T_AND : unit terminal
    | T_AMPERSAND : unit terminal
    | T_AMPERAMPER : unit terminal
  
  (* The indexed type of nonterminal symbols. *)
  
  type _ nonterminal = 
    | N_with_constraint : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) nonterminal
    | N_virtual_flag : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) nonterminal
    | N_value_type : (string * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_value : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) nonterminal
    | N_val_longident : (Longident.t) nonterminal
    | N_val_ident : (string) nonterminal
    | N_use_file_no_mapper : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) nonterminal
    | N_use_file : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) nonterminal
    | N_unattributed_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_unattributed_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_type_variance : (Migrate_parsetree.Ast_404.Asttypes.variance) nonterminal
    | N_type_variables_with_variance_comma_list : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_type_variables_with_variance : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_type_variable_with_variance : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) nonterminal
    | N_type_variable : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_type_parameters : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
    | N_type_parameter : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) nonterminal
    | N_type_other_kind : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
    | N_type_longident : (Migrate_parsetree.Ast_404.Ast_helper.lid) nonterminal
    | N_type_declarations : (Migrate_parsetree.Ast_404.Asttypes.rec_flag *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
    | N_type_declaration_kind : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
    | N_type_declaration_details : ((Migrate_parsetree.Ast_404.Ast_helper.str *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Asttypes.variance)
   list *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
   list * Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  Lexing.position * Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
    | N_type_constraint : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
    | N_toplevel_phrase : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) nonterminal
    | N_toplevel_directive : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) nonterminal
    | N_tag_field : (Migrate_parsetree.Ast_404.Parsetree.row_field) nonterminal
    | N_subtractive : (string) nonterminal
    | N_structure_item : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) nonterminal
    | N_structure : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) nonterminal
    | N_string_literal_labels : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
    | N_string_literal_label : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_string_literal_exprs_maybe_punned : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
    | N_string_literal_expr_maybe_punned_with_comma : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_string_literal_expr_maybe_punned : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_str_type_extension : (Migrate_parsetree.Ast_404.Parsetree.type_extension) nonterminal
    | N_str_exception_declaration : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
    | N_single_attr_id : (string) nonterminal
    | N_simple_pattern_not_ident_ : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_simple_pattern_not_ident : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_simple_pattern_ident : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_simple_pattern_direct_argument : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_simple_pattern : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_simple_module_type : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
    | N_simple_expr_template_constructor : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_simple_expr_no_constructor : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_simple_expr_no_call : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_simple_expr_direct_argument : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_simple_expr_call : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
    | N_signed_constant : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) nonterminal
    | N_signature_items : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) nonterminal
    | N_signature_item : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) nonterminal
    | N_signature : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) nonterminal
    | N_sig_type_extension : (Migrate_parsetree.Ast_404.Parsetree.type_extension) nonterminal
    | N_sig_exception_declaration : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
    | N_seq_expr_no_seq : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_seq_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_separated_nonempty_list_AMPERSAND_non_arrowed_simple_core_types_ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
    | N_row_field_list : (Migrate_parsetree.Ast_404.Parsetree.row_field list) nonterminal
    | N_row_field : (Migrate_parsetree.Ast_404.Parsetree.row_field) nonterminal
    | N_record_label_declaration : (Migrate_parsetree.Ast_404.Parsetree.label_declaration) nonterminal
    | N_record_expr_with_string_keys : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
    | N_record_expr : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
    | N_record_declaration : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) nonterminal
    | N_rec_flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) nonterminal
    | N_protected_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_primitive_declaration : (string list) nonterminal
    | N_poly_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_payload : (Migrate_parsetree.Ast_404.Parsetree.payload) nonterminal
    | N_pattern_without_or : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_pattern_optional_constraint : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_pattern_constructor_argument : (Migrate_parsetree.Ast_404.Parsetree.pattern list) nonterminal
    | N_pattern_comma_list_extension : (Migrate_parsetree.Ast_404.Parsetree.pattern list *
  Migrate_parsetree.Ast_404.Parsetree.pattern option) nonterminal
    | N_pattern : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_parse_pattern : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_parse_expression : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_parse_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_parenthesized_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_package_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_override_flag : (Migrate_parsetree.Ast_404.Asttypes.override_flag) nonterminal
    | N_optional_expr_extension : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_optional : (string -> Migrate_parsetree.Ast_404.Asttypes.arg_label) nonterminal
    | N_option_type_constraint_ : ((Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) nonterminal
    | N_option_preceded_WHEN_expr__ : (Migrate_parsetree.Ast_404.Parsetree.expression option) nonterminal
    | N_option_preceded_COLONGREATER_core_type__ : (Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
    | N_option_preceded_COLON_simple_module_type__ : (Migrate_parsetree.Ast_404.Parsetree.module_type option) nonterminal
    | N_option_preceded_COLON_poly_type__ : (Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
    | N_option_preceded_COLON_non_arrowed_core_type__ : (Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
    | N_option_preceded_COLON_expr__ : (Migrate_parsetree.Ast_404.Parsetree.expression option) nonterminal
    | N_option_preceded_COLON_core_type__ : (Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
    | N_option_preceded_COLON_class_constructor_type__ : (Migrate_parsetree.Ast_404.Parsetree.class_type option) nonterminal
    | N_option_preceded_AS_LIDENT__ : (string option) nonterminal
    | N_option_item_extension_sugar_ : ((Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) option) nonterminal
    | N_option_constructor_arguments_ : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments option) nonterminal
    | N_option_SEMI_ : (unit option) nonterminal
    | N_option_OF_ : (unit option) nonterminal
    | N_option_MODULE_ : (unit option) nonterminal
    | N_option_LET_ : (unit option) nonterminal
    | N_option_DOTDOTDOT_ : (unit option) nonterminal
    | N_option_DOT_ : (unit option) nonterminal
    | N_option_COMMA_ : (unit option) nonterminal
    | N_opt_LET_MODULE_ident : (Migrate_parsetree.Ast_404.Ast_helper.str) nonterminal
    | N_opt_LET_MODULE_REC_ident : (Migrate_parsetree.Ast_404.Ast_helper.str) nonterminal
    | N_opt_LET_MODULE : (unit) nonterminal
    | N_operator : (string) nonterminal
    | N_open_statement : (Migrate_parsetree.Ast_404.Parsetree.open_description) nonterminal
    | N_object_record_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_object_label_declarations : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
    | N_object_label_declaration : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_object_body_class_fields : (Migrate_parsetree.Ast_404.Parsetree.class_field list) nonterminal
    | N_object_body : (Migrate_parsetree.Ast_404.Parsetree.class_structure) nonterminal
    | N_nonrec_flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) nonterminal
    | N_nonempty_list_preceded_QUOTE_ident__ : (string list) nonterminal
    | N_nonempty_list_preceded_CONSTRAINT_constrain__ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list) nonterminal
    | N_nonempty_list_name_tag_ : (string list) nonterminal
    | N_nonempty_list_attributed_ext_constructor_extension_constructor_declaration__ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
    | N_nonempty_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
    | N_nonempty_list_as_loc_attribute__ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) nonterminal
    | N_nonempty_list___anonymous_32_ : (string list) nonterminal
    | N_nonempty_list_LIDENT_ : (string list) nonterminal
    | N_non_labeled_argument_list : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
    | N_non_arrowed_simple_core_types : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_non_arrowed_simple_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_non_arrowed_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_mutable_or_virtual_flags : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag) nonterminal
    | N_mutable_flag : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) nonterminal
    | N_mty_longident : (Longident.t) nonterminal
    | N_module_type_signature : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
    | N_module_type_body_EQUAL_ : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
    | N_module_type_body_COLON_ : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
    | N_module_type : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
    | N_module_parameter : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) nonterminal
    | N_module_expr_structure : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
    | N_module_expr_body : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
    | N_module_expr : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
    | N_module_declaration : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
    | N_module_complex_expr : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
    | N_module_binding_body : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
    | N_module_arguments_comma_list : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) nonterminal
    | N_module_arguments : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) nonterminal
    | N_mod_longident : (Longident.t) nonterminal
    | N_mod_ext_longident : (Longident.t) nonterminal
    | N_mod_ext_apply : (Longident.t) nonterminal
    | N_method_ : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.class_field_kind) nonterminal
    | N_match_case_seq_expr_ : (Migrate_parsetree.Ast_404.Parsetree.case) nonterminal
    | N_match_case_expr_ : (Migrate_parsetree.Ast_404.Parsetree.case) nonterminal
    | N_lseparated_nonempty_list_aux_SEMI_class_sig_field_ : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list list) nonterminal
    | N_lseparated_nonempty_list_aux_SEMI_class_field_ : (Migrate_parsetree.Ast_404.Parsetree.class_field list list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_uncurried_labeled_expr_ : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_uncurried_arrow_type_parameter_ : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_type_variable_with_variance_ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_type_parameter_ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_string_literal_label_ : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_string_literal_expr_maybe_punned_ : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_record_label_declaration_ : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_protected_type_ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_pattern_optional_constraint_ : (Migrate_parsetree.Ast_404.Parsetree.pattern list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_opt_spread_pattern__ : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.pattern) list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_opt_spread_lbl_expr__ : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_opt_spread_expr_optional_constraint__ : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_object_label_declaration_ : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_module_parameter_ : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_module_complex_expr_ : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_mod_ext_longident_ : (Longident.t list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_labeled_pattern_ : (Reason_parser_def.labelled_parameter Location.loc list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_field_expr_ : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_expr_optional_constraint_ : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_expr_ : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
    | N_lseparated_nonempty_list_aux_COMMA_core_type_ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
    | N_lseparated_nonempty_list_aux_AND_with_constraint_ : (Migrate_parsetree.Ast_404.Parsetree.with_constraint list) nonterminal
    | N_loption_type_parameters_ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
    | N_loption_terminated_pattern_comma_list_option_COMMA___ : (Migrate_parsetree.Ast_404.Parsetree.pattern list) nonterminal
    | N_loption_row_field_list_ : (Migrate_parsetree.Ast_404.Parsetree.row_field list) nonterminal
    | N_loption_preceded_GREATER_nonempty_list_name_tag___ : (string list) nonterminal
    | N_loption_parenthesized_type_variables_with_variance_comma_list__ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_loption_parenthesized_class_type_arguments_comma_list__ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
    | N_loption_object_label_declarations_ : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
    | N_loption_located_attributes_ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) nonterminal
    | N_loption_functor_parameters_ : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) nonterminal
    | N_loption_class_type_parameters_ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_longident_type_constraint : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) nonterminal
    | N_llist_aux_preceded_COMMA_opt_spread_lbl_expr___ : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) nonterminal
    | N_llist_aux_match_case_seq_expr__ : (Migrate_parsetree.Ast_404.Parsetree.case list) nonterminal
    | N_llist_aux_match_case_expr__ : (Migrate_parsetree.Ast_404.Parsetree.case list) nonterminal
    | N_list_simple_expr_no_call_ : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
    | N_list_bar_row_field_ : (Migrate_parsetree.Ast_404.Parsetree.row_field list) nonterminal
    | N_list_attributed_ext_constructor_extension_constructor_declaration__ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
    | N_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
    | N_list_and_module_rec_declaration_ : (Migrate_parsetree.Ast_404.Parsetree.module_declaration list) nonterminal
    | N_list_and_module_bindings_ : (Migrate_parsetree.Ast_404.Parsetree.module_binding list) nonterminal
    | N_list_and_let_binding_ : (Migrate_parsetree.Ast_404.Parsetree.value_binding list) nonterminal
    | N_list_and_class_type_declaration_ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) nonterminal
    | N_list_and_class_description_ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) nonterminal
    | N_list_and_class_declaration_ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration list) nonterminal
    | N_let_bindings : (Reason_parser_def.let_bindings) nonterminal
    | N_let_binding_body : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_let_binding : (Reason_parser_def.let_bindings) nonterminal
    | N_lbl_pattern : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_labelled_arrow_type_parameter_optional : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_labeled_pattern_constraint : (string Location.loc -> Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_labeled_pattern : (Reason_parser_def.labelled_parameter Location.loc) nonterminal
    | N_labeled_expr_constraint : (Longident.t Location.loc -> Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_labeled_expr : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_labeled_arguments : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
    | N_label_longident : (Longident.t) nonterminal
    | N_jsx_without_leading_less : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_jsx_start_tag_and_args_without_leading_less : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) nonterminal
    | N_jsx_start_tag_and_args : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) nonterminal
    | N_jsx_arguments : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
    | N_jsx : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_item_extension_sugar : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) nonterminal
    | N_item_extension : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) nonterminal
    | N_interface : (Migrate_parsetree.Ast_404.Parsetree.signature) nonterminal
    | N_implementation : (Migrate_parsetree.Ast_404.Parsetree.structure) nonterminal
    | N_ident : (string) nonterminal
    | N_greater_spread : (string) nonterminal
    | N_generalized_constructor_arguments : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
    | N_functor_parameters : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) nonterminal
    | N_fun_def_EQUALGREATER_non_arrowed_core_type_ : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_fun_def_EQUAL_core_type_ : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_field_expr : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_extension_constructor_rebind : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
    | N_extension_constructor_declaration : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
    | N_extension : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) nonterminal
    | N_expr_optional_constraint : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_expr_list : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
    | N_expr_comma_seq_extension : (Migrate_parsetree.Ast_404.Parsetree.expression list *
  Migrate_parsetree.Ast_404.Parsetree.expression option) nonterminal
    | N_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_es6_parameters : (Reason_parser_def.labelled_parameter Location.loc list * bool) nonterminal
    | N_embedded_private_flag_ : (Migrate_parsetree.Ast_404.Asttypes.private_flag) nonterminal
    | N_embedded___anonymous_39_ : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) nonterminal
    | N_embedded___anonymous_33_ : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) nonterminal
    | N_embedded___anonymous_1_ : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) nonterminal
    | N_embedded___anonymous_0_ : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) nonterminal
    | N_either_preceded_EQUALGREATER_expr__braced_expr_ : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_either_preceded_EQUAL_expr__braced_expr_ : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_either_preceded_EQUAL_class_instance_type__class_type_body_ : (Migrate_parsetree.Ast_404.Parsetree.class_type) nonterminal
    | N_either_preceded_EQUAL_class_expr__class_body_expr_ : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
    | N_either_parenthesized_longident_type_constraint__longident_type_constraint_ : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) nonterminal
    | N_either_extension_constructor_declaration_extension_constructor_rebind_ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
    | N_either_constructor_declaration_bar_constructor_declaration_ : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) nonterminal
    | N_either___anonymous_12___anonymous_13_ : (Migrate_parsetree.Ast_404.Asttypes.private_flag) nonterminal
    | N_either_ES6_FUN_FUN_ : (unit) nonterminal
    | N_direction_flag : (Migrate_parsetree.Ast_404.Asttypes.direction_flag) nonterminal
    | N_core_type2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_constructor_declarations_aux : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
    | N_constructor_declarations : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
    | N_constructor_declaration : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) nonterminal
    | N_constructor_arguments_comma_list : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
    | N_constructor_arguments : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments) nonterminal
    | N_constrain_field : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_constrain : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t) nonterminal
    | N_constr_longident : (Longident.t) nonterminal
    | N_constant : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) nonterminal
    | N_clty_longident : (Longident.t) nonterminal
    | N_class_type_declarations : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) nonterminal
    | N_class_type_declaration_details : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_class_type_body : (Migrate_parsetree.Ast_404.Parsetree.class_type) nonterminal
    | N_class_type_arguments_comma_list : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
    | N_class_simple_expr : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
    | N_class_sig_field : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) nonterminal
    | N_class_sig_body_fields : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) nonterminal
    | N_class_sig_body : (Migrate_parsetree.Ast_404.Parsetree.class_signature) nonterminal
    | N_class_self_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_class_self_expr : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
    | N_class_longident : (Longident.t) nonterminal
    | N_class_instance_type : (Migrate_parsetree.Ast_404.Parsetree.class_type) nonterminal
    | N_class_field : (Migrate_parsetree.Ast_404.Parsetree.class_field list) nonterminal
    | N_class_expr_lets_and_rest : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
    | N_class_expr : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
    | N_class_descriptions : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) nonterminal
    | N_class_description_details : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_class_declaration_details : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
    | N_class_declaration_body : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
    | N_class_constructor_type : (Migrate_parsetree.Ast_404.Parsetree.class_type) nonterminal
    | N_braced_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
    | N_boption_AMPERSAND_ : (bool) nonterminal
    | N_basic_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_bar_row_field : (Migrate_parsetree.Ast_404.Parsetree.row_field) nonterminal
    | N_bar_constructor_declaration : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) nonterminal
    | N_attributed_ext_constructors_extension_constructor_declaration_ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
    | N_attributed_ext_constructors_either_extension_constructor_declaration_extension_constructor_rebind__ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
    | N_attribute : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) nonterminal
    | N_attr_id : (string Location.loc) nonterminal
    | N_arrowed_simple_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_arrow_type_parameters : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) nonterminal
    | N_arrow_type_parameter : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
    | N_and_type_declaration : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
    | N_and_module_rec_declaration : (Migrate_parsetree.Ast_404.Parsetree.module_declaration) nonterminal
    | N_and_module_bindings : (Migrate_parsetree.Ast_404.Parsetree.module_binding) nonterminal
    | N_and_class_type_declaration : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration) nonterminal
    | N_and_class_description : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description) nonterminal
    | N_and_class_declaration : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration) nonterminal
    | N_additive : (string) nonterminal
    | N__lbl_pattern_list : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) nonterminal
  
  (* The inspection API. *)
  
  include MenhirLib.IncrementalEngine.INSPECTION
    with type 'a lr1state := 'a lr1state
    with type production := production
    with type 'a terminal := 'a terminal
    with type 'a nonterminal := 'a nonterminal
    with type 'a env := 'a env
  
end

(* The entry point(s) to the incremental API. *)

module Incremental : sig
  
  val use_file: Lexing.position -> (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) MenhirInterpreter.checkpoint
  
  val toplevel_phrase: Lexing.position -> (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) MenhirInterpreter.checkpoint
  
  val parse_pattern: Lexing.position -> (Migrate_parsetree.Ast_404.Parsetree.pattern) MenhirInterpreter.checkpoint
  
  val parse_expression: Lexing.position -> (Migrate_parsetree.Ast_404.Parsetree.expression) MenhirInterpreter.checkpoint
  
  val parse_core_type: Lexing.position -> (Migrate_parsetree.Ast_404.Parsetree.core_type) MenhirInterpreter.checkpoint
  
  val interface: Lexing.position -> (Migrate_parsetree.Ast_404.Parsetree.signature) MenhirInterpreter.checkpoint
  
  val implementation: Lexing.position -> (Migrate_parsetree.Ast_404.Parsetree.structure) MenhirInterpreter.checkpoint
  
end

end = struct
#1 "reason_parser.ml"

(* This generated code requires the following version of MenhirLib: *)

let () =
  MenhirLib.StaticVersion.require_20190924

module MenhirBasics = struct
  
  exception Error
  
  type token = 
    | WITH
    | WHILE
    | WHEN
    | VIRTUAL
    | VAL
    | UNDERSCORE
    | UIDENT of (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 22 "src/reason-parser/reason_parser.ml"
  )
    | TYPE
    | TRY
    | TRUE
    | TO
    | TILDE
    | THEN
    | SWITCH
    | STRUCT
    | STRING of (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 35 "src/reason-parser/reason_parser.ml"
  )
    | STAR
    | SLASHGREATER
    | SIG
    | SHARPOP of (
# 1155 "src/reason-parser/reason_parser.mly"
       (string)
# 43 "src/reason-parser/reason_parser.ml"
  )
    | SHARPEQUAL
    | SHARP
    | SEMISEMI
    | SEMI
    | RPAREN
    | REC
    | RBRACKET
    | RBRACE
    | QUOTE
    | QUESTION
    | PUB
    | PRI
    | PREFIXOP of (
# 1142 "src/reason-parser/reason_parser.mly"
       (string)
# 60 "src/reason-parser/reason_parser.ml"
  )
    | POSTFIXOP of (
# 1143 "src/reason-parser/reason_parser.mly"
       (string)
# 65 "src/reason-parser/reason_parser.ml"
  )
    | PLUSEQ
    | PLUSDOT
    | PLUS
    | PERCENT
    | OR
    | OPEN
    | OF
    | OBJECT
    | NONREC
    | NEW
    | NATIVEINT of (
# 1131 "src/reason-parser/reason_parser.mly"
       (nativeint)
# 80 "src/reason-parser/reason_parser.ml"
  )
    | MUTABLE
    | MODULE
    | MINUSGREATER
    | MINUSDOT
    | MINUS
    | LPAREN
    | LIDENT of (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 91 "src/reason-parser/reason_parser.ml"
  )
    | LET
    | LESSSLASHIDENTGREATER of (
# 1151 "src/reason-parser/reason_parser.mly"
       (string)
# 97 "src/reason-parser/reason_parser.ml"
  )
    | LESSSLASHGREATER
    | LESSIDENT of (
# 1114 "src/reason-parser/reason_parser.mly"
       (string)
# 103 "src/reason-parser/reason_parser.ml"
  )
    | LESSGREATER
    | LESSDOTDOTGREATER
    | LESS
    | LBRACKETPERCENTPERCENT
    | LBRACKETPERCENT
    | LBRACKETLESS
    | LBRACKETGREATER
    | LBRACKETBAR
    | LBRACKETAT
    | LBRACKET
    | LBRACELESS
    | LBRACE
    | LAZY
    | INT of (
# 1102 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 121 "src/reason-parser/reason_parser.ml"
  )
    | INITIALIZER
    | INHERIT
    | INFIXOP4 of (
# 1099 "src/reason-parser/reason_parser.mly"
       (string)
# 128 "src/reason-parser/reason_parser.ml"
  )
    | INFIXOP3 of (
# 1096 "src/reason-parser/reason_parser.mly"
       (string)
# 133 "src/reason-parser/reason_parser.ml"
  )
    | INFIXOP2 of (
# 1095 "src/reason-parser/reason_parser.mly"
       (string)
# 138 "src/reason-parser/reason_parser.ml"
  )
    | INFIXOP1 of (
# 1094 "src/reason-parser/reason_parser.mly"
       (string)
# 143 "src/reason-parser/reason_parser.ml"
  )
    | INFIXOP0 of (
# 1093 "src/reason-parser/reason_parser.mly"
       (string)
# 148 "src/reason-parser/reason_parser.ml"
  )
    | INCLUDE
    | IN
    | IF
    | GREATERRBRACE
    | GREATERDOTDOTDOT
    | GREATER
    | FUNCTOR
    | FUNCTION
    | FUN
    | FOR
    | FLOAT of (
# 1081 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 163 "src/reason-parser/reason_parser.ml"
  )
    | FALSE
    | EXTERNAL
    | EXCEPTION
    | ES6_FUN
    | EQUALGREATER
    | EQUAL
    | EOL
    | EOF
    | END
    | ELSE
    | DOWNTO
    | DOTDOTDOT
    | DOTDOT
    | DOT
    | DONE
    | DOCSTRING of (
# 1176 "src/reason-parser/reason_parser.mly"
       (string)
# 183 "src/reason-parser/reason_parser.ml"
  )
    | DO
    | CONSTRAINT
    | COMMENT of (
# 1175 "src/reason-parser/reason_parser.mly"
       (string * Location.t)
# 190 "src/reason-parser/reason_parser.ml"
  )
    | COMMA
    | COLONGREATER
    | COLONEQUAL
    | COLONCOLON
    | COLON
    | CLASS
    | CHAR of (
# 1060 "src/reason-parser/reason_parser.mly"
       (char)
# 201 "src/reason-parser/reason_parser.ml"
  )
    | BEGIN
    | BARRBRACKET
    | BARBAR
    | BAR
    | BANG
    | BACKQUOTE
    | ASSERT
    | AS
    | AND
    | AMPERSAND
    | AMPERAMPER
  
end

include MenhirBasics

let _eRR =
  MenhirBasics.Error

# 50 "src/reason-parser/reason_parser.mly"
  
open Migrate_parsetree
open OCaml_404.Ast
open Reason_syntax_util
open Location
open Asttypes
open Longident
open Parsetree
open Ast_helper
open Ast_mapper
open Reason_parser_def
open Reason_string
open Reason_errors

let raise_error error loc =
  raise_error (Ast_error error) loc

module Clflags = Reason_syntax_util.Clflags
(*
   TODO:
   - Remove all [open]s from the top of this file one by one and fix compilation
   failures that ensue by specifying the appropriate long identifiers. That
   will make the parser much easier to reason about.
   - Go back to trunk, do the same (remove [open]s, and fully specify long
   idents), to perform a clean diff.

*)

(**

   location.ml:
   ------------
   let mkloc txt loc = { txt ; loc }
   let rhs_loc n = {
     loc_start = Parsing.rhs_start_pos n;
     loc_end = Parsing.rhs_end_pos n;
     loc_ghost = false;
   }
   let symbol_rloc () = {
     loc_start = Parsing.symbol_start_pos ();
     loc_end = Parsing.symbol_end_pos ();
     loc_ghost = false;
   }

   let symbol_gloc () = {
     loc_start = Parsing.symbol_start_pos ();
     loc_end = Parsing.symbol_end_pos ();
     loc_ghost = true;
   }

   ast_helper.ml:
   ------------
   module Typ = struct
    val mk: ?loc:loc -> ?attrs:attrs -> core_type_desc -> core_type
    let mk ?(loc = !default_loc) ?(attrs = []) d =
       {ptyp_desc = d; ptyp_loc = loc; ptyp_attributes = attrs}
     ..
   end

   parse_tree.mli
   --------------
   and core_type = {
     ptyp_desc: core_type_desc;
     ptyp_loc: Location.t;
     ptyp_attributes: attributes; (* ... [@id1] [@id2] *)
   }

   and core_type_desc =
     | Ptyp_any
           (*  _ *)
     | Ptyp_var of string
           (* 'a *)
     | Ptyp_arrow of label * core_type * core_type
           (* T1 -> T2       (label = "")
              ~l:T1 -> T2    (label = "l")
              ?l:T1 -> T2    (label = "?l")
            *)
     | Ptyp_tuple of core_type list
           (* T1 * ... * Tn   (n >= 2) *)

   reason_parser.mly
   ---------------
   In general:

                                          syntax variant          {pblah_desc: core_blah_desc
                                                                   pblah_loc: {txt, loc}
                                                                   pblah_attributes: ... }
                                         /              \            /       \
   val mkblah: ~loc -> ~attributes ->     core_blah_desc     ->      core_blah
   let mkblah = Blah.mk

*)

let uncurry_payload ?(name="bs") loc = ({loc; txt = name}, PStr [])

let dummy_loc () = {
  loc_start = Lexing.dummy_pos;
  loc_end = Lexing.dummy_pos;
  loc_ghost = false;
}

let mklocation loc_start loc_end = {
  loc_start = loc_start;
  loc_end = loc_end;
  loc_ghost = false;
}

let make_real_loc loc = {
    loc with loc_ghost = false
}

let make_ghost_loc loc = {
    loc with loc_ghost = true
}

let ghloc ?(loc=dummy_loc ()) d = { txt = d; loc = (make_ghost_loc loc) }

(**
  * turn an object into a real
  *)
let make_real_exp exp = {
    exp with pexp_loc = make_real_loc exp.pexp_loc
}
let make_real_pat pat = {
    pat with ppat_loc = make_real_loc pat.ppat_loc
}
(*
 * change the location state to be a ghost location or real location
 *)
let set_loc_state is_ghost loc =
    if is_ghost then make_ghost_loc loc else make_real_loc loc

let mktyp ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Typ.mk ~loc d

let mkpat ?(attrs=[]) ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Pat.mk ~loc ~attrs d

let mkexp ?(attrs=[]) ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Exp.mk ~loc ~attrs d

let mkmty ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Mty.mk ~loc d

let mksig ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Sig.mk ~loc d

let mkmod ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Mod.mk ~loc d

let mkstr ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Str.mk ~loc d

let mkclass ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Cl.mk ~loc d

let mkcty ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Cty.mk ~loc d

let mkctf ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Ctf.mk ~loc d

let may_tuple startp endp = function
  | []  -> assert false
  | [x] -> {x with pexp_loc = mklocation startp endp}
  | xs  -> mkexp ~loc:(mklocation startp endp) (Pexp_tuple xs)

(**
  Make a core_type from a as_loc(LIDENT).
  Useful for record type punning.
  type props = {width: int, height: int};
  type state = {nbrOfClicks: int};
  type component = {props, state};
*)
let mkct lbl =
  let lident = Lident lbl.txt in
  let ttype = Ptyp_constr({txt = lident; loc = lbl.loc}, []) in
  {ptyp_desc = ttype; ptyp_loc = lbl.loc; ptyp_attributes = []}

let mkcf ?(loc=dummy_loc()) ?(ghost=false) d =
    let loc = set_loc_state ghost loc in
    Cf.mk ~loc d

let simple_ghost_text_attr ?(loc=dummy_loc ()) txt =
  let loc = set_loc_state true loc in
  [({txt; loc}, PStr [])]

let mkExplicitArityTuplePat ?(loc=dummy_loc ()) pat =
  (* Tell OCaml type system that what this tuple construction represents is
     not actually a tuple, and should represent several constructor
     arguments.  This allows the syntax the ability to distinguish between:

     X (10, 20)  -- One argument constructor
     X 10 20     -- Multi argument constructor
  *)
  mkpat
    ~loc
    ~attrs:(simple_ghost_text_attr ~loc "explicit_arity")
    pat

let mkExplicitArityTupleExp ?(loc=dummy_loc ()) exp_desc =
  mkexp
    ~loc
    ~attrs:(simple_ghost_text_attr ~loc "explicit_arity")
    exp_desc

let is_pattern_list_single_any = function
  | [{ppat_desc=Ppat_any; ppat_attributes=[]} as onlyItem] -> Some onlyItem
  | _ -> None

let mkoperator {Location. txt; loc} =
  Exp.mk ~loc (Pexp_ident(mkloc (Lident txt) loc))

(*
  Ghost expressions and patterns:
  expressions and patterns that do not appear explicitly in the
  source file they have the loc_ghost flag set to true.
  Then the profiler will not try to instrument them and the
  -annot option will not try to display their type.

  Every grammar rule that generates an element with a location must
  make at most one non-ghost element, the topmost one.

  How to tell whether your location must be ghost:
  A location corresponds to a range of characters in the source file.
  If the location contains a piece of code that is syntactically
  valid (according to the documentation), and corresponds to the
  AST node, then the location must be real; in all other cases,
  it must be ghost.

  jordwalke: Noticed that ghost expressions are often used when inserting
   additional AST nodes from a parse rule. Either an extra wrapping one, or an
   additional inner node. This is consistent with the above description, I
   believe.
*)


let ghunit ?(loc=dummy_loc ()) () =
  mkexp ~ghost:true ~loc (Pexp_construct (mknoloc (Lident "()"), None))

let mkinfixop arg1 op arg2 =
  mkexp(Pexp_apply(op, [Nolabel, arg1; Nolabel, arg2]))

let mkinfix arg1 name arg2 =
  mkinfixop arg1 (mkoperator name) arg2

let neg_string f =
  if String.length f > 0 && f.[0] = '-'
  then String.sub f 1 (String.length f - 1)
  else "-" ^ f

let mkuminus name arg =
  match name.txt, arg.pexp_desc with
  | "-", Pexp_constant(Pconst_integer (n,m)) ->
      mkexp(Pexp_constant(Pconst_integer(neg_string n,m)))
  | ("-" | "-."), Pexp_constant(Pconst_float (f, m)) ->
      mkexp(Pexp_constant(Pconst_float(neg_string f, m)))
  | txt, _ ->
      let name = {name with txt = "~" ^ txt} in
      mkexp(Pexp_apply(mkoperator name, [Nolabel, arg]))

let prepare_functor_arg = function
  | Some name, mty -> (name, mty)
  | None, (Some {pmty_loc} as mty) ->
      (mkloc "_" (make_ghost_loc pmty_loc), mty)
  | None, None -> assert false

let mk_functor_mod args body =
  let folder arg acc =
    let name, mty = prepare_functor_arg arg.txt in
    mkmod ~loc:arg.loc (Pmod_functor(name, mty, acc))
  in
  List.fold_right folder args body

let mk_functor_mty args body =
  let folder arg acc =
    let name, mty = prepare_functor_arg arg.txt in
    mkmty ~loc:arg.loc (Pmty_functor(name, mty, acc))
  in
  List.fold_right folder args body

let mkuplus name arg =
  match name.txt, arg.pexp_desc with
  | "+", Pexp_constant(Pconst_integer _)
  | ("+" | "+."), Pexp_constant(Pconst_float _) ->
      mkexp arg.pexp_desc
  | txt, _ ->
      let name = {name with txt = "~" ^ txt} in
      mkexp(Pexp_apply(mkoperator name, [Nolabel, arg]))

let mkexp_cons consloc args loc =
  mkexp ~loc (Pexp_construct(mkloc (Lident "::") consloc, Some args))

let mkexp_constructor_unit ?(uncurried=false) consloc loc =
  let attrs = if uncurried then [uncurry_payload ~name:"uncurry" loc] else [] in
  mkexp ~attrs ~loc (Pexp_construct(mkloc (Lident "()") consloc, None))

let ghexp_cons args loc =
  mkexp ~ghost:true ~loc (Pexp_construct(mkloc (Lident "::") loc, Some args))

let mkpat_cons args loc =
  mkpat ~loc (Ppat_construct(mkloc (Lident "::") loc, Some args))

let ghpat_cons args loc =
  mkpat ~ghost:true ~loc (Ppat_construct(mkloc (Lident "::") loc, Some args))

let mkpat_constructor_unit consloc loc =
  mkpat ~loc (Ppat_construct(mkloc (Lident "()") consloc, None))

let simple_pattern_list_to_tuple ?(loc=dummy_loc ()) = function
  | [] -> assert false
  | lst -> mkpat ~loc (Ppat_tuple lst)

let mktailexp_extension loc seq ext_opt =
  let rec handle_seq = function
    | [] ->
        let base_case = match ext_opt with
          | Some ext ->
            ext
          | None ->
            let loc = make_ghost_loc loc in
            let nil = { txt = Lident "[]"; loc } in
            Exp.mk ~loc (Pexp_construct (nil, None)) in
        base_case
    | e1 :: el ->
        let exp_el = handle_seq el in
        let loc = mklocation e1.pexp_loc.loc_start exp_el.pexp_loc.loc_end in
        let arg = mkexp ~ghost:true ~loc (Pexp_tuple [e1; exp_el]) in
        ghexp_cons arg loc
  in
  handle_seq seq

let mktailpat_extension loc (seq, ext_opt) =
  let rec handle_seq = function
    [] ->
      let base_case = match ext_opt with
        | Some ext ->
          ext
        | None ->
          let loc = make_ghost_loc loc in
          let nil = { txt = Lident "[]"; loc } in
          mkpat ~loc (Ppat_construct (nil, None)) in
      base_case
  | p1 :: pl ->
      let pat_pl = handle_seq pl in
      let loc = mklocation p1.ppat_loc.loc_start pat_pl.ppat_loc.loc_end in
      let arg = mkpat ~ghost:true ~loc (Ppat_tuple [p1; pat_pl]) in
      ghpat_cons arg loc in
  handle_seq seq

let makeFrag loc body =
  let attribute = ({txt = "JSX"; loc = loc}, PStr []) in
  { body with pexp_attributes = attribute :: body.pexp_attributes }


(* Applies attributes to the structure item, not the expression itself. Makes
 * structure item have same location as expression. *)

let mkstrexp e attrs =
  match e with
  | ({pexp_desc = Pexp_apply (({pexp_attributes} as e1), args) } as eRewrite)
      when let f = (List.filter (function
        | ({txt = "bs"}, _) -> true
          | _ -> false ) e.pexp_attributes)  in
      List.length f > 0
    ->
      let appExprAttrs = List.filter (function
          | ({txt = "bs"}, PStr []) -> false
          | _ -> true ) pexp_attributes in
      let strEvalAttrs = (uncurry_payload e1.pexp_loc)::(List.filter (function
          | ({txt = "bs"}, PStr []) -> false
          | _ -> true ) attrs) in
      let e = {
        eRewrite with
        pexp_desc = (Pexp_apply(e1, args));
        pexp_attributes = appExprAttrs
      } in
      { pstr_desc = Pstr_eval (e, strEvalAttrs); pstr_loc = e.pexp_loc }
  | _ ->
      { pstr_desc = Pstr_eval (e, attrs); pstr_loc = e.pexp_loc }

let ghexp_constraint loc e (t1, t2) =
  match t1, t2 with
  | Some t, None -> mkexp ~ghost:true ~loc (Pexp_constraint(e, t))
  | _, Some t -> mkexp ~ghost:true ~loc (Pexp_coerce(e, t1, t))
  | None, None -> assert false

let mk_record_expr ?loc (exten, fields) =
  match fields, exten with
  | [], Some expr -> expr
  | _ -> mkexp ?loc (Pexp_record (fields, exten))

let array_function ?(loc=dummy_loc()) str name =
  ghloc ~loc (Ldot(Lident str, (if !Clflags.fast then "unsafe_" ^ name else name)))

let syntax_error loc s =
  raise_error (Other_syntax_error s) loc

let syntax_error_exp loc msg =
  Exp.extension ~loc (Reason_errors.error_extension_node loc msg)

let syntax_error_pat loc msg =
  Pat.extension ~loc (Reason_errors.error_extension_node loc msg)

let syntax_error_mty loc msg =
  Mty.extension ~loc (Reason_errors.error_extension_node loc msg)

let syntax_error_typ loc msg =
  Typ.extension ~loc (Reason_errors.error_extension_node loc msg)

let not_expecting start_pos end_pos nonterm =
  let location = mklocation start_pos end_pos in
  raise_error (Not_expecting (location, nonterm)) location

let mkexp_fun {Location.txt; loc} body =
  let loc = mklocation loc.loc_start body.pexp_loc.loc_end in
  match txt with
  | Term (label, default_expr, pat) ->
    Exp.fun_ ~loc label default_expr pat body
  | Type str ->
    Exp.newtype ~loc str body

let mkclass_fun {Location. txt ; loc} body =
  let loc = mklocation loc.loc_start body.pcl_loc.loc_end in
  match txt with
  | Term (label, default_expr, pat) ->
    Cl.fun_ ~loc label default_expr pat body
  | Type _ ->
    let pat = syntax_error_pat loc "(type) not allowed in classes" in
    Cl.fun_ ~loc Nolabel None pat body

let mktyp_arrow ({Location.txt = (label, cod); loc}, uncurried) dom =
  let loc = mklocation loc.loc_start dom.ptyp_loc.loc_end in
  let typ = mktyp ~loc (Ptyp_arrow (label, cod, dom)) in
  {typ with ptyp_attributes = (if uncurried then [uncurry_payload loc] else [])}

let mkcty_arrow ({Location.txt = (label, cod); loc}, uncurried) dom =
  let loc = mklocation loc.loc_start dom.pcty_loc.loc_end in
  let ct = mkcty ~loc (Pcty_arrow (label, cod, dom)) in
  {ct with pcty_attributes = (if uncurried then [uncurry_payload loc] else [])}

(**
  * process the occurrence of _ in the arguments of a function application
  * replace _ with a new variable, currently __x, in the arguments
  * return a wrapping function that wraps ((__x) => ...) around an expression
  * e.g. foo(_, 3) becomes (__x) => foo(__x, 3)
  *)
let process_underscore_application args =
  let exp_question = ref None in
  let hidden_var = "__x" in
  let check_arg ((lab, exp) as arg) = match exp.pexp_desc with
    | Pexp_ident ({ txt = Lident "_"} as id) ->
        let new_id = mkloc (Lident hidden_var) id.loc in
        let new_exp = mkexp (Pexp_ident new_id) ~loc:exp.pexp_loc in
        exp_question := Some new_exp;
        (lab, new_exp)
    | _ ->
        arg in
  let args = List.map check_arg args in
  let wrap exp_apply = match !exp_question with
    | Some {pexp_loc=loc} ->
        let pattern = mkpat (Ppat_var (mkloc hidden_var loc)) ~loc in
        begin match exp_apply.pexp_desc with
        (* Transform pipe first with underscore application correct:
         * 5->doStuff(3, _, 7);
         * (5 |. doStuff)(3, _, 7)
         * 5 |. (__x => doStuff(3, __x, 7))
         *)
        | Pexp_apply(
          {pexp_desc= Pexp_apply(
            {pexp_desc = Pexp_ident({txt = Longident.Lident("|.")})} as pipeExp,
            [Nolabel, arg1; Nolabel, ({pexp_desc = Pexp_ident _} as arg2)]
            (*         5                            doStuff                   *)
          )},
          args (* [3, __x, 7] *)
          ) ->
            (* build `doStuff(3, __x, 7)` *)
            let innerApply = {arg2 with pexp_desc = Pexp_apply(arg2, args)} in
            (* build `__x => doStuff(3, __x, 7)` *)
            let innerFun =
              mkexp (Pexp_fun (Nolabel, None, pattern, innerApply)) ~loc
            in
            (* build `5 |. (__x => doStuff(3, __x, 7))` *)
            {exp_apply with pexp_desc =
              Pexp_apply(pipeExp, [Nolabel, arg1; Nolabel, innerFun])
            }
        | _ ->
          mkexp (Pexp_fun (Nolabel, None, pattern, exp_apply)) ~loc
        end
    | None ->
        exp_apply in
  (args, wrap)

(**
  * Joins a 'body' and it's 'args' to form a Pexp_apply.
  * Example:
  * 'add' (body) and '[1, 2]' (args) become a Pexp_apply representing 'add(1, 2)'
  *
  * Note that `add(. 1, 2)(. 3, 4)` & `add(. 1, 2, . 3, 4)` both
  * give `[[@uncurry] 1, 2, [@uncurry] 3, 4]]` as args.
  * The dot is parsed as [@uncurry] to distinguish between specific
  * uncurrying and [@bs]. They can appear in the same arg:
  * `add(. [@bs] 1)` is a perfectly valid, the dot indicates uncurrying
  * for the whole application of 'add' and [@bs] sits on the `1`.
  * Due to the dot of uncurried application possibly appearing in any
  * position of the args, we need to post-process the args and split
  * all args in groups that are uncurried (or not).
  * add(. 1, . 2) should be parsed as (add(. 1))(. 2)
  * The args can be splitted here in [1] & [2], based on those groups
  * we can recursively build the correct nested Pexp_apply here.
  *  -> Pexp_apply (Pexp_apply (add, 1), 2)   (* simplified ast *)
  *)
let mkexp_app_rev startp endp (body, args) =
  let loc = mklocation startp endp in
  if args = [] then {body with pexp_loc = loc}
  else
  (*
   * Post process the arguments and transform [@uncurry] into [@bs].
   * Returns a tuple with a boolean (was it uncurried?) and
   * the posible rewritten arg.
   *)
  let rec process_args acc es =
    match es with
    | (lbl, e)::es ->
        let attrs = e.pexp_attributes in
        let hasUncurryAttr = ref false in
        let newAttrs = List.filter (function
          | ({txt = "uncurry"}, PStr []) ->
              hasUncurryAttr := true;
              false
          | _ -> true) attrs
        in
        let uncurried = !hasUncurryAttr in
        let newArg = (lbl, { e with pexp_attributes = newAttrs }) in
        process_args ((uncurried, newArg)::acc) es
    | [] -> acc
    in
    (*
     * Groups all uncurried args falling under the same Pexp_apply
     * Example:
     *    add(. 2, 3, . 4, 5) or add(. 2, 3)(. 4, 5)  (equivalent)
     * This results in two groups: (true, [2, 3]) & (true, [4, 5])
     * Both groups have 'true' as their first tuple element, because
     * they are uncurried.
     * add(2, 3, . 4) results in the groups (false, [2, 3]) & (true, [4])
     *)
    let rec group grp acc = function
    | (uncurried, arg)::xs ->
        let (_u, grp) = grp in
        if uncurried = true then begin
          group (true, [arg]) ((_u, (List.rev grp))::acc) xs
        end else begin
          group (_u, (arg::grp)) acc xs
        end
    | [] ->
        let (_u, grp) = grp in
        List.rev ((_u, (List.rev grp))::acc)
    in
    (*
     * Recursively transforms all groups into a (possibly uncurried)
     * Pexp_apply
     *
     * Example:
     *   Given the groups (true, [2, 3]) & (true, [4, 5]) and body 'add',
     *   we get the two nested Pexp_apply associated with
     *   (add(. 2, 3))(. 4, 5)
     *)
    let rec make_appl body = function
      | args::xs ->
          let (uncurried, args) = args in
          let expr = if args = [] then body
          else
            let (args, wrap) = process_underscore_application args in
            let args_loc = match args, List.rev args with
              | ((_, s)::_), ((_, e)::_) -> mklocation s.pexp_loc.loc_start e.pexp_loc.loc_end
              | _ -> assert false in
            let expr = mkexp ~loc:args_loc (Pexp_apply (body, args)) in
            let expr = if uncurried then {expr with pexp_attributes = [uncurry_payload loc]} else expr in
            wrap expr
          in
            make_appl expr xs
      | [] -> {body with pexp_loc = loc}
    in
    let processed_args = process_args [] args in
    let groups = group (false, []) [] processed_args in
    make_appl body groups

let mkmod_app mexp marg =
  mkmod ~loc:(mklocation mexp.pmod_loc.loc_start marg.pmod_loc.loc_end)
    (Pmod_apply (mexp, marg))

let bigarray_function ?(loc=dummy_loc()) str name =
  ghloc ~loc (Ldot(Ldot(Lident "Bigarray", str), name))

let bigarray_get ?(loc=dummy_loc()) arr arg =
  let get = if !Clflags.fast then "unsafe_get" else "get" in
  match arg with
    [c1] ->
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc (Pexp_ident(bigarray_function ~loc "Array1" get)),
                       [Nolabel, arr; Nolabel, c1]))
  | [c1;c2] ->
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc (Pexp_ident(bigarray_function ~loc "Array2" get)),
                       [Nolabel, arr; Nolabel, c1; Nolabel, c2]))
  | [c1;c2;c3] ->
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc (Pexp_ident(bigarray_function ~loc "Array3" get)),
                       [Nolabel, arr; Nolabel, c1; Nolabel, c2; Nolabel, c3]))
  | coords ->
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc (Pexp_ident(bigarray_function ~loc "Genarray" "get")),
                       [Nolabel, arr; Nolabel, mkexp ~ghost:true ~loc (Pexp_array coords)]))

let bigarray_set ?(loc=dummy_loc()) arr arg newval =
  let set = if !Clflags.fast then "unsafe_set" else "set" in
  match arg with
    [c1] ->
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc (Pexp_ident(bigarray_function ~loc "Array1" set)),
                       [Nolabel, arr; Nolabel, c1; Nolabel, newval]))
  | [c1;c2] ->
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc (Pexp_ident(bigarray_function ~loc "Array2" set)),
                       [Nolabel, arr; Nolabel, c1; Nolabel, c2; Nolabel, newval]))
  | [c1;c2;c3] ->
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc (Pexp_ident(bigarray_function ~loc "Array3" set)),
                       [Nolabel, arr; Nolabel, c1; Nolabel, c2; Nolabel, c3; Nolabel, newval]))
  | coords ->
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc (Pexp_ident(bigarray_function ~loc "Genarray" "set")),
                       [Nolabel, arr;
                        Nolabel, mkexp ~ghost:true ~loc (Pexp_array coords);
                        Nolabel, newval]))

let exp_of_label label =
  mkexp ~loc:label.loc (Pexp_ident {label with txt=Lident(Longident.last label.txt)})

let pat_of_label label =
  mkpat ~loc:label.loc (Ppat_var {label with txt=(Longident.last label.txt)})

let check_variable vl loc v =
  if List.mem v vl then
    raise_error (Variable_in_scope (loc,v)) loc

let varify_constructors var_names t =
  let rec loop t =
    let desc =
      match t.ptyp_desc with
      | Ptyp_any -> Ptyp_any
      | Ptyp_var x ->
          check_variable var_names t.ptyp_loc x;
          Ptyp_var x
      | Ptyp_arrow (label,core_type,core_type') ->
          Ptyp_arrow(label, loop core_type, loop core_type')
      | Ptyp_tuple lst -> Ptyp_tuple (List.map loop lst)
      | Ptyp_constr( { txt = Lident s }, []) when List.mem s var_names ->
          Ptyp_var s
      | Ptyp_constr(longident, lst) ->
          Ptyp_constr(longident, List.map loop lst)
      | Ptyp_object (lst, o) ->
          Ptyp_object
            (List.map (fun (s, attrs, t) -> (s, attrs, loop t)) lst, o)
      | Ptyp_class (longident, lst) ->
          Ptyp_class (longident, List.map loop lst)
      | Ptyp_alias(core_type, string) ->
          check_variable var_names t.ptyp_loc string;
          Ptyp_alias(loop core_type, string)
      | Ptyp_variant(row_field_list, flag, lbl_lst_option) ->
          Ptyp_variant(List.map loop_row_field row_field_list,
                       flag, lbl_lst_option)
      | Ptyp_poly(string_lst, core_type) ->
          List.iter (check_variable var_names t.ptyp_loc) string_lst;
          Ptyp_poly(string_lst, loop core_type)
      | Ptyp_package(longident,lst) ->
          Ptyp_package(longident,List.map (fun (n,typ) -> (n,loop typ) ) lst)
      | Ptyp_extension (s, arg) ->
          Ptyp_extension (s, arg)
    in
    {t with ptyp_desc = desc}
  and loop_row_field  =
    function
      | Rtag(label,attrs,flag,lst) ->
          Rtag(label,attrs,flag,List.map loop lst)
      | Rinherit t ->
          Rinherit (loop t)
  in
  loop t

let pexp_newtypes ?loc newtypes exp =
  List.fold_right (fun newtype exp -> mkexp ?loc (Pexp_newtype (newtype, exp)))
    newtypes exp

(**
  I believe that wrap_type_annotation will automatically generate the type
  arguments (type a) (type b) based on what was listed before the dot in a
  polymorphic type annotation that uses locally abstract types.
 *)
let wrap_type_annotation newtypes core_type body =
  let exp = mkexp(Pexp_constraint(body,core_type)) in
  let exp = pexp_newtypes newtypes exp in
  let typ = mktyp ~ghost:true (Ptyp_poly(newtypes,varify_constructors newtypes core_type)) in
  (exp, typ)


let struct_item_extension (ext_attrs, ext_id) structure_items =
  mkstr ~ghost:true (Pstr_extension ((ext_id, PStr structure_items), ext_attrs))

let expression_extension ?loc (ext_attrs, ext_id) item_expr =
  let extension = (ext_id, PStr [mkstrexp item_expr []]) in
  let loc = match loc with
    | Some loc -> loc
    | None -> make_ghost_loc (dummy_loc ())
  in
  Exp.extension ~loc ~attrs:ext_attrs extension

(* There's no more need for these functions - this was for the following:
 *
 *     fun % ext [@foo] arg => arg;
 *
 *   Becoming
 *
 *     [%ext  (fun arg => arg) [@foo]]
 *
 *   Which we no longer support.
 *)
(* Applies the attributes to the body, then wraps entire thing in an extension
 * expression, whose payload consists of a single structure item that is body
 *)
(* let wrap_exp_attrs body (ext, attrs) = *)
(*   (* todo: keep exact location for the entire attribute *) *)
(*   let body = {body with pexp_attributes = attrs @ body.pexp_attributes} in *)
(*   match ext with *)
(*   | None -> body *)
(*   | Some id -> mkexp ~ghost:true (Pexp_extension (id, PStr [mkstrexp body []])) *)

(* Why not just mkexp with the right attributes in the first place? *)
(* let mkexp_attrs d attrs = *)
(*   wrap_exp_attrs (mkexp d) attrs *)

let mkcf_attrs ?(loc=dummy_loc()) d attrs =
  Cf.mk ~loc ~attrs d

let mkctf_attrs d attrs =
  Ctf.mk ~attrs d

let mklbs ext rf lb loc =
  { lbs_bindings = [lb];
    lbs_rec = rf;
    lbs_extension = ext;
    lbs_loc = loc; }

let addlbs lbs lbs' =
  { lbs with lbs_bindings = lbs.lbs_bindings @ lbs' }

let val_of_let_bindings lbs =
  let str = Str.value lbs.lbs_rec lbs.lbs_bindings in
  match lbs.lbs_extension with
  | None -> str
  | Some ext -> struct_item_extension ext [str]

let expr_of_let_bindings ~loc lbs body =
  let item_expr = Exp.let_ ~loc lbs.lbs_rec lbs.lbs_bindings body in
  match lbs.lbs_extension with
  | None -> item_expr
  | Some ext -> expression_extension ~loc:(make_ghost_loc loc) ext item_expr

let class_of_let_bindings lbs body =
  if lbs.lbs_extension <> None then
    raise_error (Not_expecting (lbs.lbs_loc, "extension")) lbs.lbs_loc;
  Cl.let_ lbs.lbs_rec lbs.lbs_bindings body

(*
 * arity_conflict_resolving_mapper is triggered when both "implicit_arity" "explicit_arity"
 * are in the attribtues. In that case we have to remove "explicit_arity"
 *
 * However, if we simply remove explicit_arity, we would end up with a
 * wrapping tuple which has only one component (inner tuple).
 * This is against the invariance where tuples must have 2+ components.
 * Therefore, in the case we have to remove explicit_arity, we also need to
 * unwrap the tuple to expose the inner tuple directly.
 *
 *)
let arity_conflict_resolving_mapper super =
{ super with
  expr = begin fun mapper expr ->
    match expr with
      | {pexp_desc=Pexp_construct(lid, args);
         pexp_loc;
         pexp_attributes} when attributes_conflicted "implicit_arity" "explicit_arity" pexp_attributes ->
         let new_args =
           match args with
             | Some {pexp_desc = Pexp_tuple [sp]} -> Some sp
             | _ -> args in
         super.expr mapper
         {pexp_desc=Pexp_construct(lid, new_args); pexp_loc; pexp_attributes=
          normalized_attributes "explicit_arity" pexp_attributes}
      | x -> super.expr mapper x
  end;
  pat = begin fun mapper pattern ->
    match pattern with
      | {ppat_desc=Ppat_construct(lid, args);
         ppat_loc;
         ppat_attributes} when attributes_conflicted "implicit_arity" "explicit_arity" ppat_attributes ->
         let new_args =
           match args with
             | Some {ppat_desc = Ppat_tuple [sp]} -> Some sp
             | _ -> args in
         super.pat mapper
         {ppat_desc=Ppat_construct(lid, new_args); ppat_loc; ppat_attributes=
          normalized_attributes "explicit_arity" ppat_attributes}
      | x -> super.pat mapper x
  end;
}

let reason_mapper =
  default_mapper
  |> reason_to_ml_swap_operator_mapper
  |> arity_conflict_resolving_mapper

let rewriteFunctorApp module_name elt loc =
  let rec applies = function
    | Lident _ -> false
    | Ldot (m, _) -> applies m
    | Lapply (_, _) -> true in
  let rec flattenModName = function
    | Lident id -> id
    | Ldot (m, id) -> flattenModName m ^ "." ^ id
    | Lapply (m1, m2) -> flattenModName m1 ^ "(" ^ flattenModName m2 ^ ")" in
  let rec mkModExp = function
    | Lident id -> mkmod ~loc (Pmod_ident {txt=Lident id; loc})
    | Ldot (m, id) -> mkmod ~loc (Pmod_ident {txt=Ldot (m, id); loc})
    | Lapply (m1, m2) -> mkmod ~loc (Pmod_apply (mkModExp m1, mkModExp m2)) in
  if applies module_name then
    let flat = flattenModName module_name in
    mkexp ~loc (Pexp_letmodule({txt=flat; loc},
                         mkModExp module_name,
                         mkexp(Pexp_ident {txt=Ldot (Lident flat, elt); loc})))
  else
    mkexp ~loc (Pexp_ident {txt=Ldot (module_name, elt); loc})

let jsx_component module_name attrs children loc =
  let rec getFirstPart = function
    | Lident fp -> fp
    | Ldot (fp, _) -> getFirstPart fp
    | Lapply (fp, _) -> getFirstPart fp in
  let firstPart = getFirstPart module_name.txt in
  let element_fn = if String.get firstPart 0 != '_' && firstPart = String.capitalize_ascii firstPart then
    (* firstPart will be non-empty so the 0th access is fine. Modules can't start with underscore *)
    rewriteFunctorApp module_name.txt "createElement" module_name.loc
  else
    mkexp ~loc:module_name.loc (Pexp_ident(mkloc (Lident firstPart) module_name.loc))
  in
  let body = mkexp(Pexp_apply(element_fn, attrs @ children)) ~loc in
  let attribute = ({txt = "JSX"; loc = loc}, PStr []) in
  { body with pexp_attributes = attribute :: body.pexp_attributes }

let rec ignoreLapply = function
  | Lident id -> Lident id
  | Ldot (lid, id) -> Ldot (ignoreLapply lid, id)
  | Lapply (m1, _) -> ignoreLapply m1

(* Like Longident.flatten, but ignores `Lapply`s. Useful because 1) we don't want to require `Lapply` in
   closing tags, and 2) Longident.flatten doesn't support `Lapply`. *)
let rec flattenWithoutLapply = function
  | Lident id -> [id]
  | Ldot (lid, id) -> flattenWithoutLapply lid @ [id]
  | Lapply (m1, _) -> flattenWithoutLapply m1

let ensureTagsAreEqual startTag endTag loc =
  if ignoreLapply startTag <> endTag then
    let startTag = String.concat "" (flattenWithoutLapply startTag) in
    let endTag = String.concat "" (flattenWithoutLapply endTag) in
    if endTag <> "" then
    Printf.ksprintf (syntax_error loc)
      "Start tag <%s> does not match end tag </%s>" startTag endTag

(* `{. "foo": bar}` -> `Js.t {. foo: bar}` and {.. "foo": bar} -> `Js.t {.. foo: bar} *)
let mkBsObjTypeSugar ~loc ~closed rows =
  let obj = mktyp ~loc (Ptyp_object (rows, closed)) in
  let jsDotTCtor = { txt = Longident.Ldot (Longident.Lident "Js", "t"); loc } in
  mktyp(Ptyp_constr(jsDotTCtor, [obj]))

let doc_loc loc = {txt = "ocaml.doc"; loc = loc}

let doc_attr text loc =
  let open Parsetree in
  let exp =
    { pexp_desc = Pexp_constant (Pconst_string(text, None));
      pexp_loc = loc;
      pexp_attributes = []; }
  in
  let item =
    { pstr_desc = Pstr_eval (exp, []); pstr_loc = exp.pexp_loc }
  in
    (doc_loc loc, PStr [item])

let prepend_attrs_to_labels attrs = function
  | [] -> [] (* not possible for valid inputs *)
  | x :: xs -> {x with pld_attributes = attrs @ x.pld_attributes} :: xs

let raise_record_trailing_semi_error loc =
  syntax_error_exp loc
    "Record entries are separated by comma; \
     we've found a semicolon instead."

let raise_record_trailing_semi_error' loc =
  (Some (raise_record_trailing_semi_error loc), [])

let record_exp_spread_msg =
  "Records can only have one `...` spread, at the beginning.
Explanation: since records have a known, fixed shape, a spread like `{a, ...b}` wouldn't make sense, as `b` would override every field of `a` anyway."

let record_pat_spread_msg =
  "Record's `...` spread is not supported in pattern matches.
Explanation: you can't collect a subset of a record's field into its own record, since a record needs an explicit declaration and that subset wouldn't have one.
Solution: you need to pull out each field you want explicitly."

let lowercase_module_msg =
  "Module names must start with an uppercase letter."

(* Handles "over"-parsing of spread syntax with `opt_spread`.
 * The grammar allows a spread operator at every position, when
 * generating the parsetree we raise a helpful error message. *)
let filter_raise_spread_syntax msg nodes =
  List.map (fun (dotdotdot, node) ->
      begin match dotdotdot with
        | Some dotdotdotLoc -> syntax_error dotdotdotLoc msg
        | None -> ()
      end;
      node
    ) nodes

(*
 * See https://github.com/ocaml/ocaml/commit/e1e03820e5fea322aa3156721bc1cc0231668101
 * Rely on the parsing rules for generic module types, and then
 * extract a package type, enabling more explicit error messages
 * *)
let package_type_of_module_type pmty =
  let map_cstr = function
    | Pwith_type (lid, ptyp) ->
        let loc = ptyp.ptype_loc in
        if ptyp.ptype_params <> [] then
          syntax_error loc "parametrized types are not supported";
        if ptyp.ptype_cstrs <> [] then
          syntax_error loc "constrained types are not supported";
        if ptyp.ptype_private <> Public then
          syntax_error loc "private types are not supported";

        (* restrictions below are checked by the 'with_constraint' rule *)
        assert (ptyp.ptype_kind = Ptype_abstract);
        assert (ptyp.ptype_attributes = []);
        let ty =
          match ptyp.ptype_manifest with
          | Some ty -> ty
          | None -> assert false
        in
        [lid, ty]
    | _ ->
       syntax_error pmty.pmty_loc "only 'with type t =' constraints are supported";
       []
  in
  match pmty with
  | {pmty_desc = Pmty_ident lid} -> Some (lid, [])
  | {pmty_desc = Pmty_with({pmty_desc = Pmty_ident lid}, cstrs)} ->
    Some (lid, List.flatten (List.map map_cstr cstrs))
  | _ -> None

let add_brace_attr expr =
  let label = Location.mknoloc "reason.preserve_braces" in
  let payload = PStr [] in
  {expr with pexp_attributes= (label, payload) :: expr.pexp_attributes }


# 1200 "src/reason-parser/reason_parser.ml"

module Tables = struct
  
  include MenhirBasics
  
  let token2terminal : token -> int =
    fun _tok ->
      match _tok with
      | AMPERAMPER ->
          125
      | AMPERSAND ->
          124
      | AND ->
          123
      | AS ->
          122
      | ASSERT ->
          121
      | BACKQUOTE ->
          120
      | BANG ->
          119
      | BAR ->
          118
      | BARBAR ->
          117
      | BARRBRACKET ->
          116
      | BEGIN ->
          115
      | CHAR _ ->
          114
      | CLASS ->
          113
      | COLON ->
          112
      | COLONCOLON ->
          111
      | COLONEQUAL ->
          110
      | COLONGREATER ->
          109
      | COMMA ->
          108
      | COMMENT _ ->
          107
      | CONSTRAINT ->
          106
      | DO ->
          105
      | DOCSTRING _ ->
          104
      | DONE ->
          103
      | DOT ->
          102
      | DOTDOT ->
          101
      | DOTDOTDOT ->
          100
      | DOWNTO ->
          99
      | ELSE ->
          98
      | END ->
          97
      | EOF ->
          96
      | EOL ->
          95
      | EQUAL ->
          94
      | EQUALGREATER ->
          93
      | ES6_FUN ->
          92
      | EXCEPTION ->
          91
      | EXTERNAL ->
          90
      | FALSE ->
          89
      | FLOAT _ ->
          88
      | FOR ->
          87
      | FUN ->
          86
      | FUNCTION ->
          85
      | FUNCTOR ->
          84
      | GREATER ->
          83
      | GREATERDOTDOTDOT ->
          82
      | GREATERRBRACE ->
          81
      | IF ->
          80
      | IN ->
          79
      | INCLUDE ->
          78
      | INFIXOP0 _ ->
          77
      | INFIXOP1 _ ->
          76
      | INFIXOP2 _ ->
          75
      | INFIXOP3 _ ->
          74
      | INFIXOP4 _ ->
          73
      | INHERIT ->
          72
      | INITIALIZER ->
          71
      | INT _ ->
          70
      | LAZY ->
          69
      | LBRACE ->
          68
      | LBRACELESS ->
          67
      | LBRACKET ->
          66
      | LBRACKETAT ->
          65
      | LBRACKETBAR ->
          64
      | LBRACKETGREATER ->
          63
      | LBRACKETLESS ->
          62
      | LBRACKETPERCENT ->
          61
      | LBRACKETPERCENTPERCENT ->
          60
      | LESS ->
          59
      | LESSDOTDOTGREATER ->
          58
      | LESSGREATER ->
          57
      | LESSIDENT _ ->
          56
      | LESSSLASHGREATER ->
          55
      | LESSSLASHIDENTGREATER _ ->
          54
      | LET ->
          53
      | LIDENT _ ->
          52
      | LPAREN ->
          51
      | MINUS ->
          50
      | MINUSDOT ->
          49
      | MINUSGREATER ->
          48
      | MODULE ->
          47
      | MUTABLE ->
          46
      | NATIVEINT _ ->
          45
      | NEW ->
          44
      | NONREC ->
          43
      | OBJECT ->
          42
      | OF ->
          41
      | OPEN ->
          40
      | OR ->
          39
      | PERCENT ->
          38
      | PLUS ->
          37
      | PLUSDOT ->
          36
      | PLUSEQ ->
          35
      | POSTFIXOP _ ->
          34
      | PREFIXOP _ ->
          33
      | PRI ->
          32
      | PUB ->
          31
      | QUESTION ->
          30
      | QUOTE ->
          29
      | RBRACE ->
          28
      | RBRACKET ->
          27
      | REC ->
          26
      | RPAREN ->
          25
      | SEMI ->
          24
      | SEMISEMI ->
          23
      | SHARP ->
          22
      | SHARPEQUAL ->
          21
      | SHARPOP _ ->
          20
      | SIG ->
          19
      | SLASHGREATER ->
          18
      | STAR ->
          17
      | STRING _ ->
          16
      | STRUCT ->
          15
      | SWITCH ->
          14
      | THEN ->
          13
      | TILDE ->
          12
      | TO ->
          11
      | TRUE ->
          10
      | TRY ->
          9
      | TYPE ->
          8
      | UIDENT _ ->
          7
      | UNDERSCORE ->
          6
      | VAL ->
          5
      | VIRTUAL ->
          4
      | WHEN ->
          3
      | WHILE ->
          2
      | WITH ->
          1
  
  and error_terminal =
    0
  
  and token2value : token -> Obj.t =
    fun _tok ->
      match _tok with
      | AMPERAMPER ->
          Obj.repr ()
      | AMPERSAND ->
          Obj.repr ()
      | AND ->
          Obj.repr ()
      | AS ->
          Obj.repr ()
      | ASSERT ->
          Obj.repr ()
      | BACKQUOTE ->
          Obj.repr ()
      | BANG ->
          Obj.repr ()
      | BAR ->
          Obj.repr ()
      | BARBAR ->
          Obj.repr ()
      | BARRBRACKET ->
          Obj.repr ()
      | BEGIN ->
          Obj.repr ()
      | CHAR _v ->
          Obj.repr _v
      | CLASS ->
          Obj.repr ()
      | COLON ->
          Obj.repr ()
      | COLONCOLON ->
          Obj.repr ()
      | COLONEQUAL ->
          Obj.repr ()
      | COLONGREATER ->
          Obj.repr ()
      | COMMA ->
          Obj.repr ()
      | COMMENT _v ->
          Obj.repr _v
      | CONSTRAINT ->
          Obj.repr ()
      | DO ->
          Obj.repr ()
      | DOCSTRING _v ->
          Obj.repr _v
      | DONE ->
          Obj.repr ()
      | DOT ->
          Obj.repr ()
      | DOTDOT ->
          Obj.repr ()
      | DOTDOTDOT ->
          Obj.repr ()
      | DOWNTO ->
          Obj.repr ()
      | ELSE ->
          Obj.repr ()
      | END ->
          Obj.repr ()
      | EOF ->
          Obj.repr ()
      | EOL ->
          Obj.repr ()
      | EQUAL ->
          Obj.repr ()
      | EQUALGREATER ->
          Obj.repr ()
      | ES6_FUN ->
          Obj.repr ()
      | EXCEPTION ->
          Obj.repr ()
      | EXTERNAL ->
          Obj.repr ()
      | FALSE ->
          Obj.repr ()
      | FLOAT _v ->
          Obj.repr _v
      | FOR ->
          Obj.repr ()
      | FUN ->
          Obj.repr ()
      | FUNCTION ->
          Obj.repr ()
      | FUNCTOR ->
          Obj.repr ()
      | GREATER ->
          Obj.repr ()
      | GREATERDOTDOTDOT ->
          Obj.repr ()
      | GREATERRBRACE ->
          Obj.repr ()
      | IF ->
          Obj.repr ()
      | IN ->
          Obj.repr ()
      | INCLUDE ->
          Obj.repr ()
      | INFIXOP0 _v ->
          Obj.repr _v
      | INFIXOP1 _v ->
          Obj.repr _v
      | INFIXOP2 _v ->
          Obj.repr _v
      | INFIXOP3 _v ->
          Obj.repr _v
      | INFIXOP4 _v ->
          Obj.repr _v
      | INHERIT ->
          Obj.repr ()
      | INITIALIZER ->
          Obj.repr ()
      | INT _v ->
          Obj.repr _v
      | LAZY ->
          Obj.repr ()
      | LBRACE ->
          Obj.repr ()
      | LBRACELESS ->
          Obj.repr ()
      | LBRACKET ->
          Obj.repr ()
      | LBRACKETAT ->
          Obj.repr ()
      | LBRACKETBAR ->
          Obj.repr ()
      | LBRACKETGREATER ->
          Obj.repr ()
      | LBRACKETLESS ->
          Obj.repr ()
      | LBRACKETPERCENT ->
          Obj.repr ()
      | LBRACKETPERCENTPERCENT ->
          Obj.repr ()
      | LESS ->
          Obj.repr ()
      | LESSDOTDOTGREATER ->
          Obj.repr ()
      | LESSGREATER ->
          Obj.repr ()
      | LESSIDENT _v ->
          Obj.repr _v
      | LESSSLASHGREATER ->
          Obj.repr ()
      | LESSSLASHIDENTGREATER _v ->
          Obj.repr _v
      | LET ->
          Obj.repr ()
      | LIDENT _v ->
          Obj.repr _v
      | LPAREN ->
          Obj.repr ()
      | MINUS ->
          Obj.repr ()
      | MINUSDOT ->
          Obj.repr ()
      | MINUSGREATER ->
          Obj.repr ()
      | MODULE ->
          Obj.repr ()
      | MUTABLE ->
          Obj.repr ()
      | NATIVEINT _v ->
          Obj.repr _v
      | NEW ->
          Obj.repr ()
      | NONREC ->
          Obj.repr ()
      | OBJECT ->
          Obj.repr ()
      | OF ->
          Obj.repr ()
      | OPEN ->
          Obj.repr ()
      | OR ->
          Obj.repr ()
      | PERCENT ->
          Obj.repr ()
      | PLUS ->
          Obj.repr ()
      | PLUSDOT ->
          Obj.repr ()
      | PLUSEQ ->
          Obj.repr ()
      | POSTFIXOP _v ->
          Obj.repr _v
      | PREFIXOP _v ->
          Obj.repr _v
      | PRI ->
          Obj.repr ()
      | PUB ->
          Obj.repr ()
      | QUESTION ->
          Obj.repr ()
      | QUOTE ->
          Obj.repr ()
      | RBRACE ->
          Obj.repr ()
      | RBRACKET ->
          Obj.repr ()
      | REC ->
          Obj.repr ()
      | RPAREN ->
          Obj.repr ()
      | SEMI ->
          Obj.repr ()
      | SEMISEMI ->
          Obj.repr ()
      | SHARP ->
          Obj.repr ()
      | SHARPEQUAL ->
          Obj.repr ()
      | SHARPOP _v ->
          Obj.repr _v
      | SIG ->
          Obj.repr ()
      | SLASHGREATER ->
          Obj.repr ()
      | STAR ->
          Obj.repr ()
      | STRING _v ->
          Obj.repr _v
      | STRUCT ->
          Obj.repr ()
      | SWITCH ->
          Obj.repr ()
      | THEN ->
          Obj.repr ()
      | TILDE ->
          Obj.repr ()
      | TO ->
          Obj.repr ()
      | TRUE ->
          Obj.repr ()
      | TRY ->
          Obj.repr ()
      | TYPE ->
          Obj.repr ()
      | UIDENT _v ->
          Obj.repr _v
      | UNDERSCORE ->
          Obj.repr ()
      | VAL ->
          Obj.repr ()
      | VIRTUAL ->
          Obj.repr ()
      | WHEN ->
          Obj.repr ()
      | WHILE ->
          Obj.repr ()
      | WITH ->
          Obj.repr ()
  
  and default_reduction =
    (16, "\000\000\000\000\000\000\003\201\003\200\003\199\003\198\003\197\003\153\003\196\003\195\003\194\003\193\003\192\003\179\003\191\003\190\003\189\003\188\003\187\003\186\003\185\003\184\003\183\003\182\003\181\003\180\003\152\003\178\003\177\003\176\003\175\003\174\003\173\003\172\003\171\003\170\003\169\003\168\003\167\003\166\003\165\003\164\003\163\003\162\003\161\003\160\003\159\003\158\003\157\003\156\003\155\003\154\000\000\000\000\000#\001;\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\016\000\000\000\000\000\000\0002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\225\000\000\000\000\000\000\001\224\000\000\001\223\000\000\000\000\000\000\000\000\001\229\000n\000\000\000\000\001\230\000o\000\000\000\000\000\000\0016\0017\0000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0028\000\000\000\000\000\000\000\209\000\000\000\208\000\000\000\211\000\000\000\210\000\000\000\213\000\000\000\212\000\000\001\158\001\207\000\000\000\000\001\208\004\030\004 \000\000\000\000\000\000\000\000\004\012\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\147\000\000\000\000\003n\000\000\000\000\000\000\004V\000\000\000\000\000\000\000\000\001E\000\000\000\000\000\000\000\000\003$\000\000\000\000\000\000\000\000\000\000\000\000\003N\000\000\002W\002Q\000\150\000\000\000\000\000\000\001G\000\000\000\000\001I\000\000\000\000\002o\002k\000\000\000\r\000\012\003\248\003\247\000\000\002K\002_\000\000\000\000\002`\002Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\017\000\000\000\000\000\000\000\000\000\149\000\000\001\020\000\000\003-\000\000\000\000\000\000\000\000\000\144\000\146\000\151\000\145\000\000\000\000\000\000\002\026\000\000\000\000\000\000\003\r\004X\003.\003\016\000\000\000\000\000\000\000\000\000\000\003y\003x\003/\0037\003V\003'\003:\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003[\000\000\000\000\003\\\000\000\003^\003W\000\000\000\000\003q\000\000\001=\0014\000\000\0015\000\000\000\000\003Q\0039\003U\000\000\003w\003v\0038\000\000\000\000\003\022\000\000\003)\000\000\000\000\001S\000\000\001Y\000\000\000\000\002J\002T\002S\002V\002U\000\000\002a\002X\002R\002P\002O\002N\002M\002c\000\000\002b\002^\002[\002L\002\\\002]\000\000\004W\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\222\000\000\000\000\000\000\000\000\000\000\002C\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0026\000\000\000\000\002m\000\000\000\000\000\000\000\000\000%\000\178\002\024\000\000\000.\000\000\000\000\002\145\001c\0004\000\000\000\179\002\022\004$\000\000\000\000\004\r\000\000\000\000\0008\000 \000\000\000\000\000!\000\000\002 \004%\000\000\000\000\000\000\000\177\002\184\000\027\000\000\001\209\000\000\000\000\000\000\001\210\000\000\000\030\000\000\000\000\000\031\003\212\000\000\000\000\002\181\002\180\000\000\000\000\002@\000\000\002E\001\203\001\154\001\185\000\000\000\000\000\000\003\213\000\000\000\000\002A\000\000\000\000\001\204\000\000\003\214\000\000\000\000\001\186\000\000\002B\000\000\002G\000\000\000\000\002D\000\000\002F\000\000\000\000\000\000\000:\000\000\003\249\000\000\000\000\002\215\002\210\000,\000\000\000\000\000\000\000\000\003\250\002\020\002\211\002\023\000\000\002\021\000\000\0005\000\000\000\000\000\000\000-\002\212\000\000\001\136\000\000\000\000\002\213\000\000\001\199\000\000\000\000\000\000\000\000\002\209\000\000\000\000\000\000\002\208\000\000\000\000\001\200\000\000\002\187\000\000\000\157\000\000\000\000\001\170\000\159\001\169\000\000\000\158\000\156\000\000\000\000\002\129\0013\000\155\001\025\002y\000\000\001\030\000\000\000\000\001\027\000\000\000\000\001\026\000\000\001\029\000\000\001\028\000\000\000\000\000\000\002.\000\000\000\000\000\000\000\000\0020\000\000\002/\000\000\002-\000)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\134\000\000\001\133\001\132\000\000\001\131\000(\002\229\000\000\000\000\000\000\000\000\000\153\000\000\0024\000\000\000\000\004\031\000\000\000\000\004\003\000\025\000\000\000\000\000\000\000\026\004\t\004\b\004\n\000\000\000\000\000\000\000\000\000\000\000\000\002\230\000\000\002\149\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\004\003|\003{\000\000\000\000\000\000\001N\000\000\000\000\001O\000\000\000\000\000\000\000\000\000\000\004d\000\000\004e\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\167\000\000\000\000\001\168\000\000\000\000\000\000\002\014\002\r\000\000\000\000\000\000\003}\000\000\002\006\002\011\002\253\000\000\002e\000\000\000\000\002\236\000\000\000\000\000\000\003\133\000\000\003\138\000\000\003\011\003\012\000\000\003\t\003\n\000\000\000\000\000\000\000\000\003\140\000\000\002s\000\000\002\164\000\000\000\000\000\000\000\000\000\000\000\000\003\144\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\n\000\011\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\137\003\132\003\141\003\127\003~\002\168\000\000\000\000\003\135\003\b\000\000\000\000\000\000\003\151\002\165\000\000\000\000\000\000\003\142\000\000\000\000\000\000\000\000\001\195\000\000\000\000\002\163\000\000\002\158\000\000\002\173\000\000\000\000\001\196\000\000\002\161\000\000\000\000\001\164\000\000\003\131\000\000\000\000\003\130\000\000\000\000\003\129\002\160\002\167\000\000\003\128\000\000\002\166\000\000\003\149\000\000\000\000\003\148\000\000\003\150\000\000\003\147\000\000\000\000\003\146\003\136\002\171\000\000\000\000\003\139\002\172\000\000\000\000\001f\000\000\003\143\000\000\002\159\000\000\000\000\003\145\000\000\000\000\000\000\000\000\000\000\000\000\002\170\000\000\000\000\000\000\000\000\000\000\000\000\001`\000\000\000\000\000\000\001a\001b\000\000\000\000\001^\000\000\000\000\000\000\000\000\000\000\000\000\000\227\000\000\000\223\000\000\000\225\001_\000\000\000\000\001\178\000\000\000\226\001\177\000\000\000\000\000\224\000\228\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003&\000\000\000\000\000\000\000\000\000\000\000\183\000\182\001\245\000\000\000\000\001\233\000\000\000\000\000\000\001\231\001\250\001\181\000\000\001\232\000\000\000\000\000\000\001\182\001\248\000\000\000\000\000\000\000\000\000\000\001/\000\000\000\000\000\000\000\000\000\000\000\000\002\005\000\000\000\000\000\000\000\000\000\000\000\000\0011\001\183\000\000\000\000\001\184\000\000\0012\000\000\0010\000\000\000\000\000\000\000\000\003z\002\137\000\000\000\000\000\000\001\234\000\000\000\000\003*\000\000\000\000\000\000\000\000\003\015\003+\001\n\000\000\003\014\000\000\001\019\000\000\001\t\000\000\000\000\001\174\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\023\001\021\001\173\000\000\003\023\000\000\000\000\001H\000\000\003 \000\000\001K\000\000\000\000\001L\000\000\000\000\000\000\003P\003@\000\000\003S\001M\000\000\000\000\003D\000\000\000\000\000\000\003E\000\000\000\000\000\000\000\000\000\000\003F\000\000\003B\000\000\000\000\003\031\000\000\003!\000\000\003\"\000\000\000\000\000\000\001\176\000\000\003%\001\175\000\000\000\000\003\209\000\000\000\000\000\000\002\204\003\025\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\190\000\000\000\000\000\000\000\000\003\208\002\203\001\201\000\000\000\000\000\000\000\000\000\000\002\191\000\000\000\000\000\000\000\000\000\000\002\188\000\000\002\192\002\189\000\000\000\000\001\202\003\211\000\000\002\205\000\000\003\030\000\000\003\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\201\002\197\000\000\002\202\002\198\000\000\000\000\002\194\000\000\000\000\000\000\000\000\000\000\000\000\002\199\002\195\000\000\002\200\002\196\002\193\004Y\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001P\003,\001\b\000\000\003\026\000\000\000\000\000\000\003\027\000\000\000\000\000\000\003\028\003\024\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\180\000\181\000\000\000\000\000\000\000\000\002\147\000\000\000\000\000\000\002\133\000\000\000\000\000\000\001+\000\199\000\000\000\000\000\000\001-\000\000\000\000\000\000\000\000\001.\000\000\000\000\000\000\000\000\001,\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\139\000\000\001\140\000\230\000\000\000\000\000\000\002u\000\000\000\000\003\235\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0041\000\000\003\021\000\000\000\000\000\000\000\000\000\000\002\186\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001'\000\197\000\000\000\000\000\000\001)\000\000\000\000\000\000\000\000\001*\000\000\000\000\000\000\000\000\001(\000\000\000\000\000\000\002\028\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\139\003\255\000\000\000\000\000\000\001j\000\000\000\000\000\000\001g\002{\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\151\000\000\000\000\001\139\000\000\004'\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\224\000\000\000\000\002\030\003\222\002\182\000\000\000\000\000\000\000\000\001\031\000\000\000\000\001$\000\000\000\000\000\000\001!\000\000\000\000\000\000\001 \000\000\000\000\001#\000\000\000\000\001\"\000\189\000\188\003\202\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\240\000\000\002\238\000\000\002\227\000\000\004b\000\000\000\000\000\000\000\000\004\"\004#\000\000\000\000\004\029\004\027\001\205\000\000\000\000\001\206\000\000\001\148\000\000\000\000\000\000\000\000\002\018\000\000\002\019\000y\000\000\000\000\000\000\004`\002w\000\000\000\000\000\000\000\000\000}\000\000\000\000\000\000\000\000\000{\000\000\000\142\000\000\000\000\000\143\000m\000\000\000\000\000\000\000\136\000\000\001\156\000j\000l\000w\000\000\000k\000\000\000\000\000\000\000\000\000\154\000\127\000\000\000q\000u\000\000\000\000\000z\000\000\000\000\000\000\000\000\000~\000\000\000\000\000\000\000\000\000|\000\000\000x\000\000\000\128\000\130\000\000\000\000\000\129\001\216\000v\001\215\000t\000\000\000\138\000\000\000\000\000s\000\000\000\137\000\000\000\194\000\139\000\195\000\000\000\000\000\018\000\000\000\000\000\019\000\140\000\000\001u\000\000\000\000\000\000\000\000\000A\000N\000\000\000\000\000B\000\000\000\000\000\016\000\000\000\000\000\017\000O\000\000\001s\002\242\000\000\000\000\003\006\002\235\002\243\002\244\000\000\000\000\000\000\002\245\000\000\000\000\000\000\002\t\001\243\001\150\000\000\000\000\000\000\000\000\000\022\000\000\000\000\000\000\000\023\002\249\000\000\001|\000\000\002h\000\000\002f\002g\002i\002\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\231\004\011\000\000\000\000\000\000\000\000\000\000\000\000\002\232\000\000\000\000\000\000\000\000\000\000\000\000\002\254\000\000\000\000\000\000\002\237\000\000\000\000\000\000\000\000\000\000\000\000\002\241\000\000\002\239\000\000\002\228\000\000\000\000\000\000\000\141\000\000\000P\000\000\000\000\000\000\002\246\000\000\000\000\002\250\003\005\003\004\003\003\003\002\002\175\000\000\002\176\000\000\000\000\000\000\000\000\000\000\000\000\002\127\000\000\000\000\000\184\000\185\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\166\000X\000Y\000\000\000\000\000\000\000\000\000\000\000V\000\132\000R\000\000\000W\000\000\000\000\000\000\000T\000\000\000\000\000\000\000\000\000U\000\000\000\000\000\000\000\000\000S\000\000\000\000\002}\000]\000\000\000c\002<\002;\000\\\000\000\000\000\000`\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001h\000\000\000\000\000\000\000\000\000\000\000^\000\000\000d\000h\000\000\000\000\000\000\000\000\000\000\001\219\000\000\000\000\000\000\000\000\000\000\000\000\001\222\002\135\000\000\001\221\001\220\000b\000\000\000\000\000\000\000g\000\000\000a\001\214\002=\000\000\000\000\000\000\000\000\000\000\002:\001\213\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001x\001w\001o\000[\000Z\000\000\000\000\000\133\000\000\000\135\000\000\000\000\000\134\000\000\000\193\000\000\000\192\000C\000E\000\000\000\000\000\000\000\000\000G\000\000\000\000\000\000\000H\000\000\000\000\000\000\000\000\000\000\000J\000\000\000\000\000L\000\000\000\000\000\000\000M\000\000\000\000\000\000\000K\000I\000\000\000\000\000\000\000F\000D\000\000\000\000\000\014\000\000\000\000\000\015\003\238\000\000\001q\000\000\004K\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\226\000\000\004I\000\000\000\000\003\217\003\227\003\228\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\229\000\000\000\000\000\000\000\000\000\000\001\253\001\236\001\235\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\021\003\231\000\000\001z\003\237\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002&\000\000\000\000\000\000\000\000\002(\000\000\002'\000\000\002%\000'\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\129\000\000\001\128\001\127\000\000\001~\000&\003\206\000\000\000\000\000\000\000\000\000\000\000\000\003\207\000\000\000\000\000\000\000\000\003\236\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\225\000\000\003\223\000\000\003\203\000\000\000\000\003\239\000\000\000\000\003\230\000\000\000\000\003\232\000\000\003\221\003\245\000\000\003\220\003\243\003\240\000\000\004J\003\244\002\174\000\000\000\000\000\000\000\000\001:\000\000\002\012\004\001\002\143\001\146\000\000\000\000\000\000\000\190\000\000\000\000\000\000\001X\001[\001W\001Z\000\000\001V\000\191\001U\001\211\001T\000\000\001Q\000\000\000\000\000\000\001\212\000\000\001R\000\000\001\138\000\000\001>\000\000\000\000\001?\000\000\000\000\000\000\003p\003`\000\000\003s\000\000\000\000\003d\000\000\000\000\000\000\000\000\000\000\002d\000\000\000\000\000\000\002\216\002\224\000\000\000\000\000\000\000\000\000\000\002\222\000\000\000\000\000\000\002\221\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\223\000\000\000\000\002\225\000\000\002\217\000\000\000\000\002\219\000\000\000\000\002\218\000\000\002\220\002\226\001\218\001\141\000\000\004+\001\142\000\000\000\000\000\000\003e\000\000\000\000\000\000\003f\003b\003Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003t\000\000\003a\000\000\000\000\003j\000\000\000\000\003i\000\000\003k\000\000\003l\000\000\000\000\000\000\003o\000\000\003c\000\000\003h\000\000\003g\003Y\003u\003]\003X\000\000\001\254\000\000\000\000\000\000\003T\000\000\003A\000\000\000\000\003J\000\000\000\000\003I\000\000\003K\000\000\003L\000\000\000\000\000\000\003O\000\000\003C\000\000\003H\000\000\003G\000\000\000\000\000\000\000\000\002\025\000\000\000\000\0034\000\000\000\000\0033\001\188\000\000\003\018\000\000\000\000\000\000\000\000\001\242\000\000\000\000\000\000\000\000\000\000\001\241\001\247\000\000\001\246\000\000\0035\000\000\000\000\0036\000\000\000\000\000\000\000\000\000\000\000\000\000\240\001\187\000\000\003;\000\000\000\000\003<\000\000\001J\000\000\0031\000\000\0032\000\000\0030\000\000\000\000\003?\000\000\000\000\001<\000\000\000\000\001\141\000\000\000\234\000\000\001A\000\000\001C\001D\001B\001F\000\000\000\000\001\141\000\000\000\235\000\000\003_\000\000\000\000\000\000\001\141\000\000\004,\000\000\000$\001\162\000\000\0006\000\000\000\000\000\000\000\000\0022\001\160\000\000\0007\000\000\000\160\000\000\000\165\000\000\000\000\000\000\000\162\001\197\000\000\000\000\001\198\000\000\004\028\000\000\000\000\000\161\000\000\000\164\000\000\000\163\000\000\000\000\000\000\000\000\000\000\000\000\000\166\000\000\000\171\000\000\000\000\000\168\000\000\000\000\000\167\000\000\000\170\000\000\000\169\000*\004\019\000\000\000\000\000\000\000\000\000\000\000+\004\020\000\000\000\000\000\175\000\000\000\172\000\000\000\173\000\174\004\016\004\005\000\186\000\187\004\021\004\017\000\000\004\018\000\000\000\000\000\000\000\000\004\025\000\000\004\026\004\007\004\022\004\023\000\000\004\024\004\006\004\004\004\002\000\000\000\000\000\000\000\000\003\204\000\000\000\000\000\000\000\000\000\000\000\000\003\205\000\000\001\024\000\000\002\183\000/\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000_\000\000\000\000\000\000\000\000\000\000\000=\000\000\000\000\000<\000\000\000;\000\000\000?\000\000\000>\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\152\000\000\002\153\000\000\000\000\000\000\0018\000\001\000\000\000\000\0019\000\002\000\000\000\003\000\000\002\154\000\000\000\004\000\000\002\155\000\000\000\000\002\156\000\005\000\000\000\000\000\000\000\220\000\215\000\216\000\219\000\217\000\000\003\253\000\200\000\006\000\000\000\202\000\000\000\201\003\254\000\000\000\203\004T\000\007\000\000\000\000\000\205\000\000\000\000\000\204\004U\000\206\000\207")
  
  and error =
    (126, "!\226\128\000N\137|\222\254\002\131\248\128\128a\192\000\000\000\000\b\000@\000 \000\000\000\000\000\000\007\223q\002\b\031\176\192\000X8\247\007\022\005\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\143\138\b\201:%\243{\248\n\015\224\n\003\143\007\223q\002\b\031\176\192\000X8\247\007\022\005\007\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000 \000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128(\002\028\000\000\000\000\000\128\004\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\b\000\000\000\000\000\000\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\240\128\000\000\000\000 \128\000\000\000\000\000\000\000\016\000\000\000\000\000\000\130\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000H\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\131h\000\000`\001 \128\192\n\n0 @\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\130\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\131h\000\000`\001 \128\192\n\n0 @\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\b6\128\000\006\000\018\b\012\000\160\163\002\004\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\002\b\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\194\000\129\000\000F\001\218\000\000\002\000 \000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\0006\000\000\004\000\018\000\004\001\160+\002\140\003\b\002\004\000\001\024\007h\000\000\b\000\128\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\004\000\000\r\128\000\001\000\004\128\000\000h(\192\129\000\192\000\016\000\000F\001\018\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\007\223q\002\b\031\176\192\000X8\247\007\022\005\007\bx\160\004\147\162_7\191\128\160\254\000 8p\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000&\000\000\004\000\016\000\000\000\160\168\000\004\003\000\000\004\004\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\002\000\000D\004\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\002\128\160\000\016\012\160\b\018\000\000`\029\160\000\001 \018\004\b\000\000\000\t\128\000\001\000\004\128\000\000\b*\b!\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012\000\b\016\000\000`\029\160\000\000\000\002\000\n\0000\000!@\000\001\128v\128\000\000\000\b\000(\031}\196\b ~\195\000\001`\227\220\028X\020\028!\226\128\018N\137|\222\254\002\131\248\000\128\225\192\004\130\000\001\b cZ\232\000\003\000\000\000\130\000\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\224@\127\tx\246\254|\179\200\000\130%\204\004\130\000\001\b cZ\232\000\003\000\000\000\130\000\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \002\000\000\b\000\000 0\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\002\000 \000\000\128\000\002\003\000\000\000\000\000\000\000\b\000\128\000\002\000\000\b\012\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\130\000\t\000 cZ\232\000\003\000\000\000\130\000\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\000H \000\016\002\0065\174\128\0000\000\000\b \001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\022.\004\007\240\151\143o\231\203<\128\b\"\\\192H \000\016\130\0065\174\128\0000\000\000\b \001 \128\000@\b\024\214\186\000\000\192\000\000 \128\004\130\000\001\000 gZ\232\000\003\000\000\000\130\000\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\139\129\001\252%\227\219\249\242\207 \002\b\1510\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\130\001\001\000 cZ\232\000\003\000\000\000\130\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\128\000\002\000\000\b\012\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000@\000\000\000\000\000\000\002\000 \000\000\128\000\002\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001 \128\000@\b\025\214\186\000\000\192\000\000 \128\133\138\000\0010!\227[\248\002\015 \" \167\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\139\129\001\252%\227\219\249\242\207 \002\012\1510\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128@L\bx\214\254\000\131\200\000\128!\192\133\138\001\0010!\227[\248\002\015 \002\000\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\016\004H\000\002\b\000\128\000\000\020\000\001\000\000\000@\017 \000\b \002\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\031\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255!b\128\000L\bx\214\254\000\131\200\000\128!\192\133\138\000\0010!\227[\248\002\015 \" \167\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\b\000\133\138\000A0!\227[\248\002\015 \"\000\167\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\bX\160\004\019\002\0305\191\128 \242\002 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\136\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\001 \128\000@\b\024\214\186\000\000\192\000\000 \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\019\014\237\167\240\143\191o\167\199\012K(\234\233\200X\160\016\019\002^5\191\128 \242\000 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000@\000 \000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\128\000\000\000\000\000\000\000H \000\016\002\0065\174\128\0000\000\000\b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016n\218?\000\2402x|p\004\178\142\142\028\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\0010\238\218\127\b\251\246\250|p\196\178\142\174\156\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\004\000\000\000\000\000`\n\224\000\000\000\000\000\000\002\022.\000\007\240\151\143o\231\203<\128\b\"\\\192@\000\000\000\000\004\001\018\000\000\130\000 \000\000!\226\128\bN\137|\222\254\002\131\248\000\128a\192\004\130\000\001\b cZ\232\000\003\000\000\000\130\000\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\bX\160\000\019\002\0305\191\128 \242\002\"\np\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\000 \000\128\000(\000\000\000\002\000\000\000\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\018\b\000\004\000\129\173k\160\000\012\000\128\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001 \142\000`\b\155\214\186\000\000\192\002\000 \128\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\195\187i\252#\239\219\233\241\195\018\202:\186p\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\019\014\237\167\240\143\191o\167\199\012K(\234\233\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001 \128\000@\b\024\214\186\000\000\192\000\000 \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0026\168\004\004\192\151\141o\224\b<\128(\130\028\b\218\160\016\019\002\0305\191\128 \242\000 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\141\170\000\0010!\227[\248\002\015 \002\000\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\006\000\000\000\000\000\000\000\000\000\001\000`\000\127\000x0\000|0\000\000\002\005\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\000\007\240\006\003\000\007\195\000\000\000 P\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\004\128\000\012 \b\016\000\004`\029\160\000\000 \002\000\000\000\016\000\000\000\000\001\128D\128\000\000\000\b\000\000\000 \000\002\000 A\002\016\000\128\012\000 \016\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\t\129\000\001\000\004\000\000\000(\n\000\001\000\128\000\001\001\000\b\000\000\000\000\000\000\000\000\000\000\000\000\152\016\000\000\000@\000\000\002\128\160\000\016\004\128\000\002\000\000@\001\128\000\001\000\002\004\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000H\000\000\000\000\004\000\024\000\000\016\000 @\128\000\000\000\152\000\000\016\000H\000\000\000\128\128\130\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\0000\000 @\000\001\128v\128\000\000\000\b\000(\000\000\000\002\000\000\000\000\000\000\000\000\001\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000 \000\000 \001\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\0020\000\000\000\000 \000\000\024\b0\000\128\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\0000\128 @\000\017\128v\128\000\000\128(\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\b\002\004\000\001\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\194\000\129\000\000F\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\0006\000\000\004\000\018\000\004\001\160+\002\140\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\b\000 \000\000\000\000\004 \000\000\000\000\000\000\000@\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0000\128 @\000\001\128r\128\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\003`\000\000\000\001 \000\000\026\002\176(\1920\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\0006\000\000\000\000\018\000\000\000\160+\002\140\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\016\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\003\b\002D\000\001\024\007h\000\000\b\002\128\000\000\012 \b\016\000\004`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\"\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\"\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\b\000\000\000\002\000 \000\000\000\001\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000 \000\000\000\000\000\128\000\000\128\004\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\b\000\000\b\000@\000\000\000\000\128\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012\000\b\016\000\000`\029\160\000\000\000\002\000\002\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\004\000\000\004\000\016\000\004\000\000 \000\130\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\016\000\004\000\000 \000\130\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\001\000\000\001\000\004\000\001\000\000\b\000 \128\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000@\000\016\000\000\128\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\0000\000 @\000\001\128v\128\000\000\000\b\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\001\000\000@\000\002\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\160\000\000\000\016\000\000\000\000@\000\016\000\000\128\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000 \128\004\000\000\000\000h\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\136\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\136\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000 \000\000\000\000\000\128\000 \128\004\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\012 \t\016\000\000`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\000\128\160\130\016\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\004\000\018\000\000\000   \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\001\000\004\128\000\000\b\b\b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000@\001 \000\000\002\002\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\004\000\018\000\000\000   \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000@\001 \000\000\002\002\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000H\000\000\000\000\004\000\024\000\000\016\000 @\000\001 \000\000\000\000\016\000 \000\000@\000\001\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\001 \000\000\000\000\016\000`\000\000@\000\129\000\000\004\128\000\000\000\000@\000\128\000\001\000\000\004\000\000\000\000\t\128\000\000\000\004\000\000\000\b\b\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\000\000\004\000\000\000\b\b\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\b\000\018\000\000\000\000\001\000\006\000\000\004\000\b\016\000\000H\000\000\000\000\004\000\b\000\000\016\000\000@\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\018\000\000\000\000\001\000\006\000\000\004\000\b\016\000\000H\000\000\000\000\004\000\b\000\000\016\000\000@\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\000\000\004\000\000\000\b\b\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\128\000@0\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\r\128\000\000\000\004\128\000\000(\n\192\129\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\002`\000\000@\001\000\000\000\n\002\128\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\004\000\016\000\000\000\160(\000\004\000\000\000\152\000\000\000\000@\000\000\002\128\160\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\000\000\016\000\000\000  \000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\018\000\000\b\000\001\000\006\000\000\004\000\b\016 \000H\000\000\000\000\004\000\024\000\000\016\000 @\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000\000\000\000\000\130\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\024\000\002\000\000\000\128\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000\b\000\000\002\128\000\000\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\002`\000\000\000\000\000\000\000\002\000\000\000\000\b\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\002\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\b\000\0000\128 H\000\001\128v\128\000\000\128\b\000\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000@\000\000\216\000\000\000\000H\000\000\002\128\172\b\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\b\b\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\0006\000\000\000\000\018\000\000\000\160\163\002\004\000\000\000\000\000\000\000\000\000\000\000\002\002\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\r\128\000\000\000\004\128\000\000((\192\129\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\216\000\000\000\000H\000\000\002\128\140\b\016\002\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\001\000\000\003`\000\000@\001 \000\000\026\n0 @\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\004\000\000\r\128\000\000\000\004\128\000\000(\b\192\129\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\024\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\247\220@\130\007\2360\000\022\014=\193\197\129A\194\030(\001$\232\151\205\239\224(?\128\b\014\028\000\200 \128\001\000\014\001;\128\0004\000 \b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012\131\137\001\252\005\224\211\185\240\195@\002\012\1500\000\000\004\000\000\000\000\000 \000\b\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\017\128D\128\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\r\128\000\000\000\000\000\000\000 \000\192\128\000\000\000\016\000\000\000\000\000\128\000 \000\000\000\000\003 \130\000\004\0008\004\238\000\000\208\b\128(\128\012\130\b\000\016\000\224\019\184\000\003@\002\000\130\0002\b!\000@\003\128N\224\000\r\000\136\002\b\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000 \000\0002\b!\000@\003\128N\224\000\r\000\136\002\136\000\200 \128\001\000\014\001;\128\0004\000 \b \001\000\000\000\000\000\b\000\000\000\000\000\b\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\128\000\000\192\000\002\000\000\002\000\000\000\000\000\002\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\002 \b\003 \130\000\004\0008\004\238\000\000\208\000\128 \128\012\130\b\000\016\000\224\018\168\000\003\000\000\000\130\0002\014$\007\240\023\131N\231\195\r\000\b\"X\192\200 \128\001\000\014\001;\128\0004\000 \b \001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000L\130\011`\016\000\224\018\168\004\003\026\000&\170\128\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\003`\000\000\000\000\000\004\000\026\016&(\128\000\b\000\000@\002\000\000 \000\b\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\240\016\000\000\000\000\001\000\n\128\000\000\000\000\000\000\000\200 \144\001\000\014\001;\128\0004\000 \b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192\200 \128\001\000\014\001;\128\0004\000 \b \016\000\000\216\000\000\000\000\000\001\000\006\128\t\138 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\018\000\r\128\000\001\000\n\128\016\004h\000\152\162\000\200 \144\001\000N\001;\128\0004\000 \b \001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\128\002 \128\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0002\b \000@\003\128N\224\000\r\000\b\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003 \130\000\004\0008\004\238\000\000\208\000\128 \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\128\000\000\200 \144\001\000N\001;\128\0004\000 \b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\200 \128\001\000\014\001;\128\0004\002 \n \000\000\000\000\000\000\000\000\000\000\000\000\000\b\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003 \130\016\004\0008\004\238\000\000\208\b\128 \128\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\000\000\000\000\000\002\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0002\b \000@\003\128N\224\000\r\000\136\002\136\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012\130\b@\016\000\224\019\184\000\003@\"\000\130\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000 \000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\128 \000\000\000\000\000\000\006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\002\002\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000 (\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\0002\b \000@\003\128N\224\000\r\000\b\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\002@\b\003 \130\000\004\0008\004\238\000\000\208\000\128 \128\000\000\001\000\000\000\000\000\000\000\000\000\000\004\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\004\000\000\000\000\000\000\000\000\000\000\000\128!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\b\000@\000\000\000\000\000\000\000\b\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000 \000\234 \144\001\000N\001;\128\0004\000\160\b \000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\128\002 \b\003 \130\000\004\0018\004\238\000\000\208\000\128 \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\128\002\000\000!b\128\002L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\003 \130\000\004\0008\004\238\000\000\208\000\128 \128\000\000\000\000\000\000\000\000\000\004\000\000\000\000\b\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\128\000\000\000\000\006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\163\137\001\252\005\224\211\185\240\195@\n\b\1500\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\234 \144\001\000N\001;\128\0004\000 \b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\128\000\000\234 \144\001\000N\001;\128\0004\000 \b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\128\000\133\138\000\0010!\227[\248\002\015 \002\000\135\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000H \000\016\002\0065\174\128\0000\000\000\b \000\016n\218?\000\2402x|p\004\146\142\142\028\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\019\014\237\167\240\143\191o\167\199\012K(\234\233\200X\160\000\019\002\0305\191\128 \242\000 \bp!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\187h\252\003\192\201\225\241\192\018J:8p\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\193\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\240\016\000\000\000\000\001\128+\128\000\000\000\000\000\000\bX\184\000\031\194^=\191\159,\242\000 \137s\001\000\000\000\000\000\016\004H\000\002\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\b\000\000\000\000\000\128\000\020\000\001\000\000\000@\017 \000\b \002 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\004\000\002\000\000\000\000\002 \000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\001\000\000\001\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0006\000\000\004\000\018\000\000\000 \162 \004\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\020\000\001\000\000\000@\017 \000\b \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\012\000\001\000\000\000`\017 \000\000\000\002\000\000\004\000\000\004\000\000\001\000\000\000\000\000\000 \136\000\000@\000\000\000\000\006\001\018\000\000\000\000 \000\000@\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0000\000\004\000\000\017\128D\128\000\000\000\b\000\000\000\000\000\016\000\000\000\000\000\000\000\001\000\002\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\001\000D\128\000 \128\b\000\000\000\000\000\016\000\000\004\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000@\017 \000\b \002\000\000\000\000\000\r\128\000\001\000\004\128\000\000\b\b\136\001\016\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\001\000\000\003`\000\000\000\001 \000\000\026\0020 @0\000\004\000\000\001\128D\128\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000 \000\0000\000\004\000\000\001\128D\128\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\128\000\004\000\000\000\000\000`\016 \000\000\000\000\000\000\0000\000\000\000\000\001\128D\128\000\000\000\b\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000@\000\000\000\000\004\001\018\000\000\130\000 \000\000\000\000\000\216\000\000\016\000H\000\000\000\128\136\128\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\001\128D\128\000\000\000\b\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\138\001\0010!\227[\248\002\015 \002\000\135\002\022(\004\004\192\135\141o\224\b<\128\b\002\028\000@\000\016\000\000\000\000\000\000\000\000\000\000\000\000!b\128@L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0010\238\218\127\b\251\246\250|p\196\178\142\174\156\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\128\128\bX\160\016\019\002\0305\191\128 \242\000 \np\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\242\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\128\b|\001\128\192\001\240\192\000\000\n\0162\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\t<\128\b\002\028\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\016`\218\031\000`0@|p\004\144\142\142\028\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000@\000\000\000\000\000\000\002\000 \000\000\128\000\002\003\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001 \128\000@\b\026\214\186\000\000\192\b\000 \128\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000H \000\016\002\0065\174\128\0000\000\000\b \000\000\014\000 \000\130\000 \000\000\000\002\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001 \128\000@\b\024\214\186\000\000\192\000\000 \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\018\031\000`0\000|0\000\000\002\004\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\128\002\128\000\000\000\000\000\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\018\031\000`0\000|0\000\000\002\004\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\000\002\000\000\000\000\000\000\000\000\000\002\000\000!b\128\bL\bx\214\254\000\131\200\000\128!\192\000\001\128(|\001\128\192\001\240\192\000\000(\0160\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000`\n\031\000`0\000|0\000\000\n\004\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\138\000A0!\227[\248\002\015 \"\000\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\128\000\000\000\000\000\000\000\002\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\128\b\000\000\b\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\n\031\000`0\000|0\000\000\n\004\012\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\002\000\000\000\000\000\000\000\000\000\000 \000\000\016\000\000\000\000\000\128\000\000\000\000\000\128\000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\b\128\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\000\161\240\006\003\000\007\195\000\000\000\160@\192\000\000\002\000\000\000\000\000\000\000\000\000\002\000\000\001\000\000\b\000\000\b\000\000\000\000\000\b\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\136\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\n\031\000`0\000|0\000\000\n\004\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\b\000\000\000\000\128\000\000\000\000\000\128\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\002 \000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\128(|\001\128\192\001\240\192\000\000(\0160\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\b\128\000\000\000\000\000\000\000\000\000\136\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\138\031\000`0\000|0\000\000\n\004\012\000\000\002 \000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\002\000\000\002\000\000\000\000\000\002\000\000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\002 \000\000\000\000\000\000\000\000\000\"\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\024\"\135\192\024\012\000\031\012\000\000\002\129\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002 \000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\b\000\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\136\000\000@\000\000\000\000\002\000\000\000\000\000\002\000\000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\002 \000\000\000\000\000\000\000\000\000\"\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\024\"\135\192\024\012\000\031\012\000\000\002\129\003\000\000\000\136\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\"\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\024\"\135\192\024\012\000\031\012\000\000\002\129\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000 \000\000 \000\000\000\000\000 \000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\"\000\000\000\000\000\000\000\000\000\002 \000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\130(|\001\128\192\001\240\192\000\000(\0160\000\000\b\128\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002 \000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\001!\240\006\003\000\007\195\000\000\000 @\192\004\027\182\143\192<\012\158\031\028\001\164\163\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8p\016\000\000\000\000\000\128\002\128\000\000\000\000\000\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\018\031\000`0\000|0\000\000\002\004\012\000A\187h\252\003\192\201\225\241\192\026J:8r\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000 \000\000\000\000\000\000\000\000\000 \000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\004\027\182\143\192<\012\158\031\028\001\164\163\163\135!b\128\000L\bx\214\254\000\131\200\000\128!\192\000A\131h|\001\128\193\001\241\192\018B:8p\001\006\237\163\240\015\003'\135\199\000i(\232\225\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\016`\218\031\000`0@|p\004\144\142\142\028\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000`\018\031\000`0\000|0\000\000\002\004\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\128\002\128\000\000\000\000\000\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\018\031\000`0\000|0\000\000\002\004\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\000\002\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\0246\135\192\024\012\016\031\028\001$#\163\135\003\000\002\004\000\000\024\007h\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135\003\000\002\004\000\000\024\007h\000\000\000\000\128\000\000\000A\128\b|\001\128\192\001\240\192\000@\b\0160\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\129\b|\001\128\192\001\240\192\000\000\b\0160\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\000\004\027\182\143\192<\012\158\031\028\001$\163\163\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\129\b|\001\128\192\001\240\192\000\000(\0160\000\000\000\000\000\000\000\000\128\000\000@\000\b\000\000\192\000\129\000\000\006\001\218\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\016\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\004\0246\135\192\024\012\016\031\028\001$#\163\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000:\136$\000@\019\128N\224\000\r\000\b\002\b\000\000\000\000\000\000\000\000\002\000\000\001\000\000 \000\000\000\000\000\000\000\000\000\b\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\004\000\000\128\000\000\000\000\000\000\000\000\000 \000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\016\000\002\000\000\000\000\000\000\000\000\000\000\128\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003 \130\000\004\0008\004\238\000\000\208\000\128 \128@\000\000\000\000\000\000\000\000\000\000\016\000\000\b\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\024\000\135\192\024\012\000\031\012\001\000\000\129\003\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\001\006\r\161\240\006\003\004\007\199\000I\b\232\225\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016`\218\031\000`0@|p\004\144\142\142\028\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\024\004\135\192\024\012\000\031\012\000\000\000\129\003\001\128\000 \000\000\b\000\000\000\000\000\000\000\000\000\004\000\000\000\001\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\022.\004\007\240\151\143o\231\203<\128\b2\\\192\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\000!\240\006\003\000\007\195\000\000\000\160@\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`B\031\000`0\000|0\000\000\002\004\012\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\192\200 \136\001\128N\001;\128\0004\000 \b \003 \130 \004\0008\004\238\000\000\208\000\128 \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0002\b \000@\003\128N\224\000\r\000\b\002\b\000\000\000\000\000\000\000\000\000\000\000\000\128\000`\136\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\031\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\016\000\000\000\000\002\000\005\130 \014\162\t\000\016\004\224\019\184\000\003@\n\000\130\000\000\000\000\000\000\000\000\000\128\000\000 \000\b\000\000\000\000\000\000\000\000\000\002\000\000\000\128\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\130h|\001\128\193\001\240\192\002\002\b\024p\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\168\130@\004\0018\004\238\000\000\208\000\128 \128\000\000\000\000\000\000\000\000 \000\000\b\000\002\000\000\000\000\000\000\000\000\000\000\128\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000 \000\b\000\000\000\000\000\000\000\000\000\002\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\128\000 \000\000\000\000\000\000\000\000\000\b\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0008\128 @\000\017\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\031\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\216\000\000\000\000\000\000\000\002\000\012\b\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\002\000\133\138\000\0010!\227[\248\002\015 \002\000\135\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\000\006\233\163\240\015\003#\135\195\000\b  @\192@\000\000\000\000\004\001\018\000\000\130\000 \000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\b\000@\000 \000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\128\000\000\000\000\000\000\000H \000\016\002\0065\174\128\0000\000\000\b \000\000n\154?\000\24028|0\000\162\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\016\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\024&\135\192\024\012\000\031\012\000 \000\129\131\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\200 \128\001\000\014\001;\128\0004\000 \b \000\000\000\000\000\000\000\000\000\001\000\000\000\000\002\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\001\006\000!\240\006\003\000\007\195\000\001\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`B\031\000`0\000|0\000\000\002\004\012\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\000\006\233\163\240\015\003#\135\195\000\b  @\192\000\000\000\000\000\006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\b\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\002`\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\128\000\000\000\000@\000\128\000\001\000\000\004\000\000\000\000\t\128\000\001\000\004\128\000\000(\b\b \000H\000\000\000\000\004\000\b\000\000\016\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\001\000\004\128\000\000(\b\b \000H\000\000\000\000\004\000\b\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\001\000\004\128\000\000(\b\b \000H\000\000\000\000\004\000\b\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\001\000\004\128\000\000(\b\b \000H\000\000\000\000\004\000\b\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000@\001 \000\000\n\002\002\b\000\018\000\000\000\000\001\000\002\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\016\000H\000\000\002\128\128\130\000\004\128\000\000\000\000@\000\128\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\001\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000 \000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\130h|\001\128\192\001\240\192\002\000\b\01600\000 @\000\001\128v\128\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\130h|\001\128\192\001\240\192\002\000\b\01608\128!@\b\017\192\246\128 \003\128\b\004\000\000@\000\000\000\000\006\001\018\000\000\000\000 \000\000@\000\000\152\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000`\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\128\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001 \000\000\000\000\016\000 \000\000@\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\136\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\128\000\000 \000\000\000\000\000\000\001\001\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000D\004\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\002\000\000\000\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\240\128\000\000\000\000 \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\130\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\001\018\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003`\000\000@\001 \000\000\n\002\000\000@0\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\128D\128\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\002&\000\000\000 \002\000\000\000\000\128\000\000\128\000\000\000\000 \128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\128D\128\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\136\000\000\000\000\000\000\000\000\000\000\000\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\240\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \017 \000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\000@\128\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016 \000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\000\000\016\000\000\000  \000\004\b\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\002\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\000\000\004\000\000\000\b\b\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\000\000\000\000\002\000\000\000\000\b\000\001\128\b\016@\132\000 \003\b\b\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\002\000\000\000\128\000 \000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\000\000\000\000\002\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000 \000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\001\000\000\002`\000\000\000\001\000\000\000\002\002\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\002\000\000\000\000\t\128\000\000\000\004\000\000\000\b\b\000\001\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\000\000\016\000\000\000  \000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\128\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\152\000\129\004\b\000\002\0000\128\000@\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\240\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000&\004\000\004\000\016\000\000\000\160(\000\004\000\000\000\152\016\000\000\000@\000\000\002\128\160\000\016\004\128\000\002\000\000@\001\128\000\001\000\002\004\b\000\018\000\000\000\000\001\000\006\000\000\004\000\b\016 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\004\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\004\128\000\002\000\000@\001\128\000\001\000\002\004\b\000\018\000\000\000\000\001\000\006\000\000\004\000\b\016 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\000\000\000\000\000\000\b \000\000\000`\000\b\000\000\002\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\000 \000\000\n\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000F\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\006\001\018\000\000\000\000 \000\000@\000\000\152\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000`\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\128\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001 \000\000\000\000\016\000 \000\000@\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\136\000\000\000\000\000\128\000\000\000\000\000\000\000\000\002\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\000\000\004\000\000\000\b\b\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\b\000\000\002\000\000\128\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\000\000\000\000\000\000\b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\128\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\136\002\148\000\129\028\015(\002\0008\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\136\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\b\000\000\002\000\000\128\000\014\162\t\016\016\004\224\019\184\000\003@\n\000\130\000\000\000\000\000\000\000\000\000\128\000\000 \000\b\000\000@\000\000\000\000\006\001\018\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\b\000\000\000\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000`\017 \000\b \002\001\000\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192\200 \136\001\128\014\001;\128\0004\000 \b \001 \128\000@\b\024\214\186\000\000\192\000\000 \128\000\000: \128\002@\b\224\000\000\000\b\000\000\000\016\000\000\000\000\001\128D\128\000 \128\b\004\016\000@\000\000\000\000\006\001\018\000\000\130\000 \016\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\003`\000\000@\001\000\000\000\002\002\002\000\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000:\136$\000@\019\128N\224\000\r\000(\002\b\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\001\000\000\000\000\000\024\004H\000\002\b\000\128@\000\000\000\003`\000\000@\t`\000\000\002\002\002\000\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000`\017 \000\b \002\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\234 \144\001\000N\001;\128\0004\000 \b \000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\004\000\000\000\000\000`\017 \000\b \002\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\016\000\000\000\000\001\128D\128\000 \128\b\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000@\000\000\000\000\006\001\018\000\000\130\000 \016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002 \000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\b\152\000\000@\128\024\000\000\000\002\000\002\002\000\000\000\000\000\130\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b \000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\128\000\012 \b\016\000\004`\029\160\000\000 \002\000\000\000\000\000\b\128\000\000\000\000\000\000\000 \000@\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\130(|\001\128\192\001\240\192\000\000\b\0160\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\001 \000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\130(|\001\128\192\001\240\192\000\000\b\0160\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\138\031\000`0\000|0\000\000\002\004\012\012\130\b\128\024\000\224\019\184\000\003@\002\000\130\0002\b\"\000@\003\128N\224\000\r\000\b\002\b\000\200 \128\001\000\014\001;\128\0004\000 \b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\000\000\232\130\000\t\000#\128\000\000\000 \000\000\000@\000\000\000\000\006\001\018\000\000\130\000 \016@\001\000\000\000\000\000\024\004H\000\002\b\000\128@\000\000\000\002 \000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\128\000\000\000\000\000\000\000\016\002\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\b\000\000\002\000\000\128\000\014 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000 \000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\253\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\240@\000\b\152\000\000\000\128\024\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\b\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \012\130\b\000\016\000\224\019\184\000\003@\002\000\130\000\000\000\b\128\000\000\000\000\000\000\000\000\000\000 \000\000\000\"\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\002`\000\000\000\001\000\000\000\002\002\000\b@2\b \000@\003\128N\224\000\r\000\b\002\b\000\000\000&\000\000\000\000\016\000\000\000  \000\132\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\012\130\b\000\016\000\224\019\184\000\003@\002\000\130\000\000\000\t\128\000\000\000\004\000\000\000\b\b\000!\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\001\128D\128\000 \128\b\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000 \000\b\000\000\000\000\000\000\000\001\000\000\000\000\000\128\000 \000\000\000\000\003\168\130@\004\0018\004\238\000\000\208\000\128 \128\000\000\000\000\000\000\000\000 \000\000\b\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\b\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000 \000\000\b\000\002\000\000:\136$\000@\019\128N\224\000\r\000(\002\b\000\000\000\000\000\000\000\000\002\000\000\000\128\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\162\t\000\016\004\224\019\184\000\003@\002\000\130\000\000\000\000\000\000\000\000\000\128\000\000 \000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000 \000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000 \000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\128\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\000\000\004\000\000\000\b\b\000\001\002\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\128\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bX\160\000\019\002\0305\191\128 \242\000 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\000\006\233\163\240\015\003#\135\195\000\b  @\192\000\027\164\143\192<\012\142\031\012\001\000\128\129\003\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\000!\240\006\003\000\007\195\000\000\000(@\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128$\242\000 \bp!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\130h|\001\128\192\001\240\192\002\000\b\0160\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\000\000\000\000\000\000\b\000\000\000\bx\160\006\019\162_7\191\128\160\254  \024p\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\027\166\143\192<\012\142\031\012\000 \128\129\003!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\128H|\001\128\192\001\240\192\000\000\b\0160\000\006\233\163\240\015\003#\135\195\000(  @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\004\000\000\000\000\000 \000\160\000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\024\004\135\192\024\012\000\031\012\000\000\000\129\003\000\000n\154?\000\24028|0\002\130\002\004\012\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\t\161\240\006\003\000\007\195\000\b\000 @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000\000\b\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\006\233\163\240\015\003#\135\195\000(  @\200X\160\000\019\002\0305\191\128 \242\000 \bp\000\000`\154\031\000`0\000|0\000\128\002\004\012\000\001\186h\252\003\192\200\225\240\192\n\b\b\0162\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\024&\135\192\024\012\000\031\012\000 \000\129\003\000\000\000\000\000\000\016\000\b\000\000\002\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000 \000\b\000\000@\000\000\000\000\004\001\018\000\000\130\000 \000\000\000\000\000\152\000\000\016\000H\000\000\000\128\128\000\016\004\000\000\000\000\000`\017 \000\000\000\002\000\000\004\000\000\000\000\000\000\000\000\128\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\128\000\000 \000\b\000\000\000\000&\000\000\000\000\016\000\000\000  \000\004\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000 \000\000\b\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000 \000\000\b\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\t\129\000\001\000\004\000\000\000(\n\000\001\000\000\000&\004\000\000\000\016\000\000\000\160(\000\004\001 \000\000\128\000\016\000`\000\000@\000\129\002\000\004\128\000\000\000\000@\001\128\000\001\000\002\004\b\000\018\000\000\000\000\001\000\006\000\000\004\000\b\016\000\000H\000\000\000\000\004\000\b\000\000\016\000\000@\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000H\000\000\000\000\004\000\024\000\000\016\000 @\000\001 \000\000\000\000\016\000 \000\000@\000\001\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\000\000\016\000\000\000  \000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\002\000\004\128\000\000\000\000@\001\128\000\001\000\002\004\000\000\018\000\000\000\000\001\000\002\000\000\004\000\000\016\000\000\000\000&\000\000\000\000\016\000\000\000  \000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\004\128\000\000\000\000@\001\128\000\001\000\002\004\000\000\018\000\000\000\000\001\000\002\000\000\004\000\000\016\000\000\000\000&\000\000\000\000\016\000\000\000  \000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\000\128\128\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\001\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\001 \000\000\128\000\016\000`\000\000@\000\129\002\000\004\128\000\000\000\000@\001\128\000\001\000\002\004\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000`\000\b\000\000\002\000\000\000\000\000\000\000\000\000\001\000\000\000\000@\b\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003 \130 \006\0018\004\238\000\000\208\000\128 \128\004\000\000\000\000\000@\017 \000\b \002\000\000\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192\000\000\000\000\000\006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\000\000\b\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\018\000\000\000\000\001\000\002\000\000\004\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\128\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\016\000\b\000\000\002\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\128\000\000 \000\b\000\000\000\000&\000\000\000\000\016\000\000\000  \000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\135\138\000\001:%\243{\248\n\015\224\002\001\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!\226\128\000N\137|\222\254\002\131\248\000\128a\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\001!\240\006\003\000\007\195\000\000\000 @\192\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000@\000\000\000\000\006\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\200\216\160\000\147\002\0305\191\128 \242\000!(p#b\128\000L\bx\214\254\000\131\200\000\132\161\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\b\000\000\000\000\000\000\000\000\0002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000 \000\0026\168\004\004\192\135\141o\224\b<\128(\002\028\b\218\160\000\019\002\0305\191\128 \242\000 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bX\160\004\019\002\0305\191\128 \242\000 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000H \000\016\002\0065\174\128\0000\000\000\b \000\000\014\000 \000\130\000 \000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\000\000\003\128\b\000$\000\142\000\000\000\000\128\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000H \000\016\002\0065\174\128\0000\000\000\b \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\001!\240\006\003\000\007\195\000\000\000 @\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\012\130\b\000\016\000\224\019\184\000\003@\002\000\130\001\000\000\000\000\000\000\000\000\000\000\000@\000\000 \000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000!b\128\000N\137|\214\254\000\131\216\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0002\b\"\000h\019\128N\224\000\r\000\b\002\b\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000!b\128\000N\137|\214\254\000\131\216\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000 \000\000\bX\160\000\019\162_5\191\128 \246\000 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000 \000\000\b\000\002\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\bX\160\000\019\162_5\191\128 \246\000 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\b\000@\000\000\000\001\000\000\000\000\000\200 \136\001\160\014\001;\128\0004\000 \b \000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\128\000\000!b\128\000N\137|\214\254\000\131\216\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\138\000\0012%\243[\248\002\015`\002\000\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\007\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\223\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\240\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\160\000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\024\004\135\192\024\012\000\031\012\000\000\000\129\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\000\000\128\000\000\000\000\000\000\000\000\000\128\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\031\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\001\000\000\000\000\000\024\002\184\000\000\000\000\000\000\000\133\139\128\001\252%\227\219\249\242\207 \002\b\1510\016\000\000\000\000\001\000D\128\000 \128\b\000\000\000\000\000\000\000\000\004\000\002\000\000\000\000\000 \000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000@\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bX\160\004\019\002\0305\191\128 \242\002 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\b\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@ \002\000\000\002\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\002\000\000\000\000\000 \000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000@\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bX\160\004\019\002\0305\191\128 \242\002 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\b\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@ \002\000\000\002\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\001\006\r\161\240\006\003\004\007\199\000I\b\232\225\192\000\000\016\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\006\237\163\240\015\003'\135\199\000I(\232\225\192\000\024\000\135\192\024\012\000\031\028\000\000\002\129\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\0246\135\192\024\012\016\031\028\001$#\163\135\000\000`B\031\000`0\000|0\000\000\014\132\012\004\000\000\000\000\004`\017 \000\000\000\002\000\000\000\016\000\000\000\000\001\128D\128\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\001\024\004H\000\000\000\000\128\000\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\192\000\000@\000\000\000\000F\001\018\000\000\000\000 \000\000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000@\000 \000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\006\001\018\000\000\000\000 \000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\001\128\b|\001\128\192\001\240\192\000\000(\0162\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\024\016\135\192\024\012\000\031\012\000\000\000\129\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bX\160\004\019\002\0305\191\128 \242\002 \bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000L;\182\159\194>\253\190\159\0281,\163\171\167\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\019\014\237\167\240\143\191o\167\199\012K(\234\233\192\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0008\000\128\002\000\000\160\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\224\"\000\t\128#\130\003\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000.\002 \000\152\0028 0\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0008\000\128\002\000\000\160\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\000 \000\128\000(\000\000\000\002\000\000\000\000\0008\000\128\002\000\000\160\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\130\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000@\001 \000\000\002\002\130\b@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\202\000\129\000\000\006\001\218\000\000\018\000 @\128\003\b\002D\000\001\024\007h\000\000\b\000\128\000\000\000\000\002`\000\000@\001 \000\000\002\002\130\b@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\012 \t\016\000\004`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012\000\bP\000\000`\029\160\000\000\000\002\000\n\000\000\000\t\128\000\001\000\004\128\000\000\b\n\b!\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\016\000H\000\000\000\128\160\130\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\001\000\004\128\000\000\b\n\b!\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001 \000\000\000\000\016\000`\000\000@\000\129\000\000\000\000\002`\000\000@\001 \000\000\002\002\130\b@\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\001 \000\000\000\000\016\000 \000\000@\000\001\000\000\000\000\002`\000\000@\001 \000\000\002\002\130\b@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\004\000\018\000\000\000 ( \132\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\128\000\001\000\004\128\000\000\b\n\b!\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000@\001 \000\000\002\002\130\b@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\000\000\004\000\018\000\000\000 ( \132\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000@\001 \000\000\002\002\130\b@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012\160\b\016\000\000`\028\160\000\001 \000\004\b\000\000\000\t\128\000\001\000\004\128\000\000\b*\b!\000\194\000\145\000\000F\001\218\000\000\002\000 \000\000\003\000\002\020\000\000\024\007h\000\000\000\000\128\002\128\004\128\000\000\000\000@\001\128\000\001\000\002\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\000\128\160\002\016\000\000\002`\000\000\000\001\000\000\000\002\002\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\132\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\001\000\000\000\002\002\128\b@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0002\128 @\000\001\128r\128\000\004\128\000\016 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\152\000\000\000\000@\000\000\002\128\160\000\016\004\128\000\002\000\000@\001\160\000\001\000\018\004\b\000\018\000\000\000\000\001\000\006\128\000\004\000\b\016 \000\000\000\000\000\000\130\000\016\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\128\000\000\000\000@\000\160\000\001\000\000\004\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\018\000\000\000\000\001\000\002\128\000\004\000\000\016 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000&\004\000\004\000\016\000\000\000\160(\000\004\000\000\000\152\016\000\000\000@\000\000\002\128\160\000\016\004\128\000\002\000\000@\001\128\000\001\000\002\004\b\000\018\000\000\000\000\001\000\006\000\000\004\000\b\016 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\001\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\001 \000\000\128\000\016\000`\000\000@\000\129\002\000\004\128\000\000\000\000@\001\128\000\001\000\002\004\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\001\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0000\128 @\000\017\128v\128\000\000\128\b\000\000\000\000\000\"\000\000\000\000\000\000\000\000\128\001\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\133\138\000\0010!\227[\248\002\015 \002\000\135\000\000\006\b\161\240\006\003\000\007\195\000\000\000 @\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000n\138?\000\24028|0\000\002\n\132\r\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\242\022(\000\004\192\135\141o\224\b<\128\b\002\028\000\000\000\"\000\000\000\000\000\000\000\000\000\002\000\000\001\000\000\b\000\000\b\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\b\000\128\000\000\128\000\000\000\000\000\128\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\002&\002\000\016 \006\000\000@\000\128\000\135\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\192@\000\000\000\000\006\000\174\000\000\000\000\000\000\000\127\255\255\255\255\255\255\255\255\255\255\255\255\255\255\252\004\130\000\001\000 cZ\232\000\003\000\000\000\130\000\001\006\237\163\240\015\003'\135\199\000I(\232\225\192\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000H \000\016\002\0065\174\128\0000\000\000\b \000\000n\154?\000\24028|0\000\130\002\004\012\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\129\004\b@\002\0000\128\128@\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\000!\240\006\003\000\007\195\000\b\000 @\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003 \130\000\004\0008\004\238\000\000\208\000\128 \128\000\000\000\000\000\000\000\000\000\000\000\002\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000!\226\130\000N\137|\222\254\002\131\248\128\128a\192\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\018\b\b\000\000\001\128\000 \000\004\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\130\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\135\138\b\001:%\243{\248\n\015\226\002\001\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\002\000\000\000\002\030( \004\232\151\205\239\224(?\136\b\006\028\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\128\000\000\000\135\138\b\001:%\243{\248\n\015\226\002\001\135\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000")
  
  and start =
    7
  
  and action =
    ((16, "@\246.\246@.\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0006\184@.\000\000\000\000*\238b\152.\246*\238\000\0034\028+\186\000\000*\168)\236\146\020\000\000\150\198\004\214*x+l\151B\004\214\151\188\004\2140\018\000\000\004\2140\0121\254\000\0002\188\000\000+$+h\156\170\023\"\000\000\000\000+\192*\222\000\000\000\000\154J\156\170,\182\000\000\000\000\000\000=\002\139\208F\026+\234=\002@.@\246\000\248\000\000-(K\252*\220\000\000,\182\000\000,\004\000\000,\182\000\000-\224\000\000,\182\000\000,\226\000\000\000\0003\0280\200\000\000\000\000\000\000@t\153\\1\254\1592\000\000\146\020\157\b@.@\246\152D\153\236\000\000\000\000\153\236\023\"\000\0002\b\152D\153\236\000\00076.:7676\000\000\152\198\152\198\152\198\023\"\000\0002\b\152D\153\236\149|\149|\023\"\000\0002\b\000\000\000\000\000\000\152\198\004\21476\000\000-L76\000\000\149|F\244\000\000\000\000\"\212\000\000\000\000\000\000\000\0002\b\000\000\000\000l\250m\176\000\000\000\0007\230LP\"\212\001\242\"\212F\244-\242\000\000-lG\002\"\212F\244\000\000,X\000\000/\164\000\000-\022-\158\"\212\152\198\000\000\000\000\000\000\000\000,\182*\152e\n\000\000.\246*\238\152\198\000\000\000\000\000\000\000\0007\138\149|0\254,\182+\134\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\236*\2303\2327\230@\246\152D\153\236F\2440l\000\000-l0\206\000\000,\182\000\000\000\000J\154\149|\000\000*\254\000\000\000\000\149|\000\000ut\149|\000\000\000\000\000\000,t\000\000\000\000\000\000\152\198-b\000\000\149|\000\000D\164G\234\000\000e\188\000\000-\020u\232\000\000\000\000\000\000\000\000\000\000u\232\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000,\172\000\000\000\000\000\000\000\000\000\000\000\0002\220\000\000-\238\157\196=\002J\226\000\2480\242i$*\220@tM\232\000\000PL5\190\1592\146\0201\170\000\000+^2r\156&,\182J\176,\1820B\000\0003dD.\000\000\158\"4\1984\208\156\170\000\000\000\000\000\000\154\142\000\000,T-6\000\000\000\000\000\000I\150\000\000\000\000\000\0003\2401\028\000\000+l\146\020\000\000\000\000\154\246\146\020\000\000\003\230\000\000\000\000\155:5\158,\182\000\000\000\000\000\000+l\000\0003\208D\152\158\"\000\0005\208\000\0005\194\146\020\000\000\000\0005\200\146\020\000\000\000\000+\140\156&\000\0006\174\000\000\000\000\000\000\000\000.\2426L\156&\000\000.\184\156&\000\000/D*\182\000\000.\242\000\0004\006.(\000\000.\242\000\0007(\000\000+^7<\000\0008\000\000\000\146\020,\1824 \000\000\004\214\000\0006f\004\214\000\000\000\000\000\000*\006,\1825\016\004\214\000\000\000\000\000\000\000\000\004\214\000\0008\028\000\000.8*\006\146\020\000\000\000\000.8\000\000*\006.8\000\000A\130\000\000+\1868\0041 \156&\000\0008P3 \156&\000\0004\026,L\000\0008\200\000\0008\232\000\0004\188\146\020\000\000\000\000\000\0008\250\000\000\000\000tp\146\020\000\000\000\000\000\000\000\000\000\0005\190\000\0009@5\190\000\0009\1665\190\000\0005\190\000\0005\190\000\000:\204:\2048\172\000\0009\002:\204:\2049\134\000\000:`\000\000;:\000\000\000\000<\020:\204:\204<\0209\n:\204:\204<\020\000\000<\020\000\000\000\000<\020\000\000\000\000\000\0002\b\146\0209J\146\020\000\000u\230\000\0003:M\148\000\000M\148@t\000\000\000\0002\b9:3:\000\000\000\000\000\000\000\0009\1603\190,L:(M\232PL\000\000-\254\000\000\000\0030\170*\222+\202,\182.v=\002\000\000\000\000\000\0002\0120\216+\172\000\0009\23254\000\000/\250,\228\158L\146\020\159V\000\000\146\020\000\000:\170,6\004\214\159\1461f\004\214\159\206\000\000m\0220\216\000\0009\2525\136\155\162\000\000\000\000:\016=\002n\130\000\000=\002\000\000\000\000\000\000*J\000\0009\236\146\020\000\000@.@\246w\144\000\000\004\214\000\000-N\000\000\000\000-\222\000\000\000\000C\234-N:\200*\246\000\000BN\000\000=\002\000\0007Z-\222l\018w\144F\244:\166\000\000.,F\246w\144,j+\1725\250.\2386\236\000\000\000\000-*w\144t\004C\234w\144,\182t\004,\182\000\000\000\000\000\000\000\000\000\000\000\000\158\136@\004\000\000\000\000\005\2084,\149\254\000\000\000\000\006\202w\144\141\164\000\000\153J\148x:\216*\246\000\000+\004\146\020\000\000w\144\000\000w\144\000\00062\137\220\000\000:\184\000\000l\0181\248\000\000:\004\000\000F\244:\184\000\000,j:\190\000\000\000\000\000\000\007\196\000\000*J\000\000-j\000\000l\018:\018\000\000g\b\000\000:\208\000\000,j:\212\000\000\000\000\000\00062:\230\000\000\000\000/\148*J\000\000:\238\000\000.6\000\0000\234:D\000\000;\002:\220w\144+\156w\1440\022\000\00052\"\212/\224.\002w\144:\220\000\000:\222/\018w\144\000\000\000\0002\222e\n\000\000.\246:\226w\1445\132\"\2121B\000\000A\176\000\000\137Z\000\000\000\0007d\137\220\000\000;\024\000\000\000\0007d;(\000\000\000\000.&\"\212\"\212\152\198;\204\152\198.P\"\212\"\212<\166:\244\000\000\"\212\b\144+\2124\2167\230\000\000\000\000\000\000.\200K\132\000\000/\170=\0022\176\000\000\000\000\000\000;.\000\0002\2387\134N\180\000\000\000\000-\0006v=\236=\0023\006\000\000h$1\000;R;\0187\2306t\000\0007\2303\2224\0168\190E\0028\192\000\000\000\0008\1949\154\000\000;:\000\0008\210\000\0000\014/\1281\224;J\000\000\000\000:\1987\2304\206\000\000=\002;P\000\000nfo\0281fb\152\000\000\000\000\000\000/>\000\000\"\212\000\000\"\212\000\0002\174fr\000\000\t\138\"\212H|\"\212IH\"\212J\020\"\212z\n\"\212J\224\"\212K\172\"\212Lx\"\212MD\"\212N\016\"\212N\220\"\212O\168\"\212Pt\"\212Q@\"\212R\012\"\212R\216\"\212S\164\"\212Tp\"\212U<b\152\"\212V\bV\212\"\212W\160\"\212Xl\"\212Y8\"\212Z\004\"\212Z\208\000\000\000\000\000\000;\\\000\000-L76\000\000;Z\000\0001\184\000\000\149|;&\000\000\149|PH;2\000\000\000\000\149|\000\000\000\000\"\212\138N\000\000+\172\"\212\138\202\000\000\"\2127@b\152\142\236;f\000\000\143h\000\000\"\212:\184\000\000g(\000\000;l\000\000-\022-\1785z\000\000;\002\000\000\000\0002\1566\n\000\000\"\212\143\2281\196\000\000\000\000\"\2127\248,j+\1724R\"\212\144`7^,j+\1724\202\"\212\144\220\000\000/\2426.\"\212\145X\000\000\000\000\000\000+\172/4\"\212\138N1\238\000\000,j+\1721\016\"\212\138\202\000\0003\206\000\000\000\0007\1284\244\000\000\000\000/\242\000\000;n\000\000;p\000\00086,j+\1721@\"\212\138N5\174\000\000\000\0006:\000\000\000\000\"\212\139F\000\000,j+\1725\194\"\212\138N6\158\000\000\000\0007\030\000\000\000\000\000\000\000\000\139F8d\"\212[\156-.\"\212\142\2369>\"\212\\h\"\2127@;x:\024\"\212]4:\242\"\212^\000\000\000\000\000\000\000\143h\000\000.\028\"\212\143\228\000\000\"\2127@;~\000\000\000\000^\204\004\214;\006\"\212_\152\004\214\145\196\000\000\000\000\"\212y\142\152\198=\128\000\000t\216*z\004\214\000\0006\218\"\212`d\000\000\000\000\139\228*z6\218\000\0007d;\146*z6\218\000\0007d;\148*z6\218\000\000w\144+\174\"\212t\216;\014\"\212a0\000\000a\252\000\000\000\000\144`,\1842\136\000\000,\182\n\132\000\0002\248;\158;n\"\212z\n\"\212z\n\000\000;\164\000\000\011~\"\212x\002\142z\150\140\000\000w\1442\228\146\020;\028\"\212\012x9\150x\160-D/\194\"\212t\216\000\000\000\000\140f-D/\194\000\0007d;\174-D/\194\000\0007d;\178-D/\194\000\000\156&1<1<\000\000;\026\146\020;6\"\212\rr;4\146\020;J\"\212\014l3\232\146\020\000\000\000\000;R\"\212\015f\000\0007\234\"\212\016`\000\000\000\000\152\198o\2047\230\017Z.\246*\238\152\198g\216\"\212y\018\000\000/\224.\002\000\000vd\000\000.\246;\182w\1447Z\"\212\145\196\"\212|\160\152\198pX*J;>\146\0201\b\000\0001\1521\152\000\000\000\000\000\000;\166@.,\2402\b\000\000j4,\240\000\000;\238s\242,\240\000\000;\236\148\134,\240\000\000\152\212,\240\000\000\1600,\240\000\000\000\000\000\000\000\0001B7\004\"\212y\142\004\214;j\"\212z\n\146\020=\0028\220*J;T\146\0208\210\000\0001\152\000\000:\204\000\0005\176\000\000,F;\2066\1444\128\000\000\000\000;\254,\182\000\000\000\000\000\0008\2404\128\000\000<\b\000\0000\000\018T2\186+\186\000\000,F\000\000\000\000;\212;^\146\020\000\000\000\000,F;\238;z\156&\000\000,F;\244;\136\156&\000\0003X\000\000;\1585\158\000\000\000\000HJ\146\0204\188\000\000<:\000\000\000\000\000\000\000\0003X\000\000\019H\146\020;\188\146\020\000\000\000\000\146\020\000\000\000\000EN2\186\000\000,F<\022;\160\156&\000\000,F<\";\174\156&\000\0003X\000\000\146\020\000\000\000\000\020<\0216\000\000\000\000\000\000\000\000\000\000<X\000\0009H\0220\000\000<\\\000\0003X\000\000\000\000\000\0002\248,F\000\000;\164,F\000\000\000\0002\248\000\000<622;\192=\220\000\000\000\000;\232=\220\000\0004\216,F\000\000;\180,F\000\000\000\0004\216\000\000\000\0002\252e\188\000\000\000\000\000\000\000\000-\000\000\0033|\000\0003\176=\002G\152\000\000\000\000\000\0003\1765\200<\1603\176\000\000;\186<\1643\176\000\000\000\0005\200\000\0007\148\000\0007\236\000\000\000\000\000\000\000\000E\250\000\2489*i$j\216M\232PL\000\000\000\000;\2389D,L<xM\232PL\000\000-\254\000\0037\176/\n,\182/d\000\000*J;\224\146\020\000\000=\002<D*J;\236\146\02094\000\0001\152\000\000:\204\000\0007v,F2\248\000\0004\216\000\000/\202\000\0038\138\000\0003\1765\200\000\000\000\000\000\000\000\000\000\000\000\000\149\004\000\0005\176<\1463\238w\0023\238=\220\000\0006X\023\"\000\000\000\000\023\"\023\"\142z\152\198c2?\240\023\"\023\"7J\000\000\000\000\000\000<\150z\168<D\023\"\154\202\000\000\000\000\000\000\023\"\000\000\140\232<H\023\"\000\0007d<\220<X\023\"\000\0007d<\226<\\\023\"\000\000.\024<\176\000\000\000\000\146\020\000\000\000\000\000\000\000\000I\"4\028\000\000/`0b<\1825\182\157\196*\134<d\"\212\146\136<\188)\248\"\212\147\004<t\"\212\147\128\142z\150\140w\144\000\000\152\198h\134?\240\023\".\024\000\000\146\020\000\000\000\0005\1788\180<\202<T\156&\000\0004\222\158\2101<<j\146\020/\194\000\000\000\000/\194\000\000\000\000\000\000\024\022\025\016H\182\000\0005\178\000\000\000\000\000\000<Nw\1447\0249\174\026\n\000\000\000\000=\022\023\"L\200w\144L\200<Xw\144L\200\000\000\000\000\000\000\000\000\000\000\027\004=\024\000\0007\244\000\000=\220=\"\000\000=\030\000\000\023\"\000\000\000\000\000\000285x\141j3\238\000\0007d=&3\238\000\0008\240=(5\208{63\238\000\000\141\2363\238\000\0007d=*3\238\000\0007d=,3\238\000\000\000\0007d=03\238\000\000\000\000FX,F\000\000<n,F\000\000\000\000FX\000\000\"\212\000\000\152\198p\228sb\027\254\"\212{\168\"\212|$\"\212\136\188\"\212|\160\"\212}\028\"\212}\152\"\212~\020\"\212~\144\"\212\127\012\"\212\127\136\"\212\128\004\"\212\128\128\"\212\128\252\"\212\129x\"\212\129\244\"\212\130p\"\212\130\236\"\212\131h\"\212\131\228e\n\"\212\132`\132\220\"\212\133X\"\212\133\212\"\212\134P\"\212\134\204\000\000\"\212\000\000<\176@\246\000\000\000\000\000\000qp\"\212\144\220h\178\"\212\135H0\150\"\212\145Xi\140\"\212\135\196\"\2127@=6jf\"\212\136@k@\"\212\136\1886j\000\0005\2067\230f\128=\0027\140\000\000\000\000\000\0006jR\\=f6j\000\000<\130=l6j\000\000\000\000R\\\000\000\000\000\028\248\000\2489\188i$rnM\232Q\024;\166;\166=\200\000\000<\156;\166;\166>\162\000\000@j\000\000C\002\000\000\000\000E\130;\166;\166E\130<\160;\166;\166E\130\000\000E\130\000\000\000\000E\130\000\000\000\000\000\000<\2009\228,L=RM\232Q\024\000\0001^2\136,\182\029\242\000\000\142z7\230\030\236*J<\186\146\0209\158\000\0001\152\000\000;\166\000\0007vFX\000\000\031\2306j\000\0006jR\\\000\000@\246\000\000\000\000@\246\000\000\000\000\000\000\"\212\000\000\000\000\000\000<\236\"\212\145\196=x\000\000=|\000\000\000\000\000\000\000\0007\2165\026=\136\000\000 \224E\140b\152\000\000\000\000\000\000\000\000/\028\000\000\000\000\000\000\000\000\000\000=\140\000\0009\020FBe\188\000\000=\142\000\000b\152\000\000=V\000\000\149|Q\020\000\000\152\198M\024=h\000\000\000\000\149|\000\000\"\212\147\004\000\0009\188w\144+\174=\026\"\212\000\000\142z=\166\"\212\000\000\000\000=\136-\254\000\0037\178\"\212\000\0006j=\170\"\212\000\0007\148/(\142z=\140-\254\000\0039\186\"\212\000\000!\218\"\212\000\000\"\212\000\000#\206\"\212\000\000$\200\"\212\000\000%\194\000\000\000\000\000\000\000\0009\188\000\000\000\0004\142\"\212\147\128\000\000\"\2127@=\166\000\000\000\000\000\000&\188,\1945\2007\2307\212=\002=\182\000\000=\186\000\000-L=\186\000\000\"\212=\n\000\000k\222\000\000=\196\000\000-\022-\178=h\000\0005l\000\000=\212\000\000=\214\000\000\000\000\000\000\000\000\000\000=\216\000\0008\208=\002=\234\000\000=\238\000\000-L=\242\000\000\"\212=B\000\000l\018\000\000=\246\000\000-\022-\178=\140\000\0008j\000\000=\248\000\000=\250\000\000\"\212c^2\174>\002\000\000>Zy\142\000\000-\178=\148\000\000\000\000=P\000\000d*x\002BN=\002\000\000BN=\0022rBN=\002\000\000\000\000>\n\000\000+$\000\000=\002>\012\000\000>\022=\232\"\212|\160\"\212\133X\000\000\000\000=l\000\000-l=z\000\000=\248\000\0009H\000\000l\020\000\000>8\000\0000,>@\000\0001\026>\006\000\000K\1969\188\000\0009\212\000\000\156L\000\000\156L\000\000\000\000\000\000\000\000P\1569\188\000\0009\216\000\000>N\000\000QhQ\2249\188\000\0009\218\000\000>X\000\000\000\000>^\000\0009\1783,,\1823,\000\000\000\000>d\000\0003\240\000\0005\190\000\000\153\\\156\1705\190\000\000\000\0009\168\157\b\000\000>j\000\000\157f5\190\000\0005\190\000\0005\190\000\000<t5\190>x>x:\0305\190\000\0005\190\000\000>~5\190\000\000>|5\190\000\0005\190\000\0005\190\000\000\000\000\000\000d\1981\254\157f\158\252<t\000\000\000\000N`2\b\000\0009\156\000\000N`\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000d\198\000\000O,d.O\128,L\000\000:\030\000\000\000\000\000\000\000\000:\030\000\000\000\000\000\000\000\000i$w\208M\232Q\024\000\000=\234:Z,L>|M\232Q\024\000\000>\144\000\0008\188\000\000\000\000,T\000\000\157\196+h>\012\"\212\147\252\000\000q\252'\182\"\2128\2240.\000\000:\150>\146\000\000>\156\000\000>\172\000\000>\174\000\000>\176\000\000\160\004(\176-\176)\170\152\198?4>\184\000\000>\196\000\000\152\198r\214>8\000\000\000\000J\022>:\000\000\000\000\146\020\000\000>B\000\000\"\212\000\000\138N\000\000w\1444\180\000\000\000\000Bv,\182g\206\000\000\000\000\000\000\000\000\000\0007\216\000\000\000\000\000\000>\212\000\000>\214\000\000\000\000C0\000\000\000\000\000\0002vC0\000\0009~C0\000\000\000\000\000\000\000\000"), (16, "\t\213\000\238\t\213\t\213\000\250\t\213\001f\t\213\002V\002>\t\213\t\213\t\213\002\142\t\213#\178\t\213\t\213\t\213\t\213\t\213\t\213\t\213\020\226\t\213\t\213\t\213\t\213\t\213\t\213\024\014\024\018\002~\t\213\t\213\002\230\002\234\000\n\t\213\t\189\t\213\t\213\t\213\002\130\t\213\t\213\030\182\t\213\002\238\002\242\002\246#\182\030\186\t\213\t\213\002b\002\150\t\213\002\186\t\166\001\170\002\198\t\213\003&\002.\003>\003V\000\246\003b\003f\024\"\024*\t\213\t\213\t\213\t\213\t\213\t\213\t\213\003\134\t\213\t\213\t\213\t\213\t\213\011\198\011\250\003j\003n\t\213\019\182\012\014\t\213\t\213\t\213\t\213\t\213\t\213\t\213#\186\t\213\t\213\t\213\005b\t\213\024\182\t\213\t\213\t\213\t\213\t\213\t\213\t\213\003r\t\213\t\213\t\213\t\213\012Z\003v\012^\006Y\t\213\t\213\t\213\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\001\182\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\b\217\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\003\"\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\003\214\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\002.\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\005b\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\001\018\001\022\by\by\by\by\by\by\by\by\by\by\by\by\by\by\001b\by\by\by\by\by\by\001\134\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\001\130\002\"\by\by\by\by\by\by\by\by\001\170\002&\002*\by\002.\005\026\by\005\030\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\005b\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\n\138\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\n\158\nq\nq\nq\nq\nq\nq\nq\nq\nq\nq\011*\nq\nq\nq\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\b\214\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\012\138\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\r\202\r\218\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\r\226\004U\004U\004U\004U\r\234\014\002\014\n\r\242\014\018\004U\004U\004U\004U\004U\004U\004U\004U\004U\014\026\014\"\004U\004U\004U\004U\004U\004U\004U\014*\014B\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\r\210\r\250\0142\014:\014J\004U\004U\004U\004U\014R\014Z\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\004U\001\014\014\130\004U\004\230\004U\004U\004U\004U\014j\004U\004U\004U\004U\004U\004U\014r\014z\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\004\238\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\b\230\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\015\161\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\0186\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\r\202\r\218\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\r\226\005\181\005\181\005\181\005\181\r\234\014\002\014\n\r\242\014\018\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\014\026\014\"\005\181\005\181\005\181\005\181\005\181\005\181\005\181\014*\014B\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\r\210\r\250\0142\014:\014J\005\181\005\181\005\181\005\181\014R\014Z\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\005\181\014\130\005\181\005\181\005\181\005\181\005\181\005\181\014j\005\181\005\181\005\181\005\181\005\181\005\181\014r\014z\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\r\202\r\218\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\r\226\005\173\005\173\005\173\005\173\r\234\014\002\014\n\r\242\014\018\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\014\026\014\"\005\173\005\173\005\173\005\173\005\173\005\173\005\173\014*\014B\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\r\210\r\250\0142\014:\014J\005\173\005\173\005\173\005\173\014R\014Z\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\005\173\014\130\005\173\005\173\005\173\005\173\005\173\005\173\014j\005\173\005\173\005\173\005\173\005\173\005\173\014r\014z\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\r\202\r\218\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\r\226\005\169\005\169\005\169\005\169\r\234\014\002\014\n\r\242\014\018\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\014\026\014\"\005\169\005\169\005\169\005\169\005\169\005\169\005\169\014*\014B\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\r\210\r\250\0142\014:\014J\005\169\005\169\005\169\005\169\014R\014Z\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\005\169\014\130\005\169\005\169\005\169\005\169\005\169\005\169\014j\005\169\005\169\005\169\005\169\005\169\005\169\014r\014z\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\r\202\r\218\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\r\226\005\161\005\161\005\161\005\161\r\234\014\002\014\n\r\242\014\018\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\014\026\014\"\005\161\005\161\005\161\005\161\005\161\005\161\005\161\014*\014B\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\r\210\r\250\0142\014:\014J\005\161\005\161\005\161\005\161\014R\014Z\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\005\161\014\130\005\161\005\161\005\161\005\161\005\161\005\161\014j\005\161\005\161\005\161\005\161\005\161\005\161\014r\014z\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\r\202\r\218\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\r\226\005\177\005\177\005\177\005\177\r\234\014\002\014\n\r\242\014\018\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\014\026\014\"\005\177\005\177\005\177\005\177\005\177\005\177\005\177\014*\014B\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\r\210\r\250\0142\014:\014J\005\177\005\177\005\177\005\177\014R\014Z\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\005\177\014\130\005\177\005\177\005\177\005\177\005\177\005\177\014j\005\177\005\177\005\177\005\177\005\177\005\177\014r\014z\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\012\166\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\003\226\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\015\193\t\213\t\213\t\213\t\213\020\186\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\020\226\t\213\t\213\t\213\t\213\t\213\t\213\020\230\020\250\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\166\t\213\t\213\t\213\t\213\002.\t\213\t\213\t\213\t\213\t\213\t\213\021\014\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\021R\t\213\005b\t\213\021V\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\021j\t\213\t\213\t\213\t\213\020\186\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\020\226\t\213\t\213\t\213\t\213\t\213\t\213\020\230\020\250\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\166\t\213\t\213\t\213\t\213\002.\t\213\t\213\t\213\t\213\t\213\t\213\021\014\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\005b\t\213\021V\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\021j\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\021\194\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\217\t\217\t\217\t\217\020\186\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\020\230\020\250\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\166\t\217\t\217\t\217\t\217\002.\t\217\t\217\t\217\t\217\t\217\t\217\021\014\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\005b\t\217\021V\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\213\t\213\t\213\t\213\020\186\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\020\226\t\213\t\213\t\213\t\213\t\213\t\213\020\230\020\250\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\166\t\213\t\213\t\213\t\213\002.\t\213\t\213\t\213\t\213\t\213\t\213\021\014\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\005b\t\213\021V\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\000\250\t\213\001f\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\020\226\t\213\t\213\t\213\t\213\t\213\t\213\024\014\024\018\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\024\022\001j\024\030\t\213\t\213\t\213\t\213\t\213\t\213\t\166\001\170\t\213\t\213\t\213\002.\t\213\t\213\024\026\t\213\t\213\024\"\024*\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\012\150\t\213\t\213\t\213\t\213\t\213\012\154\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\005b\t\213\024\182\t\213\t\213\t\213\t\213\t\213\t\213\0242\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\006Y\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\025\150\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\217\t\217\t\217\t\217\000\250\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\024\014\024\018\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\166\t\217\t\217\t\217\t\217\002.\t\217\t\217\t\217\t\217\t\217\024\"\024*\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\005b\t\217\024\182\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\213\t\213\t\213\t\213\000\250\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\020\226\t\213\t\213\t\213\t\213\t\213\t\213\024\014\024\018\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\166\t\213\t\213\t\213\t\213\002.\t\213\t\213\t\213\t\213\t\213\024\"\024*\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\005b\t\213\024\182\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\by\by\by\by\by\by\001f\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\024\022\001j\by\by\by\by\by\by\by\by\001\170\by\by\by\002.\by\by\024\026\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\012\150\by\by\by\by\by\012\154\by\by\by\by\by\by\by\by\by\by\by\005b\by\by\by\by\by\by\by\by\0242\by\by\by\by\by\by\by\by\by\by\by\by\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\026\246\026\254\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\027\006\015e\015e\015e\015e\027\022\027\030\027&\027.\0276\015e\015e\015e\015e\015e\015e\015e\015e\015e\027>\027F\015e\015e\015e\015e\015e\015e\015e\027N\027V\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\027^\027f\027n\027v\027~\015e\015e\015e\015e\027\134\027\142\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\015e\027\158\015e\015e\015e\015e\015e\015e\027\166\015e\015e\015e\015e\015e\015e\027\174\027\182\015\213\000\006\015\213\015\213\015\213\015\213\001f\028\146\0026\002>\015\213\015\213\015\213\003\230\015\213\002B\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\002~\015\213\015\213\002\230\002\234\000\n\015\213\023B\015\213\015\213\015\213\002\130\015\213\015\213\029>\015\213\002\238\002\242\018\n\0182\029R\015\213\015\213\002b\002\150\015\213\002\186\t\166\001\170\002\198\015\213\003&\015\213\003>\003V\000\246\019&\003f\015\213\015\213\015\213\015\213\015\213\015\213\015\213\029V\015\213\0196\015\213\015\213\015\213\015\213\015\213\019R\019f\003j\003n\029^\029z\020\026\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\015\213\029\130\003r\015\213\015\213\015\213\015\213\026\222\003v\026\230\015\213\015\213\015\213\015\213\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\004\238\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\b\230\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\165\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\012\166\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\003\226\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015\197\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\026\246\026\254\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\027\006\015i\015i\015i\015i\027\022\027\030\027&\027.\0276\015i\015i\015i\015i\015i\015i\015i\015i\015i\027>\027F\015i\015i\015i\015i\015i\015i\015i\027N\027V\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\027^\027f\027n\027v\027~\015i\015i\015i\015i\027\134\027\142\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\015i\027\158\015i\015i\015i\015i\015i\015i\027\166\015i\015i\015i\015i\015i\015i\027\174\027\182\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\030\014\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\031\030\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\217\000\238\t\217\t\217\t\217\t\217\001f\t\217\002V\002>\t\217\t\217\t\217\002\142\t\217\002B\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\002~\t\217\t\217\002\230\002\234\000\n\t\217\t\189\t\217\t\217\t\217\002\130\t\217\t\217\030\182\t\217\002\238\002\242\002\246\003\030\030\186\t\217\t\217\002b\002\150\t\217\002\186\t\217\001\170\002\198\t\217\003&\002.\003>\003V\000\246\003b\003f\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\003\134\t\217\t\217\t\217\t\217\t\217\011\198\011\250\003j\003n\t\217\019\182\012\014\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\005b\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\t\217\003r\t\217\t\217\t\217\t\217\012Z\003v\012^\t\217\t\217\t\217\t\217\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\r\202\r\218\t\213\t\213\t\213\t\213\t\213\0312\t\213\t\213\t\213\t\213\t\213\r\226\t\213\t\213\t\213\t\213\r\234\014\002\014\n\r\242\014\018\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\014\026\014\"\t\213\t\213\t\213\t\213\t\213\t\213\t\213\014*\014B\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\r\210\r\250\0142\014:\014J\t\213\t\213\t\213\t\213\014R\014Z\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\014\130\t\213\t\213\t\213\t\213\t\213\t\213\014j\t\213\t\213\t\213\t\213\t\213\t\213\014r\014z\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\r\202\r\218\t\213\t\213\t\213\t\213\t\213\031>\t\213\t\213\t\213\t\213\t\213\r\226\t\213\t\213\t\213\t\213\r\234\014\002\014\n\r\242\014\018\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\014\026\014\"\t\213\t\213\t\213\t\213\t\213\t\213\t\213\014*\014B\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\r\210\r\250\0142\014:\014J\t\213\t\213\t\213\t\213\014R\014Z\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\t\213\014\130\t\213\t\213\t\213\t\213\t\213\t\213\014j\t\213\t\213\t\213\t\213\t\213\t\213\014r\014z\by\000\238\by\by\by\by\001f\by\002V\002>\by\by\by\002\142\by\002B\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\by\002~\by\by\002\230\002\234\by\by\by\by\by\by\002\130\by\by\by\by\002\238\002\242\002\246\003\030\by\by\by\002b\002\150\by\002\186\by\001\170\002\198\by\003&\002.\003>\003V\000\246\003b\003f\by\by\by\by\by\by\by\by\by\003\134\by\by\by\by\by\011\198\011\250\003j\003n\by\by\012\014\by\by\by\by\by\by\by\by\by\by\by\005b\by\by\by\by\by\by\by\by\by\003r\by\by\by\by\012Z\003v\012^\by\by\by\by\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\031\146\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\003\"\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\0055\017U\017U\017U\0055\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M#\254\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\002M\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\0059\017U\017U\017U\0059\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\017U\012M\t\150\006\201\012M\012M\004\154\002^\025\002\017e\012M\012M\012M\017e\012M\012M\012M\001\014\012M\012M#\154\012M\012M\001\014\012M\005*\004\230\012M\012M\012M\012M\012M\012M\012M\001\198\001\022\001v\t\169\012M\007\n\001v\006\214\012M\012M\012M\003~\012M\n\r\012M\012M\012M\012M\012M\012M\001\n\012M\002\198\001\202\012M\012M\012M\003V\000\246\004\"\012M\001\210\t\230\012M\012M\012M\012M\012M\n\r\n\133\002.\012M\012M\012M\001\226\n%\001\"\001z\012M\012M\003\218\002^\006\201\012M\000\234 \250\012M\017n\012M\012M\018\246 6\012M B\012M N ^ n\012M\012M\012M\000\246\012M\001&\012M\005*\012M\012M\012M\005b\012M\012\166\001Z\012M\012M\012M\012\245\006a\017m\012\245\012\245\000q\017m\004&\004*\012\245\012\245\012\245\003\226\012\245\012\245\012\245\017\202\012\245\012\245\001f\012\245\012\245\n\133\012\245\b\245\006&\012\245\012\245\012\245\012\245\012\245\012\245\012\245\t\234\t\141\b\222\n\133\012\245\002.\001v\n\194\012\245\012\245\012\245\003~\012\245\n\202\012\245\012\245\012\245\012\245\012\245\012\245\t\141\012\245\002\198 \254\012\245\012\245\012\245\003V\000\246\001\214\012\245\t\002\001\002\012\245\012\245\012\245\012\245\012\245\b9\n%\005\170\012\245\012\245\012\245\005b\014\254\t\141\015\n\012\245\012\245\012\142\002^\001\218\012\245\018\246\000q\012\245\001^\012\245\012\245\020n\014\166\012\245\015*\012\245\0156\015F\015b\012\245\012\245\012\245\b\245\012\245\n-\012\245\006*\012\245\012\245\012\245\011\178\012\245\t\181\n\158\012\245\012\245\012\245\012\241\t\169\000m\012\241\012\241\001r\t\165\011*\006q\012\241\012\241\012\241\n\202\012\241\012\241\012\241\t\169\012\241\012\241\001\002\012\241\012\241\017\129\012\241\004\254\b9\012\241\012\241\012\241\012\241\012\241\012\241\012\241\001\138\t\141\017\246\001\166\012\241\002.\001v\t\181\012\241\012\241\012\241\003~\012\241\ta\012\241\012\241\012\241\012\241\012\241\012\241\t\141\012\241\002\198\007\145\012\241\012\241\012\241\003V\000\246\001f\012\241\007\145\002>\012\241\012\241\012\241\012\241\012\241\005z\t:\001\246\012\241\012\241\012\241\005b\001\142\t\141\001f\012\241\012\241\031\150\002^\000m\012\241\0036\002\218\012\241\001\190\012\241\012\241\001f\031\182\012\241\031\194\012\241\031\206\031\222\031\238\012\241\012\241\012\241\004\194\012\241\019\194\012\241\001\022\012\241\012\241\012\241\005\145\012\241\012\230\n=\012\241\012\241\012\241\rE\005~\003\170\rE\rE\004\130\030\n\003Z\tI\rE\rE\rE\006Q\003\166\rE\rE#N\rE\rE\t\002\rE\rE\0116\rE\t\026\003n\rE\004^\rE\rE\rE\rE\rE\016\190\002\202\016\210 \162\rE\022\146\001v\t*\004b\rE\rE\004j\rE\t\253\rE\rE\rE\rE\rE\rE\t\194\rE\002\198\006Q\rE\rE\012n\003V\000\246\001\230\rE\n=\002\210\rE\rE\rE\rE\rE\t\198\t\253\005\145\rE\rE\rE\nB\nM\n=\tQ\rE\rE\012\142$\002\001\234\rE\011~\n5\rE\007\150\rE\rE\001f\014\166\017\n\015*\rE\0156\015F\015b\rE\rE\rE\004\149\rE\0036\rE\t\237\rE\rE\rE\t\237\rE\t\165\n\202\rE\rE\rE\012\157\t\169\t\165\012\157\012\157\011\206\t\206\007\005\006\025\012\157\012\157\012\157\004\149\003\166\012\157\012\157\003^\012\157\012\157\t\002\012\157\012\157\015N\012\157\t\210\006&\012\157\004^\012\157\012\157\012\157\012\157\012\157\017\014\002j\017\026\011\233\012\157\002.\011\233\011\233\004b\012\157\012\157\004j\012\157\002.\012\157\012\157\012\157\012\157\012\157\012\157\001\014\012\157\002\198\004\230\012\157\012\157\012n\003V\000\246\003.\012\157\006\025\012V\012\157\012\157\012\157\012\157\012\157\b\202\017\194\b\249\012\157\012\157\012\157\005b\n2\t\181\004\238\012\157\012\157\n\026\0172\005b\012\157\024\170\007\005\012\157\006J\012\157\012\157\t\141\023R\017\n\007\005\012\157\n\202\006\166\000!\012\157\012\157\012\157\012\166\012\157\b\230\012\157\011\233\012\157\012\157\012\157\t\141\012\157\000\n\t\253\012\157\012\157\012\157\012I\n5\003\226\012I\012I\t\181\030*\006V\nE\012I\012I\012I\0069\012I\012I\012I\0069\012I\012I\t\141\012I\012I\t\189\012I\t\165\nE\012I\012I\012I\012I\012I\012I\012I\001\154\b\249\030\254\011\237\012I\006Z\011\237\011\237\012I\012I\012I\003~\012I\rz\012I\012I\012I\012I\012I\012I\002\218\012I\002\198\024\218\012I\012I\012I\003V\000\246\b9\012I\005\141\t\253\012I\012I\012I\012I\012I\003R\007\177\029z\012I\012I\012I\rZ\001\142\t\253\004\238\012I\012I\007\150\n5\001\014\012I\001\170\004\230\012I\t\181\012I\012I\011\226\004\238\012I\0069\012I\012\166\015\190\015\222\012I\012I\012I\006f\012I\b\230\012I\011\237\012I\012I\012I\000\n\012I\012\230\003\226\012I\012I\012I\012\137\t\181\006\205\012\137\012\137\001:\nE\011\186\000\246\012\137\012\137\012\137\006Q\003\166\012f\012z\t\181\012\137\012\137\004\254\012\137\012\137#\198\012\137\024\222\005\141\012\137\004^\012\137\012\137\012\137\012\137\012\137\005:\018r\n\202\007\177\012\137\023\182\020\182\012\178\004b\012\137\012\137\004j\012\137\t\181\012\137\012\137\012\137\012\137\012\137\012\137\001f\012\137\002\198\006Q\012\137\012\137\012n\003V\000\246\006q\012\137\002\218\021\246\012\137\012\137\012\137\012\137\012\137\n\029\b=\nE\012\137\012\137\012\137\001\198\006q\001\"\t\029\012\137\012\137\t\029\t\029\006\205\012\137\b\254\001>\012\137\rV\012\137\012\137\n\158\002\218\017\n\t\169\012\137\t\002\001\190\001\202\012\137\012\137\012\137\011*\012\137\b\209\012\137\001\210\012\137\012\137\012\137\027\250\012\137\028\014\007\001\012\137\012\137\012\137\r1\001&\001\226\r1\r1\007\249\003B\t2\019\158\r1\r1\r1\006A\0046\004V\014\214\006A\r1\r1\012\018\r1\r1\003\246\r1\0119\004\250\r1\014\222\r1\r1\r1\r1\r1\t\029\t\141\029B\0069\r1\001\022\b\214\0069\014\226\r1\r1\r1\r1\005\162\r1\r1\r1\r1\r1\r1\t\141\r1\r1\t]\r1\r1\014\238\r1\r1\018\194\r1\012\022\002^\r1\r1\r1\r1\r1\004\002\019\166\004\185\r1\r1\r1\007\001\019\162\t\141\bq\r1\r1\bq\bq\007\001\r1\n\202\007\249\r1\014\190\r1\r1\005\"\015E\014\250\006A\r1\001\162\012\234\015\250\r1\r1\r1\0119\r1\t\169\r1\007>\r1\r1\r1\bi\r1\000\238\b\250\r1\r1\r1\001f\0069\002V\002>\015\234\016J\tF\002\142\t\165\002B\002\170\002\174\t\221\001J\b\214\t\221\t\221\000]\002\178\b%\000]\000]\b%\b%\012\250\001\142\002\182\002\250\002\254\003\002\003\006\003\n\003\014\bq\001\170\004&\014\194\002\130\002.\002\030\003\018\004\238\r\134\r\138\002\246\003\030\016\133\005&\006\146\002b\002\150\004\158\r\142\t\221\001\170\002\198\007*\003&\002.\003>\003V\000\246\003b\003f\t\205\020~\004\166\004\170\004\174\004\178\004\182\007\189$\202\003\134\001f\004\186\004\190\005b\b\250\011\198\011\250\003j\003n\015f\t\221\012\014\020\190\t\194\015\238\000]\007\133\b%\t\221\n\026\t\221\015~\001>\005b\017\250\bZ\t\221\t\165\007\181\004\198!\n\t\198\t\221\003r\001R\t\205\004\202\t\221\r\146\003v\012^\000\238\br\004\210\004\214\t\002\001f\b\250\002V\002>\004\222\005m\006I\002\142\020\198\002B\002\170\002\174\007\205\007\205\bA\007\205\007\205\005\205\002\178\022z\005\205\005\205\011\165\011\165$\231\007\253\002\182\002\250\002\254\003\002\003\006\003\n\003\014\bv\007\189 \222\t\165\002\130\005.\007\205\003\018\0115\r\134\r\138\002\246\003\030\b\193\015\130\001\022\002b\002\150\004\158\r\142\007\205\001\170\002\198\007\205\003&\002.\003>\003V\000\246\003b\003f\r\190\007\181\004\166\004\170\004\174\004\178\004\182\001>\t\165\003\134\011\242\004\186\004\190\r\249\b~\011\198\011\250\003j\003n\011\217\007\205\012\014\011\217\011\217\005m\005\205\b\214\011\165\007\205\021\018\r\249\018R\007\205\005b\005J\001&\007\205\r\249\001\170\004\198\018\014\r\249\002.\003r\007\253\020\182\004\202\007\205\r\146\003v\012^\000\238\022\n\004\210\004\214\002\002\001f\0115\002V\002>\016\n\007N\t\165\002\142\t\165\002B\002\170\002\174\007\233\007\233\b\250\007\233\007\233\n%\n%!\246\n%\n%\006\201\000\254\b\178\005b\002\182\002\250\002\254\003\002\003\006\003\n\003\014\004\238\001v\011\217\t\165\002\130\b\005\012\166\003\222\b\214\r\134\r\138\002\246\003\030\t\165\023\246\015\233\002b\002\150\004\158\r\142\007\233\001\170\002\198\003\226\003&\002.\003>\003V\000\246\003b\003f\t\245\nM\004\166\004\170\004\174\004\178\004\182\nM\000\225\003\134\006\245\004\186\004\190\022\162\n\142\011\198\011\250\003j\003n\001f\007\233\012\014\015\233\n%\015\238\005\242\t\245\011:\007\233\011F\t\169\011V\007\233\005b\016\129\005\158\007\233\n%\018\246\004\198\015\233\006\201\020\130\003r\023\254\n%\004\202\007\233\r\146\003v\012^\000\238\006z\004\210\004\214\020\134\001f\b\005\002V\002>\t\165\015\233\007Z\002\142\t\002\002B\002\170\002\174\007\225\007\225\006\253\007\225\007\225\005\197\b\202\015\233\005\197\005\197\031j\015\190\031v\006\178\002\182\002\250\002\254\003\002\003\006\003\n\003\014\001v\006\245\t\169\005Z\002\130\015\150\012\166\012\146\011\194\r\134\r\138\002\246\003\030\001v\018f\015\237\002b\002\150\004\158\r\142\007\225\001\170\002\198\003\226\003&\002.\003>\003V\000\246\003b\003f\n\021\n\193\004\166\004\170\004\174\004\178\004\182$k\000\225\003\134\001f\004\186\004\190\004\154\002^\011\198\011\250\003j\003n\015f\007\225\012\014\015\237\007v\tf\005\197\n\021\t\014\007\225\n\202\006\253\031\242\007\225\005b\015\174\001&\007\225\005^\016\137\004\198\015\237\020n\nM\003r\025f\020r\004\202\007\225\r\146\003v\012^\000\238\022R\004\210\004\214\t\002\001f\005\214\002V\002>\016V\015\237\003Z\002\142\t\165\002B\002\170\002\174\t\221\001\142\0069\t\221\t\221\005\233\0069\015\237\005\233\005\233\006\002\t\206\021\030\006\178\002\182\002\250\002\254\003\002\003\006\003\n\003\014\017\129\nM\t\169\n\202\002\130\012\n\005\022\031\154\t\210\r\134\r\138\002\246\003\030\000\029\015\130\026j\002b\002\150\004\158\r\142\t\221\001\170\002\198\007*\003&\002.\003>\003V\000\246\003b\003f\003\226\t\245\004\166\004\170\004\174\004\178\004\182\t\165\n\005\003\134\016b\004\186\004\190\n\202\t\165\011\198\011\250\003j\003n\006\n\t\221\012\014\001\162\012\234\015\238\005\233\028>\t\245\t\221\001\014\t\221\006\026\024\230\005b\0069\011U\t\221\b\202\016\130\004\198\r\018\012\246\t\221\003r\028F\023\254\004\202\t\221\r\146\003v\012^\000\133\022\190\004\210\004\214\000\133\000\133\000\133\000\133\000\133\016\142\012\230\n.\000\133\t\165\000\133\012\166\012\250\001\142\024\n\015j\000\133\0066\011U\015n\000\133\000\133\001\170\006Q\000\133\020~\002.\000\133\003\226\004\238\000\133\000\133\000\133\n\005\000\133\n\222\011U\015\194\000\133\015\238\026*\000\133\006I\000\133\000\133\000\133\000\133\000\133\t\165\006Q\000\133\000\133\006N\000\133\000\133\000\133\000\133\011U\000\133\000\133\000\133\000\133\000\133\000\133\000\133\005b\001\189\006Q\006I\016\154\001\189\011U\000\133\t\165\000\133\004\253\b\250\006\194\006\142\000\246\000\133\000\133\000\133\000\133\000\133\000\133\000\133\002f\006\154\015\238\t\165\006\145\006\145\020n\006\145\006\145\000\218\023\158\000\133\nU\nU\b\250\nU\nU\017z\t\165\000\133\000\133\000\133\002n\003\173\022\234\000\133\000\133\000\133\000\133\003\173\003\173\001\130\003\166\012f\012z\t\165\003\173\003\173\020\"\003\173\003\173\002\222\003\173\022\238\002r\006\145\004^\003\173\003\173\003\173\003\173\003\173\004\253\004\253\017\129\t!\030\222\020*\t!\t!\004b\003\173\003\173\004j\002v\001f\015\238\019v\022\242\022\250\003\173\003\173\001\"\n\202\002\198\003e\006\145\003\173\012n\003V\000\246\003\226\nU\015\018\006\145\003\173\003\173\003\173\003\173\003\173\026\018\015\138\006\145\003\173\003\173\003\173\nU\nU\015\162\006\162\012\166\012.\006\145\006\145\nU\003\173\n\202\028>\003\173\003\022 \134\003\173\006\254\022\246\017\n\016\022\003\173\003\226\012\214\001\170\003\173\003\173\003\173\002.\003\173\007:\003\226\t!\003\173\003\173\003\173\001f\012e\b\214\b\214\003\173\003\173\003\173\012e\012e\015f\012e\012e\012e\012\150\012e\012e\003e\012e\012e\012\154\012e r\029\254\019\022\012e\012e\012e\012e\012e\012e\031\162\005b\007J\011\221\025R\b\250\011\221\011\221\012e\012e\012e\012e\001\162\012\234\015\186\t\002\026\022\n\202\012e\012e\b\165\b\250\012e\b\165\b\165\012e\012e\012e\012e\b\001\r&\r.\t\165\012e\012e\012e\012e\012e\007f\020V\rN\012e\012e\012e\011\253\016>#\194\011\253\011\253\016j\t\165\007n\025b\012e\016\178\t\165\012e\012\250\001\142\012e\007\138\002.\012e\015\130\012e\012\166\001\190\001\170\012e\012e\012e\002.\012e\t\165\004\238\011\221\012e\012e\012e\001&\012i\b\214\003\226\012e\012e\012e\012i\012i\023\134\012i\012i\012i\b\165\012i\012i\007\186\012i\012i\021\230\012i\005b!J\001\197\012i\012i\012i\012i\012i\012i\020Z\005b\023\014\b\001\r*\007\222\r:\011\253\012i\012i\012i\012i\001\162\012\234\r*\023.$\214 \"\012i\012i\b\173#\202\012i\b\173\b\173\012i\012i\012i\012i\020\162\001\190\t\169\029n\012i\012i\012i\012i\012i\t\165\007\198\025\194\012i\012i\012i\b\225\006y\031\018\030J\007\242\023\138\001&\031^\b*\012i\016\202\018f\012i\012\250\001\142\012i\bb\002.\012i!\134\012i!\182!\214\001\170\012i\012i\012i\002.\012i!N\004\238\028\154\012i\012i\012i\"v\012m\b\150\"~\012i\012i\012i\012m\012m$\227\012m\012m\012m\b\173\012m\012m\029*\012m\012m\r\245\012m\005b!\242\029r\012m\012m\012m\012m\012m\012m\001&\005b\b\174\b\186\001\014\007\222\r\245\018\186\012m\012m\012m\012m\"6\r\245\"\134\b\214\"\198\r\245\012m\012m\b\169\b\150\012m\b\169\b\169\012m\012m\012m\012m\"\146\t\181#\030\030\166\012m\012m\012m\012m\012m\t\n\015\190\t6\012m\012m\012m\030\166#j\030\166\030\166\tb\tv\t\158\t\169\"\158\012m\016\226\t\226\012m\005\018\n\018\012m\007\174\002.\012m\n\182\012m\n\234\n\254\011\n\012m\012m\012m\011\022\012m\011B\"\166\t\181\012m\012m\012m\011R\012]\"\198\011^\012m\012m\012m\012]\012]\011r\012]\012]\012]\b\169\012]\012]\011\138\012]\012]\011\158\012]\005b\007\182\011\166\012]\012]\012]\012]\012]\012]\011\170\011\214\011\222\012\002\012:\007\222\002.\007\194\012]\012]\012]\012]\012J\012~\002\218\012\202\r\006\r\n\012]\012]\b\161\rF\012]\b\161\b\161\012]\012]\012]\012]\rb\007\206\rn\r\130\012]\012]\012]\012]\012]\014\162\014\182\014\202\012]\012]\012]\014\218\005b\015\030\0152\015B\015Z\016.\0166\007\214\012]\016\238\016\222\012]\019\186\017&\012]\019\202\002.\012]\017:\012]\017\162\017\182\017\214\012]\012]\012]\018\018\012]\018\022\018.\018Z\012]\012]\012]\018\154\004=\018\174\018\206\012]\012]\012]\004=\004=\018\214\003\166\012f\012z\b\161\004=\004=\018\226\004=\004=\018\234\004=\005b\019\214\019\006\004^\004=\004=\004=\004=\004=\019n\019\150\019\218\019\234\0202\007\222\002.\019\230\004b\004=\004=\004j\020N\020z\020\142\020\174\020\214\020\218\004=\004=\006\005\b\250\002\198\006\005\006\005\004=\012n\003V\000\246\020\238\019\246\020\242\021\002\004=\004=\004=\004=\004=\021\006\021\026\021:\004=\004=\004=\012\001\005b\021^\012\001\012\001\021\138\021\142\"f\020\002\004=\"\022\021\158\004=\021\162\021\222\004=\021\242\002.\017\n\022\022\004=\022.\0226\022F\004=\004=\004=\022^\004=\022\194\022\206\022\210\004=\004=\004=\023*\003\145\0236\023f\004=\004=\004=\003\145\003\145\023~\003\166\012f\012z\006\005\003\145\003\145\"j\003\145\003\145\027\206\003\145\005b\015]\015]\004^\003\145\003\145\003\145\003\145\003\145\002.\"n\023\242\024J\024R\b\026\024v\012\001\004b\003\145\003\145\004j\024\134\001\154\024\138\024\154\024\158\024\174\003\145\003\145\024\226\024\242\002\198\024\254\"R\003\145\012\130\003V\000\246\025\014\025V\025Z\025r\003\145\003\145\003\145\003\145\003\145\025\182\005b\025\210\003\145\003\145\003\145\025\230\026\n\"Z\026\030\026&\026V\026f\026\138\026\154\003\145\026\174\026\202\003\145\001\158\001\142\003\145\028\026\015]\016\186\028f\003\145\028r\028v\001\170\003\145\003\145\003\145\002.\003\145\028\190\004\238\028\246\003\145\003\145\003\145\029&\003\185\0292\029f\003\145\003\145\003\145\003\185\003\185\029\214\003\166\012f\012z\029\226\003\185\003\185\029\234\003\185\003\185\030\006\003\185\030B\030Z\030j\004^\003\185\003\185\003\185\003\185\003\185\030\134\005b\030\178\030\194\030\210\030\238\031\006\031\130\004b\003\185\003\185\004j\031\170\001\022\031\178\004\213\031\190\031\202\003\185\003\185\b\133\031\218\002\198\b\133\b\133\003\185\012n\003V\000\246\031\234\031\250 \002 \026\003\185\003\185\003\185\003\185\003\185 *\004\213 2\003\185\003\185\003\185 > J Z j z \130 \150 \174 \186\003\185 \242!\006\003\185\005J\021\018\003\185!\014\002.\017\n!\018\003\185\001\026!.\001\170\003\185\003\185\003\185\002.\003\185!:\020\182!B\003\185\003\185\003\185!Z\004A!f!r\003\185\003\185\003\185\004A\004A!\190\003\166\012f\012z\b\133\004A\004A!\222\004A\004A!\234\004A\005b\"\n\"B\004^\004A\004A\004A\004A\004A\"&\005b\"J\"\138\"\150\028\170#f\007\133\004b\004A\004A\004j#r\004\213#\130#\166#\210\012\238\004A\004A\b\141#\218\002\198\b\141\b\141\004A\012n\003V\000\246#\226#\234#\242$\018\004A\004A\004A\004A\004A$\026$+$;\004A\004A\004A$O$\167$\175\000\000\000\000\000\000\000\000\000\000\000\000\004A\000\000\000\000\004A\000\000\000\000\004A\000\000\002.\017\n\000\000\004A\000\000\000\000\000\000\004A\004A\004A\000\000\004A\000\000\000\000\000\000\004A\004A\004A\000\000\003\181\000\000\000\000\004A\004A\004A\003\181\003\181\000\000\003\166\012f\012z\b\141\003\181\003\181\000\000\003\181\003\181\000\000\003\181\005b\000\000\000\000\004^\003\181\003\181\003\181\003\181\003\181\000\000\000\000\000\000\000\000\000\000\028\170\000\000\000\000\004b\003\181\003\181\004j\000\000\000\000\000\000\000\000\000\000\000\000\003\181\003\181\000\000\000\000\002\198\000\000\000\000\003\181\012n\003V\000\246\000\000\000\000\000\000\000\000\003\181\003\181\003\181\003\181\003\181\000\000\000\000\000\000\003\181\003\181\003\181\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\181\000\000\000\000\003\181\000\000\000\000\003\181\000\000\nM\017\n\000\000\003\181\000\000\000\000\000\000\003\181\003\181\003\181\000\000\003\181\000\000\000\000\000\000\003\181\003\181\003\181\000\000\002B\000\000\000\000\003\181\003\181\003\181\000\014\000\018\000\022\000\026\000\030\000\000\000\"\000&\000*\000.\0002\000\000\0006\000:\000>\t\190\000\000\000\000\000B\nM\nM\000\000\000\000\t\221\000\000\000F\t\221\t\221\t\202\nM\000\000\000J\000\000\nM\000\000\000\000\nM\000\000\000N\000R\000V\000Z\000^\000b\000\000\000f\000j\000\000\003f\000\000\005\022\000n\000r\b\137\nM\000\000\b\137\b\137\0165\000\000\nM\0165\0165\000\000\t\221\000\000\003j\007*\000v\005\006\000z\000~\nM\000\000\000\000\000\000\000\000\000\130\000\134\000\138\000\000\nM\000\000\000\142\000\146\000\150\000\154\b\202\000\158\000\162\000\166\000\000\003r\019\190\002.\t\221\000\170\000\174\000\178\0165\000\000\000\006\000\182\t\221\000\186\000\190\001f\001\178\0026\002>\000\000\t\221\000\194\003\230\000\198\002B\000\000\t\221\000\000\000\000\000\202\000\206\000\210\000\000\000\000\b\137\015Y\015Y\002\022\t\174\0165\000\000\002~\005b\000\000\002\230\002\234\000\n\0165\b\198\0165\000\000\000\000\002\130\000\000\000\000\017\242\028\170\002\238\002\242\018\n\0182\018>\000\000\000\000\002b\002\150\0165\002\186\t\166\001\170\002\198\000\000\003&\002.\003>\003V\000\246\019&\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\019.\000\000\0196\000\000\000\000\000\000\000\000\000\000\019R\019f\003j\003n\019\142\019\182\020\026\000\000\000\000\000\000\015Y\000\000\005\"\t\178\001f\011\210\000\000\002>\005b\011\218\000\000\000\000\000\000\002B\002\170\002\174\020:\023\234\003r\t\182\001\002\000\000\012\026\026\222\003v\026\230\b9\000\000\000\000\000\000\004\134\002\250\002\254\004\138\t\218\003\n\003\014\000\000\000\000\002.\000\000\000\000\000\000\000\000\n\178\000\000\004\146\t\254\t\214\002^\000\000\000\000\000\000\000\000\000\000\004\158\004\162\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\000\000\004\166\004\170\004\174\004\178\004\182\005&\006\146\000\000\005b\004\186\004\190\000\000\000\000\t\197\000\000\003j\003n\000\000\nN\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\012\030\000\000\005b\000\000\001f\001\178\0026\002>\004\198\000\000\000\000\003\230\003r\002B\000\000\004\202\000\000\004\206\nR$v\000\000\000\000\004\210\004\214\t\238\000\000\000\000\000\000\t\197\t\197\002~\000\000\000\000\002\230\002\234\000\n\000\000\b\198\t\197\000\000\000\000\002\130\t\197\000\000\017\242\t\197\002\238\002\242\018\n\0182\018>\000\000\000\000\002b\002\150\000\000\002\186\t\166\001\170\002\198\000\000\003&\002.\003>\003V\000\246\019&\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\019.\000\000\0196\000\000\000\000\000\000\t\197\000\000\019R\019f\003j\003n\019\142\019\182\020\026\000\000\b\129\000\006$\155\b\129\b\129\000\000\001f\001\178\0026\002>\005b\000\000\000\000\003\230\000\000\002B\000\000\000\000\000\000\023\234\003r$v\000\000\000\000\000\000\026\222\003v\026\230\000\000\000\000\000\000\000\000\002~\000\000\000\000\002\230\002\234\000\n\000\000\b\198\000\000\002.\000\000\002\130\000\000\000\000\017\242\000\000\002\238\002\242\018\n\0182\018>\000\000\000\000\002b\002\150\000\000\002\186\t\166\001\170\002\198\000\000\003&\002.\003>\003V\000\246\019&\003f\000\000\000\000\b\129\000\000\000\000\000\000\000\000\019.\000\000\0196\005b\000\000\000\000\000\000\000\000\019R\019f\003j\003n\019\142\019\182\020\026\000\000\000\000\028\170$\187\000\000\000\000\t\178\001f\000\000\000\000\002>\005b\000\000\000\000\000\000\000\000\002B\002\170\002\174\000\000\023\234\003r\t\182\000\000\000\000\002\178\026\222\003v\026\230\000\000\000\000\000\000\000\000\004\134\002\250\002\254\004\138\t\218\003\n\003\014\t\173\t\173\000\000\000\000\000\000\000\000\t\173\t\222\000\000\004\146\t\254\t\214\002^\000\000\000\000\000\000\t\173\000\000\004\158\004\162\000\000\001\170\000\000\t\173\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\000\000\004\166\004\170\004\174\004\178\004\182\000\000\000\000\000\000\t\173\004\186\004\190\000\000\t\173\t\173\000\000\003j\003n\000\000\nN\000\000\t\173\t\173\t\173\t\173\t\173\000\000\t\173\t\173\000\000\t\173\t\173\005b\t\173\000\000\t\173\000\000\t\173\004\198\011\162\t\169\000\000\003r\000\000\t\173\004\202\t\165\004\206\nR\000\000\000\000\000\000\004\210\004\214\t\173\000\000\000\000\t\173\t\173\000\000\000\000\000\000\t\173\000\000\005N\t\173\t\173\t\173\003\018\r\229\t\173\t\173\t\173\t\173\000\000\000\000\t\173\t\173\t\173\000\000\t\173\t\173\t\173\t\173\000\000\t\173\t\173\t\173\t\173\t\173\t\173\t\173\r\229\r\229\000\000\r\229\r\229\000\000\000\000\000\000\000\000\t\173\000\000\000\000\000\000\000\000\000\000\t\173\t\173\t\173\t\173\021z\000\000\t\173\000\000\000\000\000\000\005N\000\000\t\173\000\000\000\000\000\000\004n\000\000\t\173\000\000\000\000\000\000\002\222\002\t\000\000\000\000\r\229\002\t\t\173\r\229\021\130\021\150\n=\t\173\t\173\t\173\n=\n=\000\000\n=\n=\000\000\000\000\000\000\n=\000\000\n=\000\000\000\000\005\241\000\000\000\000\005\241\005\241\004\189\r\229\000\000\r\229\000\000\t\166\005~\000\000\000\000\n=\000\000\r\229\n=\n=\000\000\r\229\r\229\021\170\000\000\000\000\n=\000\000\000\000\r\229\000\000\n=\n=\n=\n=\000\000\r\229\000\000\n=\n=\000\000\n=\002.\n=\n=\023\006\n=\n=\n=\n=\n=\n=\n=\000\000\000\000\000\000\000\000\021\178\000\000\001\162\012\234\012\025\n=\000\000\012\025\012\025\000\000\000\000\n=\n=\n=\n=\000\000\005\241\n=\t\173\000\000\023B\012\246\t\173\t\173\005b\t\173\t\173\023N\t\173\n=\t\173\000\000\t\173\023^\n=\000\000\000\000\n=\028\230\n=\t\166\t\169\000\000\r\002\n=\n=\n=\012\250\001\142\t\173\000\000\005\189\t\173\t\173\005\189\005\189\000\000\001\170\023n\000\000\t\173\002.\000\000\000\000\004\238\t\173\t\173\t\173\t\173\000\000\023v\023\146\t\173\t\173\000\000\t\173\012\025\t\173\t\173\000\000\t\173\t\173\t\173\t\173\t\173\t\173\t\173\000\000\000\000\000\000\000\000\000\000\002.\023\154\000\000\000\000\t\173\000\000\000\000\000\000\005b\000\000\t\173\t\173\t\173\t\173\000\000\t\181\t\173\000\000\000\000\t\181\t\181\t\181\t\181\t\181\t\181\000\000\005N\t\181\t\173\t\181\t\181\005\189\000\000\000\000\t\181\t\181\t\181\000\000\t\173\005b\003B\t\169\000\000\t\173\t\173\t\173\t\181\t\169\000\000\t\181\t\181\t\181\000\000\t\181\000\000\000\000\t\181\t\181\026\190\000\000\000\000\000\000\t\181\t\181\t\181\t\181\t\181\000\000\000\000\t\181\t\181\t\181\t\181\000\000\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\000\000\000\000\t\181\000\000\000\000\b\250\000\000\000\000\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\000\000\000\000\t\181\002\218\002\218\000\000\000\000\t\181\t\181\b\029\002\218\002\222\b\029\b\029\t\181\000\000\000\000\t\181\t\181\t\165\t\169\000\000\t\181\t\181\t\181\000\000\t\169\000\000\t\177\t\181\t\181\t\181\t\177\t\177\000\000\t\177\t\177\000\000\t\177\000\000\t\177\000\000\t\177\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\029\004r\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\177\000\000\000\000\t\177\t\177\000\000\000\000\000\000\000\000\000\000\000\000\t\177\000\000\000\000\000\000\000\000\t\177\t\177\t\177\t\177\000\000\000\000\b\029\t\177\t\177\000\000\t\177\000\000\t\177\t\177\b\029\t\177\t\177\t\177\t\177\t\177\t\177\t\177\000\000\006i\006i\000\000\006i\006i\000\000\000\000\000\000\t\177\000\000\b\029\000\000\003\233\000\000\t\177\t\177\t\177\t\177\003\233\003\233\t\177\000\000\000\000\000\000\000\000\003\233\003\233\021*\003\233\003\233\000\000\003\233\t\177\000\000\000\000\024\206\003\233\003\233\003\233\003\233\003\233\006i\t\177\000\000\006i\000\000\000\000\t\177\t\177\t\177\003\233\003\233\000\000\000\000\001\161\000\000\000\000\000\000\001\161\003\233\003\233\024\014\024\018\000\000\000\000\000\000\003\233\000\000\000\000\000\000\006i\000\000\006i\000\000\r\210\003\233\003\233\003\233\003\233\000\000\006i\000\000\003\233\003\233\003\233\000\000\000\000\000\000\000\000\024\206\t\166\000\000\000\000\000\000\003\233\000\000\000\000\003\233\000\000\006i\003\233\025&\025.\000\000\000\000\003\233\000\000\000\000\001\161\003\233\003\233\003\233\001\161\003\233\003\213\024\014\024\018\003\233\003\233\003\233\003\213\003\213\000\000\000\000\003\233\003\233\003\233\003\213\003\213\000\000\003\213\003\213\000\000\003\213\000\000\000\000\025>\025\022\003\213\003\213\003\213\003\213\003\213\000\000\t\166\000\000\000\000\000\000\001\018\001\022\000\000\000\000\003\213\003\213\001V\025&\025.\000\000\000\000\000\000\000\000\003\213\003\213\000\000\001b\000\000\000\000\000\000\003\213\000\000\000\000\001\134\000\000\000\000\000\000\000\000\r\210\003\213\003\213\003\213\003\213\000\000\000\000\000\000\003\213\003\213\003\213\000\000\000\000\000\000\025>\000\000\000\000\001\130\002\"\000\000\003\213\000\000\000\000\003\213\000\000\000\000\003\213\001\170\002&\002*\006]\003\213\005\026\000\000\005\030\003\213\003\213\003\213\004\242\003\213\003\209\000\000\000\000\003\213\003\213\003\213\003\209\003\209\000\000\000\000\003\213\003\213\003\213\003\209\003\209\000\000\003\209\003\209\005F\003\209\000\000\000\000\000\000\000\000\003\209\003\209\003\209\003\209\003\209\000\000\b\198\000\000\000\000\000\000\000\000\000\000\000\000\b\218\003\209\003\209\000\000\000\000\000\000\t\146\000\000\000\000\000\000\003\209\003\209\000\000\t\166\000\000\000\000\000\000\003\209\002.\000\000\000\000\000\000\000\000\000\000\000\000\r\210\003\209\003\209\003\209\003\209\000\000\020>\000\000\003\209\003\209\003\209\000\000\000\000\000\000\004\022\030z\030\130\000\000\020F\020b\003\209\000\000\000\000\003\209\011\161\000\000\003\209\000\000\030\138\000\189\000\000\003\209\005b\000\189\005:\003\209\003\209\003\209\004\242\003\209\004\t\020j\030\142\003\209\003\209\003\209\r\202\r\218\000\000\000\000\003\209\003\209\003\209\004\t\004\t\000\000\004\t\004\t\011\161\004\t\030\150\000\000\030\162\000\000\004\t\004\t\004\t\r\242\004\t\000\000\b\198\000\000\000\000\000\189\000\000\000\000\000\000\b\218\004\t\004\t\000\000\000\000\000\000\t\146\000\000\000\000\000\000\004\t\004\t\000\000\t\166\000\000\000\000\000\000\004\t\002.\031f\000\000\000\189\000\189\000\000\000\000\r\210\r\250\004\t\004\t\004\t\b\209\020>\000\000\004\t\004\t\004\t\000\189\000\189\000\000\003\026\000\000\001f\000\000\020F\020b\004\t\000\000\000\000\004\t\000\000\000\189\004\t\000\000\000\000\000\000\000\000\004\t\005b\000\000\t\165\004\t\004\t\004\t\000\000\004\t\004\r\020j\000\000\004\t\004\t\004\t\004\r\004\r\000\000\000\000\004\t\004\t\004\t\004\r\004\r\000\000\004\r\004\r\000\000\004\r\003\022\004\022\030z\030\130\004\r\004\r\004\r\004\r\004\r\000\000\001\170\000\000\000\000\000\000\002.\030\138\000\000\003\226\004\r\004\r\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\r\004\r\030\142\000\000\000\000\000\000\006q\004\r\012\150\006q\006q\000\000\000\000\000\000\012\154\r\210\004\r\004\r\004\r\004\r\030\150\000\000!z\004\r\004\r\004\r\005b\000\000\000\000\003\026\002\222\001f\000\000\001\194\000\000\004\r\000\000\000\000\004\r\000\000\000\000\004\r\000\000\000\000\000\000\000\000\004\r\006q\000\000 \234\004\r\004\r\004\r\000\000\004\r\003\205\031f\000\000\004\r\004\r\004\r\003\205\003\205\000\000\000\000\004\r\004\r\004\r\003\205\003\205\000\000\003\205\003\205\000\000\003\205\003\022\006q\000\000\006q\003\205\003\205\003\205\003\205\003\205\007\133\001\170\006q\000\000\006q\002.\000\000\000\000\003\226\003\205\003\205\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\205\003\205\000\000\006q\000\000\000\000\005\213\003\205\012\150\005\213\005\213\000\000\000\000\000\000\012\154\r\210\003\205\003\205\003\205\003\205\000\000\000\000\000\000\003\205\003\205\003\205\005b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\205\000\000\000\000\003\205\000\000\000\000\003\205\003\166\r\197\r\197\000\000\003\205\002.\000\000\000\000\003\205\003\205\003\205\000\000\003\205\003\221\004^\000\000\003\205\003\205\003\205\r\202\r\218\000\000\000\000\003\205\003\205\003\205\003\221\003\221\004b\003\221\003\221\004j\003\221\000\000\000\000\000\000\005\213\003\221\003\221\003\221\r\242\003\221\002\198\000\000\005b\000\000\012n\003V\000\246\000\000\000\000\003\221\003\221\000\000\000\000\000\000\000\000\000\000\005\213\000\000\003\221\003\221\000\000\025\218\000\000\000\000\006q\003\221\000\000\006q\006q\000\000\000\000\000\000\000\000\r\210\r\250\003\221\003\221\003\221\000\000\000\000\017\n\003\221\003\221\003\221\000\000\000\000\000\000\000\000\000\000\003q\000\000\004\254\003q\003\221\000\000\000\000\003\221\000\000\000\000\003\221\000\000\000\000\000\000\000\000\003\221\006q\000\000\000\000\003\221\003\221\003\221\000\000\003\221\003\217\005\n\000\000\003\221\003\221\003\221\r\202\r\218\000\000\000\000\003\221\003\221\003\221\003\217\003\217\000\000\003\217\003\217\000\000\003\217\003q\006q\000\000\006q\003\217\003\217\003\217\r\242\003\217\000\000\000\000\006q\000\000\006q\003q\003q\000\000\000\000\003\217\003\217\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\217\003\217\000\000\006q\000\000\000\000\000]\003\217\000\000\000]\000]\003q\000\000\000\000\000\000\r\210\r\250\003\217\003\217\003\217\000\000\000\000\000\000\003\217\003\217\003\217\003q\000\000\000\000\003\026\000\000\001f\000\000\003q\000\000\003\217\000\000\000\000\003\217\000\000\003q\003\217\000\000\000\000\000\000\000\000\003\217\002.\000\000\t\169\003\217\003\217\003\217\000\000\003\217\003\245\000\000\000\000\003\217\003\217\003\217\r\202\r\218\000\000\000\000\003\217\003\217\003\217\003\245\003\245\000\000\003\245\003\245\000\000\003\245\003\022\000\000\000\000\000]\r\234\014\002\014\n\r\242\014\018\000\000\001\170\005b\000\000\bZ\002.\000\000\000\000\003\226\014\026\014\"\000\000\000\000\000\000\000\000\000\000\"b\000\000\014*\014B\000\000\br\000\000\000\000\0169\003\245\012\150\0169\0169\000\000\000\000\000\000\012\154\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\003\245\014R\014Z\005b\000\000\000\000\000\000\000\000\"f\000\000\000\000\"\022\003\245\000\000\000\000\003\245\000\000\000\000\003\245\000\000\000\000\000\000\000\000\003\245\0169\000\000\000\000\003\245\003\245\003\245\000\000\003\245\003\229\000\000\000\000\003\245\014j\003\245\r\202\r\218\000\000\000\000\003\245\014r\014z\003\229\003\229\000\000\003\229\003\229\000\000\003\229\"j#\022\000\000\0169\003\229\003\229\003\229\r\242\003\229\000\000\000\000\0169\000\000\0169\002.\"n\000\000#\030\003\229\003\229\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\229\003\229\000\000\0169\000\000\000\000\000\000\003\229\000\000\000\000\000\000\"R\000\000\000\000\000\000\r\210\r\250\003\229\003\229\003\229\000\000\000\000\000\000\003\229\003\229\003\229\005b\000\000\000\000\000\000\000\000\005\018\000\000\"Z\007\174\003\229\000\000\000\000\003\229\000\000\"b\003\229\0046\004V\014\214\000\000\003\229\000\000\000\000\000\000\003\229\003\229\003\229\000\000\003\229\003\225\014\222\000\000\003\229\003\229\003\229\r\202\r\218\000\000\000\000\003\229\003\229\003\229\003\225\003\225\014\226\003\225\003\225\000\000\003\225\007\182\014\234\000\000\000\000\003\225\003\225\003\225\r\242\003\225\004\022\030z\030\130\000\000\014\238\002.\007\194\000\000\000\000\003\225\003\225\000\000\000\000\000\000\030\138\000\000\000\000\000\000\003\225\003\225\000\000\000\000\000\000\000\000\000\000\003\225\000\000\000\000\030\142\007\206\000\000\000\000\000\000\r\210\r\250\003\225\003\225\003\225\000\000\000\000\014\250\003\225\003\225\003\225\005b\000\000\030\150\000\000!\170\019\186\000\000\007\214\019\202\003\225\000\000\000\000\003\225\000\000\007\222\003\225\0046\004V\014\214\000\000\003\225\000\000\000\000\000\000\003\225\003\225\003\225\000\000\003\225\004\017\014\222\000\000\003\225\003\225\003\225\r\202\r\218\000\000\031f\003\225\003\225\003\225\004\017\004\017\014\226\004\017\004\017\000\000\004\017\019\214\030v\000\000\000\000\r\234\014\002\014\n\r\242\004\017\004\022\030z\030\130\000\000\014\238\002.\019\230\000\000\000\000\014\026\014\"\000\000\000\000\000\000\030\138\000\000\000\000\000\000\004\017\004\017\000\000\000\000\000\000\000\000\000\000\004\017\000\000\000\000\030\142\019\246\000\000\000\000\000\000\r\210\r\250\0142\014:\004\017\000\000\000\000\014\250\004\017\004\017\004\017\005b\000\000\030\150\000\000\r\177\000\000\000\000\020\002\000\000\004\017\000\000\000\000\004\017\000\000\028\170\004\017\004\022\030z\030\130\000\000\004\017\000\000\000\000\000\000\004\017\004\017\004\017\000\000\004\017\003\201\030\138\000\000\004\017\004\017\004\017\r\202\r\218\000\000\031f\004\017\004\017\004\017\003\201\003\201\030\142\003\201\003\201\000\000\003\201\000\000\000\000\000\000\000\000\003\201\003\201\003\201\r\242\003\201\000\000\000\000\000\000\000\000\030\150\000\000!\202\000\000\000\000\003\201\003\201\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\201\003\201\000\000\000\000\000\000\000\000\005\225\003\201\000\000\005\225\005\225\000\000\000\000\000\000\000\000\r\210\r\250\003\201\003\201\003\201\000\000\000\000\031f\003\201\003\201\003\201\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\201\000\000\000\000\003\201\000\000\000\000\003\201\000\000\000\000\000\000\000\000\003\201\002.\000\000\000\000\003\201\003\201\003\201\000\000\003\201\003\197\000\000\000\000\003\201\003\201\003\201\r\202\r\218\000\000\000\000\003\201\003\201\003\201\003\197\003\197\000\000\003\197\003\197\000\000\003\197\000\000\000\000\000\000\005\225\r\234\014\002\014\n\r\242\003\197\000\000\000\000\005b\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\197\003\197\000\000\028b\000\000\000\000\000\000\003\197\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\003\197\000\000\000\000\000\000\003\197\003\197\003\197\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\197\000\000\000\000\003\197\000\000\000\000\003\197\000\000\000\000\000\000\000\000\003\197\000\000\000\000\000\000\003\197\003\197\003\197\000\000\003\197\003\237\000\000\000\000\003\197\003\197\003\197\r\202\r\218\000\000\000\000\003\197\003\197\003\197\003\237\003\237\000\000\003\237\003\237\000\000\003\237\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\003\237\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\003\237\000\000\000\000\000\000\000\000\000\000\003\237\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\003\237\000\000\000\000\000\000\003\237\003\237\003\237\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\237\000\000\000\000\003\237\000\000\000\000\003\237\000\000\000\000\000\000\000\000\003\237\000\000\000\000\000\000\003\237\003\237\003\237\000\000\003\237\003\193\000\000\000\000\003\237\003\237\003\237\r\202\r\218\000\000\000\000\003\237\003\237\003\237\003\193\003\193\000\000\003\193\003\193\000\000\003\193\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\003\193\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\003\193\000\000\000\000\000\000\000\000\000\000\003\193\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\003\193\000\000\000\000\000\000\003\193\003\193\003\193\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\193\000\000\000\000\003\193\000\000\000\000\003\193\000\000\000\000\000\000\000\000\003\193\000\000\000\000\000\000\003\193\003\193\003\193\000\000\003\193\004\025\000\000\000\000\003\193\003\193\003\193\r\202\r\218\000\000\000\000\003\193\003\193\003\193\004\025\004\025\000\000\004\025\004\025\000\000\004\025\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\004\025\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\004\025\000\000\000\000\000\000\000\000\000\000\004\025\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\004\025\000\000\000\000\000\000\004\025\004\025\004\025\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\025\000\000\000\000\004\025\000\000\000\000\004\025\000\000\000\000\000\000\000\000\004\025\000\000\000\000\000\000\004\025\004\025\004\025\000\000\004\025\004\021\000\000\000\000\004\025\004\025\004\025\r\202\r\218\000\000\000\000\004\025\004\025\004\025\004\021\004\021\000\000\004\021\004\021\000\000\004\021\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\004\021\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\004\021\000\000\000\000\000\000\000\000\000\000\004\021\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\004\021\000\000\000\000\000\000\004\021\004\021\004\021\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\021\000\000\000\000\004\021\000\000\000\000\004\021\000\000\000\000\000\000\000\000\004\021\000\000\000\000\000\000\004\021\004\021\004\021\000\000\004\021\003\241\000\000\000\000\004\021\004\021\004\021\r\202\r\218\000\000\000\000\004\021\004\021\004\021\003\241\003\241\000\000\003\241\003\241\000\000\003\241\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\003\241\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\003\241\000\000\000\000\000\000\000\000\000\000\003\241\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\003\241\000\000\000\000\000\000\003\241\003\241\003\241\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\241\000\000\000\000\003\241\000\000\000\000\003\241\000\000\000\000\000\000\000\000\003\241\000\000\000\000\000\000\003\241\003\241\003\241\000\000\003\241\003\249\000\000\000\000\003\241\003\241\003\241\r\202\r\218\000\000\000\000\003\241\003\241\003\241\003\249\003\249\000\000\003\249\003\249\000\000\003\249\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\003\249\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\003\249\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\249\000\000\000\000\003\249\000\000\000\000\003\249\000\000\000\000\000\000\000\000\003\249\000\000\000\000\000\000\003\249\003\249\003\249\000\000\003\249\003\253\000\000\000\000\003\249\014j\003\249\r\202\r\218\000\000\000\000\003\249\014r\014z\003\253\003\253\000\000\003\253\003\253\000\000\003\253\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\003\253\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\003\253\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\003\253\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\253\000\000\000\000\003\253\000\000\000\000\003\253\000\000\000\000\000\000\000\000\003\253\000\000\000\000\000\000\003\253\003\253\003\253\000\000\003\253\004\001\000\000\000\000\003\253\003\253\003\253\r\202\r\218\000\000\000\000\003\253\014r\014z\004\001\004\001\000\000\004\001\004\001\000\000\004\001\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\004\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\004\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\004\001\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\001\000\000\000\000\004\001\000\000\000\000\004\001\000\000\000\000\000\000\000\000\004\001\000\000\000\000\000\000\004\001\004\001\004\001\000\000\004\001\004\005\000\000\000\000\004\001\004\001\004\001\r\202\r\218\000\000\000\000\004\001\014r\014z\004\005\004\005\000\000\004\005\004\005\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\004\005\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\004\005\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\005\000\000\000\000\004\005\000\000\000\000\004\005\000\000\000\000\000\000\000\000\004\005\000\000\000\000\000\000\004\005\004\005\014\130\000\000\004\005\004E\000\000\000\000\004\005\014j\004\005\r\202\r\218\000\000\000\000\004\005\014r\014z\004E\004E\000\000\004E\004E\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\004E\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\004E\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004E\000\000\000\000\004E\000\000\000\000\004E\000\000\000\000\000\000\000\000\004E\000\000\000\000\000\000\004E\004E\014\130\000\000\004E\004-\000\000\000\000\004E\014j\004E\r\202\r\218\000\000\000\000\004E\014r\014z\004-\004-\000\000\004-\004-\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\004-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\004-\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004-\000\000\000\000\004-\000\000\000\000\004-\000\000\000\000\000\000\000\000\004-\000\000\000\000\000\000\004-\004-\014\130\000\000\004-\0041\000\000\000\000\004-\014j\004-\r\202\r\218\000\000\000\000\004-\014r\014z\0041\0041\000\000\0041\0041\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\0041\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\0041\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0041\000\000\000\000\0041\000\000\000\000\0041\000\000\000\000\000\000\000\000\0041\000\000\000\000\000\000\0041\0041\014\130\000\000\0041\0045\000\000\000\000\0041\014j\0041\r\202\r\218\000\000\000\000\0041\014r\014z\0045\0045\000\000\0045\0045\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\0045\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\0045\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0045\000\000\000\000\0045\000\000\000\000\0045\000\000\000\000\000\000\000\000\0045\000\000\000\000\000\000\0045\0045\014\130\000\000\0045\004)\000\000\000\000\0045\014j\0045\r\202\r\218\000\000\000\000\0045\014r\014z\004)\004)\000\000\004)\004)\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\004)\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\004)\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004)\000\000\000\000\004)\000\000\000\000\004)\000\000\000\000\000\000\000\000\004)\000\000\000\000\000\000\004)\004)\014\130\000\000\004)\003\153\000\000\000\000\004)\014j\004)\r\202\r\218\000\000\000\000\004)\014r\014z\003\153\003\153\000\000\003\153\003\153\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\003\153\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\003\153\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\153\000\000\000\000\003\153\000\000\000\000\003\153\000\000\000\000\000\000\000\000\003\153\000\000\000\000\000\000\003\153\003\153\014\130\000\000\003\153\003\157\000\000\000\000\003\153\014j\003\153\r\202\r\218\000\000\000\000\003\153\014r\014z\003\157\003\157\000\000\003\157\003\157\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\003\157\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\003\157\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\157\000\000\000\000\003\157\000\000\000\000\003\157\000\000\000\000\000\000\000\000\003\157\000\000\000\000\000\000\003\157\003\157\014\130\000\000\003\157\003\021\000\000\000\000\003\157\014j\003\157\r\202\r\218\000\000\000\000\003\157\014r\014z\003\021\003\021\000\000\003\021\003\021\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\003\021\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\003\021\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\021\000\000\000\000\003\021\000\000\000\000\003\021\000\000\000\000\000\000\000\000\003\021\000\000\000\000\000\000\003\021\003\021\014\130\000\000\003\021\007a\000\000\000\000\003\021\014j\003\021\r\202\r\218\000\000\000\000\003\021\014r\014z\007a\007a\000\000\007a\007a\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\007a\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\007a\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\007a\000\000\000\000\007a\000\000\000\000\007a\000\000\000\000\000\000\000\000\007a\000\000\000\000\000\000\007a\007a\014\130\000\000\007a\003\161\000\000\000\000\007a\014j\007a\003\161\003\161\000\000\000\000\007a\014r\014z\003\161\003\161\000\000\003\161\003\161\000\000\003\161\000\000\000\000\000\000\000\000\003\161\003\161\003\161\003\161\003\161\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\161\003\161\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\161\003\161\000\000\000\000\000\000\000\000\000\000\003\161\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\161\003\161\003\161\003\161\003\161\000\000\000\000\000\238\003\161\003\161\003\161\030\022\001f\000\000\002V\002>\000\000\000\000\000\000\002\142\003\161\002B\000\000\003\161\000\000\000\000\003\161\000\000\000\000\000\000\t-\003\161\003B\t\169\000\000\003\161\003\161\003\161\002~\003\161\000\000\002\230\002\234\003\161\003\161\017\194\000\000\000\000\000\000\002\130\003\161\003\161\003\161\000\000\002\238\002\242\002\246\003\030\000\000\000\000\000\000\002b\002\150\000\000\002\186\000\000\001\170\002\198\000\000\003&\002.\003>\003V\000\246\003b\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\134\000\000\000\000\014^\000\000\000\000\011\198\011\250\003j\003n\000\000\000\000\012\014\000\000\000\000\000\000\000\000\003\166\012f\012z\000\000\001\145$\014\000\000\005b\001\145\000\000\000\000\000\000\001\014\003\177\004^\004\230\000\000\003r\000\000\r\202\r\218\000\000\012Z\003v\012^\000\000\003\177\003\177\004b\003\177\003\177\004j\003\177\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\002\198\000\000\000\000\000\000\012n\003V\000\246\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\003\177\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\017\n\003\177\014R\014Z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\177\000\000\000\000\003\177\000\000\000\000\003\177\000\000\000\000\000\000\000\000\003\177\000\000\000\000\000\000\003\177\003\177\003\177\"f\003\177\0049\"\022\000\000\003\177\014j\003\177\r\202\r\218\000\000\000\000\003\177\014r\014z\0049\0049\000\000\0049\0049\000\000\r\226\000\000\000\000\000\000#\026\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\026\014\"\000\000\000\000\"j\000\000\000\000\000\000\000\000\014*\014B\000\000\000\000\000\000\000\000\000\000\0049\000\000\002.\"n\000\000#\030\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\0049\014R\014Z\001\018\"\186\000\000\000\000\"~\000\000\001V\"R\000\000\0049\000\000\000\000\0049\000\000\000\000\0049\001b\000\000\000\000#2\0049\000\000\005b\001\134\0049\0049\014\130\000\000\0049\"Z\000\238\000\000\0049\014j\0049\001f\"b\002V\002>\0049\014r\014z\002\142\000\000\002B\"\190\002\"\000\000\000\000\000\000\000\000\000\000\000\000\003\130\000\000\001\170\002&\002*\011\246\000\000\"\194\002~\007*\000\000\002\230\002\234\000\000\000\000\000\000\000\000\000\000\000\000\002\130\000\000\000\000\003\018\000\000\002\238\002\242\002\246\003\030\000\000\000\000\"\158\002b\002\150\005F\002\186\000\000\001\170\002\198\000\000\003&\002.\003>\003V\000\246\003b\003f\000\000\000\000\000\000\000\000\000\000\000\000\"\166\000\000\000\000\003\134\000\000\000\000\027\146\"\198\000\000\011\198\011\250\003j\003n\000\000\000\238\012\014\000\000\000\000\004z\001f\004\242\002V\002>\000\000\004~\000\000\002\142\005b\002B\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003r\000\000\011\161\011\161\000\000\012Z\003v\012^\002~\000\000\000\000\002\230\002\234\000\000\000\000\b\198\000\000\000\000\000\000\002\130\000\000\000\000\b\218\000\000\002\238\002\242\002\246\003\030\t\146\000\000\000\000\002b\002\150\000\000\002\186\t\166\001\170\002\198\000\000\003&\002.\003>\003V\000\246\003b\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020>\000\000\003\134\000\000\000\000\000\000\000\000\000\000\011\198\011\250\003j\003n\020F\020b\012\014\000\238\000\000\000\000\011\161\000\000\001f\000\000\002V\002>\000\000\000\000\005b\002\142\000\000\002B\000\000\000\000\000\000\000\000\000\000\020j\003r\000\000\t\169\000\000\000\000\012Z\003v\012^\007\237\000\000\002~\007\237\007\237\002\230\002\234\000\000\000\000\000\000\000\000\000\000\000\000\002\130\000\000\000\000\000\000\000\000\002\238\002\242\002\246\003\030\000\000\000\000\000\000\002b\002\150\012\166\002\186\000\000\001\170\002\198\000\000\003&\002.\003>\003V\000\246\003b\003f\000\000\007\237\000\000\000\000\003\226\000\000\000\000\000\000\000\000\003\134\t\181\t\181\000\000\000\000\t\181\011\198\011\250\003j\003n\000\000\t\181\012\014\t\181\000\000\000\000\000\000\t\181\t\181\000\000\t\181\t\181\011J\007\237\005b\t\181\000\000\t\181\000\000\000\000\000\000\007\237\t\181\000\000\003r\000\000\t\169\000\000\015:\012Z\003v\012^\000\000\000\000\t\181\t\181\t\181\t\181\t\181\000\000\007\237\000\000\000\000\000\000\000\000\t\181\t\181\000\000\000\000\t\181\t\181\t\181\t\181\t\181\t\181\t\181\000\000\t\181\t\181\000\000\t\181\000\000\t\181\t\181\000\000\t\181\t\181\t\181\t\181\t\181\t\181\t\181\000\000\t\181\t\181\000\000\t\181\000\000\000\000\000\000\000\000\t\181\000\000\000\000\000\000\002\218\000\000\t\181\t\181\t\181\t\181\001f\000\000\t\181$~\000\000\000\000\000\000\000\000\t\181$\130\002\218\000\000\000\000\000\000\t\181\016\177\016\177\003U\003\166\012f\012z\000\000\016\177\000\000\t\181\016\177\016\177\000\000\016\177\t\181\t\181\t\181\004^\016\177\016\177\016\177\016\177\016\177\000\000\000\000\000\000\000\000\001\162\012\234\004\154\002^\004b\016\177\016\177\004j\000\000\000\000\000\000\000\000\000\000\000\000\016\177\016\177\000\000\000\000\002\198\012\254\000\000$\134\012n\003V\000\246\000\000\000\000\000\000\000\000\016\177\016\177\016\177\016\177\016\177\000\000\000\000\000\000\000\000\016\177\016\177$\138\r\002\000\000\000\000\000\000\012\250\001\142\003U\000\000\000\000\000\000\000\000\016\177\000\000\019F\001\170\000\000\000\000\017\n\002.\000\000\000\000\004\238\003\166\012f\012z\016\177\001\149\000\000\000\000\000\000\001\149\000\000\016\177\000\000\000\000\000\000\004^\000\000\000\000\016\177\016\177\012e\012e\000\000\012e\012e\012e\000\000\012e\000\000\004b\012e\012e\004j\012e\000\000\000\000\005b\012e\012e\012e\012e\012e\012e\002\198\000\000\000\000\000\000\012n\003V\000\246\000\000\012e\012e\012e\012e\000\000\000\000\000\000\000\000\000\000\000\000\012e\012e\000\000\000\000\012e\000\000\000\000\000\000\012e\012e\012e\000\000\000\000\000\000\000\000\012e\012e\012e\012e\012e\000\000\000\000\017\n\006q\012e\012e\006q\006q\000\000\000\000\000\000\000\000\000\000\000\000\006q\000\000\027\238\000\000\012e\000\000\000\000\000\000\000\000\000\000\012e\000\000\000\000\000\000\000\000\000\000\004\254\000\000\012e\000\000\000\000\000\000\000\000\000\000\000\000\012e\000\000\000\000\000\000\000\000\006q\000\000\012e\012e\012i\012i\000\000\012i\012i\012i\000\000\012i\000\000\000\000\012i\012i\000\000\012i\000\000\000\000\000\000\012i\012i\012i\012i\012i\012i\000\000\000\000\006q\000\000\006q\000\000\000\000\000\000\012i\012i\012i\012i\006q\000\000\006q\000\000\000\000\000\000\012i\012i\000\000\000\000\012i\000\000\000\000\000\000\012i\012i\012i\000\000\000\000\006q\000\000\012i\012i\012i\012i\012i\000\000\000\000\000\000\000\000\012i\012i\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\028\006\000\000\012i\000\000\000\000\000\000\000\000\000\000\012i\000\000\000\000\000\000\000\000\000\000\t\221\000\000\012i\t\221\t\221\000\000\000\000\000\000\000\000\012i\000\000\000\000\000\000\000\000\000\000\000\000\012i\012i\012m\012m\000\000\012m\012m\012m\000\000\012m\000\000\005\022\012m\012m\000\000\012m\000\000\000\000\000\000\012m\012m\012m\012m\012m\012m\t\221\000\000\000\000\007*\000\000\000\000\000\000\000\000\012m\012m\012m\012m\000\000\000\000\000\000\000\000\000\000\000\000\012m\012m\000\000\000\000\012m\000\000\000\000\000\000\012m\012m\012m\019\206\000\000\t\221\000\000\012m\012m\012m\012m\012m\000\000\t\221\000\000\0165\012m\012m\0165\0165\000\000\t\221\000\000\000\000\000\000\000\000\023\022\t\221\028\030\000\000\012m\000\000\000\000\000\000\000\000\000\000\012m\000\000\000\000\000\000\000\000\000\000\000\000\000\000\012m\000\000\000\000\000\000\000\000\000\000\000\000\012m\000\000\000\000\000\000\000\000\0165\000\000\012m\012m\012]\012]\000\000\012]\012]\012]\000\000\012]\000\000\000\000\012]\012]\000\000\012]\000\000\000\000\000\000\012]\012]\012]\012]\012]\012]\000\000\000\000\002\022\000\000\0165\000\000\000\000\000\000\012]\012]\012]\012]\0165\000\000\0165\000\000\000\000\000\000\012]\012]\000\000\000\000\012]\000\000\000\000\000\000\012]\012]\012]\000\000\000\000\0165\000\000\012]\012]\012]\012]\012]\000\000\000\000\000\000\t\181\012]\012]\000\000\000\000\t\181\000\000\t\181\t\181\000\000\000\000\000\000\t\181\028*\t\181\012]\000\000\000\000\000\000\000\000\000\000\012]\000\000\000\000\000\000\031\210\t\181\t\181\000\000\012]\t\181\t\181\t\181\t\181\t\181\t\181\012]\000\000\t\181\t\181\t\181\t\181\t\181\012]\012]\000\000\t\181\t\181\t\181\t\181\t\181 R!R\000\000\t\181\t\181\000\000\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\000\000\000\000\000\000\t\181\t\181\t\181\t\181\t\181\t\181\000\000\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\000\000\000\000\002\218\000\000\000\000\000\000\t\181\000\000\t\181\t\181\000\000\000\000\000\000\000\000\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\t\181\000\000\000\000\000\000\000\000\002\218\002\218\000\000\000\000\t\181\t\181\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\181\t\181\006\137\000\000\0001\t\181\t\181\t\181\t\181\0001\000\000\0001\0001\000\000\000\000\000\000\0001\b\t\0001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\tM\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0001\000\000\000\000\0001\0001\b\t\b\t\000\000\b\t\b\t\000\000\0001\000\000\000\000\000\000\000\000\0001\0001\0001\0001\000\000\000\000\000\000\0001\0001\000\000\0001\000\000\0001\0001\000\000\0001\0001\0001\0001\0001\0001\0001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\t\0001\000\000\b\t\000\000\000\000\000\000\0001\0001\0001\0001\000\000\000\000\0001\000-\000\000\000\000\000\000\000\000\000-\000\000\000-\000-\000\000\000\000\0001\000-\000\000\000-\b\t\000\000\b\t\000\000\000\000\000\000\0001\000\000\tI\000\000\b\t\0001\0001\0001\b\t\b\t\000-\000\000\000\000\000-\000-\000\000\b\t\000\000\000\000\000\000\000\000\000-\000\000\tV\000\000\000\000\000-\000-\000-\000-\000\000\000\000\000\000\000-\000-\000\000\000-\000\000\000-\000-\000\000\000-\000-\000-\000-\000-\000-\000-\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000-\000\000\000\000\000\000\000\000\000\000\000-\000-\000-\000-\000\000\000\000\000-\015\221\000\000\000\000\000\000\000\000\015\221\000\000\015\221\015\221\000\000\000\000\000-\015\221\b\250\015\221\000\000\000\000\000\000\000\000\000\000\000\000\000-\000\000\tU\000\000\000\000\000-\000-\000-\000\000\000\000\015\221\000\000\000\000\015\221\015\221\b\025\b\025\000\000\b\025\b\025\000\000\015\221\000\000\000\000\000\000\000\000\015\221\015\221\015\221\015\221\000\000\000\000\000\000\015\221\015\221\000\000\015\221\000\000\015\221\015\221\000\000\015\221\015\221\015\221\015\221\015\221\015\221\015\221\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\025\015\221\000\000\b\025\000\000\000\000\000\000\015\221\015\221\015\221\015\221\000\000\000\000\015\221\015\217\000\000\000\000\000\000\000\000\015\217\000\000\015\217\015\217\000\000\000\000\015\221\015\217\000\000\015\217\b\025\000\000\b\025\000\000\000\000\000\000\015\221\000\000\tQ\000\000\b\025\015\221\015\221\015\221\b\025\b\025\015\217\000\000\000\000\015\217\015\217\000\000\b\025\000\000\000\000\000\000\000\000\015\217\000\000\b\025\000\000\000\000\015\217\015\217\015\217\015\217\000\000\000\000\000\000\015\217\015\217\000\000\015\217\000\000\015\217\015\217\000\000\015\217\015\217\015\217\015\217\015\217\015\217\015\217\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\015\217\000\000\000\000\000\000\000\000\000\000\015\217\015\217\015\217\015\217\000\000\000\000\015\217\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\015\217\017E\017E\000\000\003\166\012f\012z\000\000\017E\000\000\015\217\017E\017E\000\000\017E\015\217\015\217\015\217\004^\017E\017E\017E\017E\017E\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004b\017E\017E\004j\000\000\000\000\000\000\000\000\000\000\000\000\017E\017E\000\000\000\000\002\198\000\000\000\000\000\000\012n\003V\000\246\000\000\000\000\000\000\000\000\017E\017E\017E\017E\017E\000\000\000\000\000\000\000\000\017E\017E\000\000\000\000\000\000\016\189\016\189\000\000\003\166\012f\012z\000\000\016\189\000\000\017E\016\189\016\189\000\000\016\189\000\000\017\n\000\000\004^\016\189\016\189\016\189\016\189\016\189\017E\000\000\000\000\000\000\000\000\000\000\000\000\017E\004b\016\189\016\189\004j\000\000\000\000\017E\017E\000\000\000\000\016\189\016\189\000\000\000\000\002\198\000\000\000\000\000\000\012n\003V\000\246\000\000\000\000\000\000\000\000\016\189\016\189\016\189\016\189\016\189\000\000\000\000\000\000\000\000\016\189\016\189\000\000\000\000\000\000\017A\017A\000\000\003\166\012f\012z\000\000\017A\000\000\016\189\017A\017A\000\000\017A\000\000\017\n\000\000\004^\017A\017A\017A\017A\017A\016\189\000\000\000\000\000\000\000\000\000\000\000\000\016\189\004b\017A\017A\004j\000\000\000\000\016\189\016\189\000\000\000\000\017A\017A\000\000\000\000\002\198\000\000\000\000\000\000\012n\003V\000\246\000\000\000\000\000\000\000\000\017A\017A\017A\017A\017A\000\000\000\000\000\000\000\000\017A\017A\000\000\000\000\000\000\016\149\016\149\000\000\003\166\012f\012z\000\000\016\149\000\000\017A\016\149\016\149\000\000\016\149\000\000\017\n\000\000\004^\016\149\016\149\016\149\016\149\016\149\017A\000\000\000\000\000\000\000\000\000\000\000\000\017A\004b\016\149\016\149\004j\000\000\000\000\017A\017A\000\000\000\000\016\149\016\149\000\000\000\000\002\198\000\000\000\000\000\000\027\226\003V\000\246\000\000\000\000\000\000\000\000\016\149\016\149\016\149\016\149\016\149\000\000\000\000\000\000\000\000\016\149\016\149\000\000\000\000\000\000\002I\002I\000\000\002I\002I\002I\000\000\002I\000\000\016\149\000\000\002I\000\000\002I\000\000\027\246\000\000\002I\002I\002I\002I\002I\002I\016\149\000\000\000\000\000\000\000\000\000\000\000\000\016\149\002I\002I\002I\002I\000\000\000\000\016\149\016\149\000\000\000\000\002I\002I\000\000\000\000\002I\000\000\000\000\000\000\002I\002I\002I\000\000\000\000\000\000\000\000\002I\002I\002I\002I\002I\000\000\000\000\000\000\0165\002I\002I\0165\0165\000\000\000\000\000\000\000\000\000\000\000\000\028\162\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002I\000\000\000\000\000\000\000\000\000\000\015j\000\000\002I\000\000\015n\000\000\000\000\000\000\000\000\002I\000\000\000\000\000\000\000\000\0165\000\000\002I\002I\016\185\016\185\000\000\003\166\012f\012z\000\000\016\185\000\000\000\000\016\185\016\185\000\000\016\185\000\000\000\000\000\000\004^\016\185\016\185\016\185\016\185\016\185\000\000\000\000\002\022\000\000\0165\000\000\000\000\000\000\004b\016\185\016\185\004j\0165\000\000\0165\000\000\000\000\000\000\016\185\016\185\000\000\000\000\002\198\000\000\000\000\000\000\012n\003V\000\246\000\000\000\000\0165\000\000\016\185\016\185\016\185\016\185\016\185\000\000\000\000\000\000\000\000\016\185\016\185\000\000\000\000\000\000\017]\017]\000\000\017]\017]\017]\000\000\017]\000\000\016\185\017]\000\000\000\000\017]\000\000\017\n\000\000\017]\017]\017]\017]\017]\017]\016\185\000\000\000\000\000\000\000\000\000\000\000\000\016\185\017]\017]\017]\017]\000\000\000\000\016\185\016\185\000\000\000\000\017]\017]\000\000\000\000\017]\000\000\000\000\000\000\017]\017]\017]\000\000\000\000\000\000\000\000\017]\017]\017]\017]\017]\000\000\000\000\000\000\000\000\017]\017]\014!\000\000\000\000\t\178\001f\000\000\000\000\002>\000\000\014\r\000\000\000\000\t\221\002B\000\000\t\221\t\221\000\000\017]\t\182\000\000\014!\014!\000\000\014!\014!\017]\000\000\000\000\000\000\000\000\000\000\000\000\017]\t\190\000\000\000\000\000\000\000\000\005\022\017]\017]\000\000\000\000\000\000\000\000\000\000\t\202\nJ\002^\000\000\000\000\000\000\t\221\000\000\000\000\007*\000\000\001\170\000\000\000\000\n\002\000\000\n\n\000\000\n\"\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\253\014!\000\000\t\253\t\253\000\000\000\000\019\222\000\000\t\221\003j\003n\000\000\000\000\000\000\014!\014!\t\221\014!\000\000\000\000\000\000\000\000\000\000\000\000\t\221\000\000\000\000\000\000\000\000\014!\t\221\000\000\014!\014!\000\000\003r\000\000\014!\000\000\014!\t\253\nZ\000\000\014!\r\202\r\218\000\000\000\000\000\000\000\000\000\000\003\r\005q\000\000\003\r\003\r\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\t\253\000\000\000\000\000\000\000\000\014\026\014\"\000\000\t\253\000\000\t\253\000\000\000\000\000\000\014*\014B\007\150\000\000\000\000\000\000\000\000\003\r\t\253\000\000\000\000\000\000\000\000\t\253\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\000\000\014R\014Z\000\000\001f\000\000\000\000\002>\000\000\000\000\000\000\000\000\n1\002B\000\000\003\r\000\000\0046\004V\014\214\000\000\000\000\000\000\003\r\000\000\000\000\000\000\005q\000\000\014\130\002\154\014\222\000\000\000\000\000\000\000\000\014j\003\r\000\000\000\000\000\000\002\158\003\r\014r\014z\014\226\000\000\000\000\002\166\002^\000\000\006!\006!\002b\002\150\b\201\002\186\000\000\001\170\002\198\000\000\002\214\001f\030^\003V\000\246\000\000\003f\000\000\000\000\000\000\000\000\002\170\002\174\000\000\000\000\000\000\000\000\b\201\b\201\000\000\b\201\b\201\000\000\000\000\003j\003n\000\000\004\134\002\250\002\254\004\138\004\142\003\n\003\014\000\000\000\000\000\000\000\000\014\250\000\000\000\000\000\000\000\000\004\146\004\150\004\154\002^\000\000\000\000\000\000\003r\000\000\004\158\004\162\000\000\000\000\003\174\000\000\b\201\000\000\000\000\b\201\000\000\000\000\000\000\000\000\000\000\004\166\004\170\004\174\004\178\004\182\000\000\016\165\016\165\000\000\004\186\004\190\000\000\000\000\016\165\000\000\000\000\016\165\016\165\000\000\016\165\b\201\000\000\b\201\000\000\016\165\016\165\016\165\016\165\016\165\000\000\b\201\000\000\bZ\000\000\b\201\b\201\000\000\004\198\016\165\016\165\000\000\000\000\b\201\000\000\004\202\000\000\004\206\016\165\016\165\b\201\000\000\004\210\004\214\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\165\016\165\016\165\016\165\016\165\000\000\000\000\000\000\000\000\016\165\016\165\000\000\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\016\165\000\000\000\000\000\000\000\000\t\182\000\000\000\000\023\250\000\000\000\000\000\000\016\129\000\000\016\165\000\000\000\000\000\000\000\000\000\000\026:\016\165\017\194\000\000\000\000\000\000\000\000\000\000\016\165\016\165\n\178\000\000\000\000\026>\t\214\002^\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\000\000\000\000\000\000\000\000\000\000\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\003j\003n\000\000\nN\000\000\t\182\000\000\000\000\017j\000\000\000\000\000\000\000\000\000\000\026B\000\000\005b\000\000\000\000\000\000\t\190\000\000\000\000\000\000\000\000\000\000\003r\000\000\000\000\000\000\n\178\000\000\nR\t\202\t\214\002^\000\000\000\000\000\000\0165\000\000\000\000\0165\0165\001\170\000\000\000\000\n\002\002.\n\n#V\n\"\nF\003f\000\000\000\000\000\000\r\202\r\218\000\000\000\000\000\000\000\000\000\000\017=\007\185\000\000\017=\017=\000\000\r\226\003j\003n\000\000\nN\r\234\014\002\014\n\r\242\014\018\0165\000\000\000\000\000\000\000\000\017\138\000\000\005b\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\003r\014*\014B\000\000\000\000\000\000\nR\000\000\000\000\000\000\000\000\000\000\002\022\000\000\0165\000\000\r\210\r\250\0142\014:\014J\000\000\0165\000\000\0165\014R\014Z\000\000\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\017=\000\000\0165\000\000\000\000\t\182\000\000\000\000\018j\000\000\000\000\000\000\007\185 \198\014\130\000\000 \210\000\000\000\000\000\000\t\190\014j\000\000\000\000\000\000\000\000\000\000\000\000\014r\014z\n\178\000\000\000\000\t\202\t\214\002^\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\000\000\000\000\r\202\r\218\000\000\000\000\000\000\000\000\000\000\016\181\000\000\000\000\016\181\016\181\000\000\016\181\003j\003n\000\000\nN\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\018\130\000\000\005b\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\003r\014*\014B\000\000\000\000\000\000\nR\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\016\157\017Z\000\000\016\157\016\157\000\000\r\226\000\000\000\000\000\000\016\181\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\181\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\004\145\014R\014Z\000\000\000\000\016\161\018&\000\000\016\161\016\161\000\000\r\226\000\000\000\000\000\000\016\157\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\004\145\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\000\000\014R\014Z\000\000\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\016\161\000\000\000\000\000\000\000\000\t\182\000\000\000\000\024N\000\000\000\000\000\000\018\030\000\000\014\130\000\000\014\138\000\000\000\000\000\000\t\190\014j\000\000\000\000\000\000\000\000\000\000\000\000\014r\014z\n\178\000\000\000\000\t\202\t\214\002^\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\000\000\000\000\000\000\000\000\000\000\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\003j\003n\000\000\nN\000\000\t\182\000\000\000\000\026n\000\000\000\000\000\000\000\000\000\000\024n\000\000\005b\000\000\000\000\000\000\t\190\000\000\000\000\000\000\000\000\000\000\003r\000\000\000\000\000\000\n\178\000\000\nR\t\202\t\214\002^\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\000\000\000\000\016\237\016\237\000\000\000\000\000\000\000\000\000\000\016\237\000\000\000\000\016\237\016\237\000\000\016\237\003j\003n\000\000\nN\016\237\016\237\016\237\016\237\016\237\000\000\000\000\000\000\000\000\000\000\026v\000\000\005b\000\000\016\237\016\237\000\000\000\000\000\000\000\000\000\000\000\000\003r\016\237\016\237\000\000\000\000\000\000\nR\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\016\237\016\237\016\237\016\237\000\000\016\213\016\213\000\000\016\237\016\237\000\000\000\000\016\213\000\000\000\000\016\213\016\213\000\000\016\213\000\000\000\000\000\000\016\237\016\213\016\213\016\213\016\213\016\213\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\237\016\213\016\213\000\000\000\000\000\000\000\000\016\237\000\000\000\000\016\213\016\213\000\000\000\000\016\237\016\237\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\016\213\016\213\016\213\016\213\000\000\r\202\r\218\000\000\016\213\016\213\000\000\000\000\017I\019\134\000\000\017I\017I\000\000\r\226\000\000\000\000\000\000\016\213\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\213\014\026\014\"\000\000\000\000\000\000\000\000\016\213\000\000\000\000\014*\014B\000\000\000\000\016\213\016\213\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\017\r\000\000\000\000\017\r\017\r\000\000\017\r\000\000\000\000\000\000\017I\017\r\017\r\017\r\r\242\017\r\000\000\000\000\000\000\000\000\000\000\000\000!\026\000\000\014\130\017\r\017\r\000\000\000\000\000\000\000\000\014j\000\000\000\000\017\r\017\r\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\017\r\017\r\017\r\000\000\r\202\r\218\000\000\017\r\017\r\000\000\000\000\016\225\000\000\000\000\016\225\016\225\000\000\016\225\000\000\000\000\000\000\017\r\016\225\016\225\016\225\r\242\016\225\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017\r\016\225\016\225\000\000\000\000\000\000\000\000\017\r\000\000\000\000\016\225\016\225\000\000\000\000\017\r\017\r\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\016\225\016\225\016\225\000\000\r\202\r\218\000\000\016\225\016\225\000\000\000\000\016\221\000\000\000\000\016\221\016\221\000\000\016\221\000\000\000\000\000\000\016\225\016\221\016\221\016\221\r\242\016\221\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\225\016\221\016\221\000\000\000\000\000\000\000\000\016\225\000\000\000\000\016\221\016\221\000\000\000\000\016\225\016\225\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\016\221\016\221\016\221\000\000\017\017\017\017\000\000\016\221\016\221\000\000\000\000\017\017\000\000\000\000\017\017\017\017\000\000\017\017\000\000\000\000\000\000\016\221\017\017\017\017\017\017\017\017\017\017\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\221\017\017\017\017\000\000\000\000\000\000\000\000\016\221\000\000\000\000\017\017\017\017\000\000\000\000\016\221\016\221\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\017\017\017\017\017\017\017\017\000\000\r\202\r\218\000\000\017\017\017\017\000\000\000\000\016\249\000\000\000\000\016\249\016\249\000\000\016\249\000\000\000\000\000\000\017\017\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017\017\014\026\014\"\000\000\000\000\000\000\000\000\017\017\000\000\000\000\014*\014B\000\000\000\000\017\017\017\017\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\016\233\000\000\000\000\016\233\016\233\000\000\016\233\000\000\000\000\000\000\016\249\016\233\016\233\016\233\r\242\016\233\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\249\016\233\016\233\000\000\000\000\000\000\000\000\014j\000\000\000\000\016\233\016\233\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\016\233\016\233\016\233\000\000\r\202\r\218\000\000\016\233\016\233\000\000\000\000\016\229\000\000\000\000\016\229\016\229\000\000\016\229\000\000\000\000\000\000\016\233\016\229\016\229\016\229\r\242\016\229\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\233\016\229\016\229\000\000\000\000\000\000\000\000\016\233\000\000\000\000\016\229\016\229\000\000\000\000\016\233\016\233\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\016\229\016\229\016\229\000\000\r\202\r\218\000\000\016\229\016\229\000\000\000\000\017\021\000\000\000\000\017\021\017\021\000\000\017\021\000\000\000\000\000\000\016\229\r\234\014\002\014\n\r\242\017\021\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\229\014\026\014\"\000\000\000\000\000\000\000\000\016\229\000\000\000\000\017\021\017\021\000\000\000\000\016\229\016\229\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\017\021\000\000\r\202\r\218\000\000\017\021\017\021\000\000\000\000\016\241\000\000\000\000\016\241\016\241\000\000\016\241\000\000\000\000\000\000\017\021\r\234\014\002\014\n\r\242\016\241\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017\021\014\026\014\"\000\000\000\000\000\000\000\000\017\021\000\000\000\000\014*\016\241\000\000\000\000\017\021\017\021\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\016\241\000\000\016\217\016\217\000\000\016\241\016\241\000\000\000\000\016\217\000\000\000\000\016\217\016\217\000\000\016\217\000\000\000\000\000\000\016\241\016\217\016\217\016\217\016\217\016\217\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\241\016\217\016\217\000\000\000\000\000\000\000\000\016\241\000\000\000\000\016\217\016\217\000\000\000\000\016\241\016\241\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\016\217\016\217\016\217\016\217\000\000\016\209\016\209\000\000\016\217\016\217\000\000\000\000\016\209\000\000\000\000\016\209\016\209\000\000\016\209\000\000\000\000\000\000\016\217\016\209\016\209\016\209\016\209\016\209\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\217\016\209\016\209\000\000\000\000\000\000\000\000\016\217\000\000\000\000\016\209\016\209\000\000\000\000\016\217\016\217\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\016\209\016\209\016\209\016\209\000\000\r\202\r\218\000\000\016\209\016\209\000\000\000\000\016\205\000\000\000\000\016\205\016\205\000\000\016\205\000\000\000\000\000\000\016\209\016\205\016\205\016\205\r\242\016\205\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\209\016\205\016\205\000\000\000\000\000\000\000\000\016\209\000\000\000\000\016\205\016\205\000\000\000\000\016\209\016\209\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\016\205\016\205\016\205\000\000\r\202\r\218\000\000\016\205\016\205\000\000\000\000\016\201\000\000\000\000\016\201\016\201\000\000\016\201\000\000\000\000\000\000\016\205\r\234\014\002\014\n\r\242\016\201\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\205\014\026\014\"\000\000\000\000\000\000\000\000\016\205\000\000\000\000\016\201\016\201\000\000\000\000\016\205\016\205\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\016\201\000\000\r\202\r\218\000\000\016\201\016\201\000\000\000\000\016\197\000\000\000\000\016\197\016\197\000\000\016\197\000\000\000\000\000\000\016\201\r\234\014\002\014\n\r\242\016\197\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\201\014\026\014\"\000\000\000\000\000\000\000\000\016\201\000\000\000\000\014*\016\197\000\000\000\000\016\201\016\201\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\016\197\000\000\r\202\r\218\000\000\016\197\016\197\000\000\000\000\017\029\000\000\000\000\017\029\017\029\000\000\017\029\000\000\000\000\000\000\016\197\r\234\014\002\014\n\r\242\017\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\197\014\026\014\"\000\000\000\000\000\000\000\000\016\197\000\000\000\000\014*\017\029\000\000\000\000\016\197\016\197\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\017\029\000\000\r\202\r\218\000\000\017\029\017\029\000\000\000\000\017\025\000\000\000\000\017\025\017\025\000\000\017\025\000\000\000\000\000\000\017\029\r\234\014\002\014\n\r\242\017\025\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017\029\014\026\014\"\000\000\000\000\000\000\000\000\017\029\000\000\000\000\014*\017\025\000\000\000\000\017\029\017\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\017\025\000\000\r\202\r\218\000\000\017\025\017\025\000\000\000\000\016\245\000\000\000\000\016\245\016\245\000\000\016\245\000\000\000\000\000\000\017\025\r\234\014\002\014\n\r\242\016\245\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017\025\014\026\014\"\000\000\000\000\000\000\000\000\017\025\000\000\000\000\014*\016\245\000\000\000\000\017\025\017\025\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\016\245\000\000\r\202\r\218\000\000\016\245\016\245\000\000\000\000\017\t!\"\000\000\017\t\017\t\000\000\r\226\000\000\000\000\000\000\016\245\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\245\014\026\014\"\000\000\000\000\000\000\000\000\016\245\000\000\000\000\014*\014B\000\000\000\000\016\245\016\245\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\016\253\000\000\000\000\016\253\016\253\000\000\016\253\000\000\000\000\000\000\017\t\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\017\001\000\000\000\000\017\001\017\001\000\000\017\001\000\000\000\000\000\000\016\253\r\234\014\002\014\n\r\242\017\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\253\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\017\005\000\000\000\000\017\005\017\005\000\000\017\005\000\000\000\000\000\000\017\001\r\234\014\002\014\n\r\242\017\005\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017\001\014\026\014\"\000\000\000\000\000\000\000\000\017\001\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\0171\000\000\000\000\0171\0171\000\000\r\226\000\000\000\000\000\000\017\005\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017\005\014\026\014\"\000\000\000\000\000\000\000\000\017\005\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\0175\000\000\000\000\0175\0175\000\000\r\226\000\000\000\000\000\000\0171\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\0179\000\000\000\000\0179\0179\000\000\r\226\000\000\000\000\000\000\0175\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\017-\000\000\000\000\017-\017-\000\000\r\226\000\000\000\000\000\000\0179\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\000\000\014R\014Z\000\000\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\017-\000\000\000\000\000\000\000\000\t\182\000\000\000\000\012\"\000\000\000\000\000\000\000\000\000\000\014\130\000\000\027\014\000\000\000\000\000\000\t\190\014j\000\000\000\000\000\000\000\000\000\000\000\000\014r\014z\n\178\000\000\000\000\t\202\t\214\002^\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\000\000\000\000\000\000\000\000\000\000\t\182\003j\003n\t\169\nN\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\190\000\000\005b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\n\178\000\000\003r\t\202\t\214\002^\000\000\000\000\nR\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\000\000\000\000\r\202\r\218\000\000\000\000\000\000\000\000\000\000\0069\000\000\000\000\014\246\0069\000\000\r\226\003j\003n\000\000\nN\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\005b\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\003r\014*\014B\000\000\000\000\000\000\nR\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\006=\000\000\000\000\015\006\006=\000\000\r\226\000\000\000\000\000\000$_\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\0069\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\016r\000\000\000\000\016\174\t\165\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\006=\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\004\213\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\000\000\014R\014Z\000\000\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\004\213\004\213\002B\004\213\004\213\000\000\000\000\000\000\t\182\000\000\000\000\017\142\000\000\000\000\000\000\016v\000\000\014\130\000\000\000\000\000\000\000\000\000\000\t\190\014j\000\000\000\000\001\026\000\000\000\000\000\000\014r\014z\n\178\000\000\000\000\t\202\t\214\002^\000\000\000\000\004\213\000\000\000\000\004\213\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\000\000\004\213\004\213\000\000\004\213\t\182\003j\003n\018\134\nN\007\133\000\000\004\213\000\000\000\000\000\000\004\213\004\213\000\000\000\000\t\190\000\000\005b\000\000\004\213\000\000\000\000\000\000\000\000\000\000\n\178\004\213\003r\t\202\t\214\002^\000\000\000\000\nR\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\000\000\000\000\000\000\000\000\000\000\t\182\003j\003n\024r\nN\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\190\000\000\005b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\n\178\000\000\003r\t\202\t\214\002^\000\000\000\000\nR\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\000\000\000\000\000\000\000\000\000\000\t\182\003j\003n\026F\nN\000\000\000\000\000\000\000\000\000\000\n\161\000\000\000\000\000\000\000\000\t\190\000\000\005b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\n\178\000\000\003r\t\202\t\214\002^\n\161\n\161\nR\n\161\n\161\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\t\178\001f\011\210\000\000\002>\000\000\011\218\000\000\000\000\000\000\002B\000\000\000\000\000\000\000\000\000\000\t\182\003j\003n\026z\nN\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\190\000\000\005b\000\000\000\000\000\000\n\161\000\000\000\000\000\000\n\178\000\000\003r\t\202\t\214\002^\000\000\000\000\nR\000\000\n\161\n\161\000\000\n\161\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\n\161\000\000\000\000\n\158\n\161\t\229\t\229\000\000\n\161\t\229\n\161\000\000\000\000\000\000\n\161\t\229\003j\003n\000\000\nN\000\000\t\229\000\000\000\000\000\000\t\229\000\000\000\000\000\000\000\000\000\000\000\000\005b\000\000\000\000\000\000\t\229\000\n\000\000\t\193\000\000\000\000\003r\000\000\000\000\000\000\t\150\000\000\nR\t\229\t\229\t\229\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\229\000\000\000\000\t\229\t\229\t\229\000\000\t\229\t\229\t\229\000\000\000\000\000\000\r\202\r\218\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\198\006\173\000\000\r\226\t\229\t\229\000\000\t\229\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\229\000\000\014\026\014\"\000\000\000\000\000\000\000\000\000\000\000\000\t\229\014*\014B\000\000\000\000\000\000\t\229\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\000\000\000\000\000\000\017\006\006\169\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\006\173\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\000\000\000\000\000\000\017\022\t\165\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\006\169\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\000\000\000\000\000\000\n\197\006\241\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\015v\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\000\000\000\000\000\000\027\234\006\249\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\006\241\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\000\000\000\000\000\000\028\002\n\t\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\006\249\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\017J\000\000\000\000\000\000\000\000\000\000\r\202\r\218\r\210\r\250\0142\014:\014J\000\000\000\000\000\000\n\201\014R\014Z\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\001\018\001\022\004\242\014\026\014\"\000\000\001V\000\000\n\t\000\000\014\130\000\000\014*\014B\000\000\000\000\001b\014j\000\000\t\169\000\000\011\161\000\000\001\134\014r\014z\000\000\r\210\r\250\0142\014:\014J\000\000\000\000\b\198\000\000\014R\014Z\000\000\000\000\000\000\b\218\000\000\000\000\000\000\001\130\002\"\t\146\000\000\000\000\000\000\000\000\000\000\017N\t\166\001\170\002&\002*\000\000\002.\005\026\000\000\005\030\000\000\014\130\000\000\000\000\000\000\000\000\r\202\r\218\014j\020>\000\000\000\000\000\000\017i\000\000\014r\014z\017i\000\000\r\226\000\000\020F\020b\005F\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\005b\000\000\000\000\014\026\014\"\000\000\000\000\000\000\000\000\020j\000\000\000\000\014*\014B\006\166\000\000\006\170\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\017u\000\000\000\000\030\158\017u\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\017y\000\000\000\000\031r\017y\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\r\210\r\250\0142\014:\014J\000\000\r\202\r\218\000\000\014R\014Z\000\000\000\000\017q\000\000\000\000\000\000\017q\000\000\r\226\000\000\000\000\000\000\000\000\r\234\014\002\014\n\r\242\014\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\130\014\026\014\"\000\000\000\000\000\000\000\000\014j\000\000\000\000\014*\014B\000\000\000\000\014r\014z\000\000\000\000\000\000\000\000\t\178\001f\000\000\000\000\002>\r\210\r\250\0142\014:\014J\002B\000\000\000\000\000\000\014R\014Z\t\182\000\000\000\000\002\178\000\000\000\000\000\000\000\000\000\000\t\221\000\000\000\000\t\221\t\221\000\000\t\190\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\n\178\014\130\000\000\t\202\t\214\002^\000\000\000\000\014j\000\000\000\000\005\022\000\000\000\000\001\170\014r\014z\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\t\221\000\000\000\000\007*\001\018\001\022\023\006\000\000\000\000\000\000\001V\000\000\000\000\000\000\000\000\000\000\003j\003n\000\000\nN\001b\000\000\012\025\000\000\000\000\012\025\000\000\001\134\000\000\019\238\000\000\t\221\005b\000\000\000\000\000\000\000\000\000\000\023B\t\221\000\000\000\000\003r\000\000\000\000\023N\000\000\t\221\nR\001\130\002\"\023^\000\000\t\221\000\000\000\000\000\000\000\000\t\166\001\170\002&\002*\000\000\000\000\005\026\001f\005\030\000\000\002>\000\000\000\000\000\000\000\000\000\000\002B\000\000\023n\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\023v\023\146\005F\002\154\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\158\000\000\000\000\000\000\000\000\000\000\000\000\002\166\002^\023\154\006!\006!\002b\002\150\000\000\002\186\000\000\001\170\002\198\000\000\002\214\000\000\003\170\003V\000\246\000\000\003f\t\178\001f\000\000\000\000\002>\000\000\000\000\000\000\000\000\000\000\002B\000\000\000\000\000\000\000\000\000\000\t\182\003j\003n\n\146\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004.\000\000\t\190\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003r\t\202\t\214\002^\000\000\000\000\003\174\000\000\000\000\000\000\000\000\000\000\001\170\000\000\000\000\n\002\002.\n\n\000\000\n\"\nF\003f\000\000\000\000\000\000\000\000\000\000\000\000\n\225\n\225\000\000\000\000\n\225\000\000\000\000\000\000\000\000\000\000\n\225\003j\003n\000\000\nN\000\000\n\225\000\000\000\000\000\000\018F\000\000\000\000\000\000\007\133\000\000\000\000\005b\000\000\000\000\000\000\n\225\000\000\000\000\000\000\000\000\000\000\003r\000\000\000\000\000\000\007\133\000\000\nR\n\225\n\225\n\225\007\133\007\133\000\000\007\133\007\133\000\000\007\133\000\000\n\225\000\000\000\000\n\225\n\225\n\225\000\000\n\225\n\225\n\225\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\026\007\133\000\000\000\000\000\000\000\000\000\000\000\000\n\225\n\225\000\000\n\225\007\137\000\000\007\133\000\000\000\000\007\133\000\000\000\000\000\000\000\000\000\000\007\133\n\225\000\000\000\000\000\000\000\000\007\137\000\000\007\133\007\133\000\000\n\225\007\137\007\137\000\000\007\137\007\137\n\225\007\137\000\000\007\133\000\000\007\133\000\000\000\000\000\000\000\000\000\000\007\133\000\000\007\133\000\000\000\000\000\000\007\133\007\133\000\000\000\000\000\000\001*\007\137\000\000\007\133\000\000\000\000\000\000\000\000\000\000\000\000\007\133\007\141\000\000\000\000\007\137\000\000\000\000\007\137\000\000\000\000\000\000\000\000\000\000\007\137\000\000\000\000\000\000\000\000\007\141\000\000\000\000\007\137\007\137\000\000\007\141\007\141\000\000\007\141\007\141\000\000\007\141\000\000\000\000\007\137\000\000\007\137\000\000\000\000\000\000\000\000\000\000\007\137\000\000\007\137\000\000\000\000\000\000\007\137\007\137\000\000\000\000\0012\007\141\000\000\000\000\007\137\000\000\000\000\000\000\000\000\000\000\000\000\007\137\000\000\000\000\007\141\000\000\000\000\007\141\000\000\000\000\000\000\000\000\000\000\007\141\nE\000\000\000\000\nE\000\000\000\000\000\000\007\141\007\141\nE\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\007\141\000\000\007\141\000\000\000\000\000\000\000\000\nE\007\141\000\000\007\141\000\000\000\n\000\000\007\141\007\141\000\000\000\000\nE\000\000\000\000\000\000\007\141\000\000\000\000\nE\nE\000\000\000\000\007\141\nE\nE\000\000\nE\000\000\nE\nE\000\000\nE\000\000\nE\nE\nE\000\000\nE\000\000\001f\000\000\000\000\002>\000\000\000\000\000\000\000\000\000\000\002B\000\000\000\000\000\000\000\000\000\000\000\000\nE\nE\t%\000\000\000\000\000\000\000\000\002z\t\221\000\000\002~\t\221\t\221\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\130\000\000\000\000\000\000\000\000\nE\000\000\002\138\002^\000\000\000\000\nE\002b\002\150\005\022\002\186\000\000\001\170\002\198\000\000\003&\000\000\003>\003V\000\246\014\029\003f\000\000\t\221\001f\000\000\007*\002>\000\000\000\000\000\000\000\000\001\018\002\026\000\000\000\000\"\022\000\000\001V\003j\003n\014\029\014\029\000\000\014\029\014\029\000\000\000\000\001b\000\000\000\000\000\000\019\250\000\000\t\221\001\134\000\000\000\000\"\030\000\000\000\000\000\000\t\221\000\000\000\000\003r\000\000\000\000\n\174\000\000\t\221\003v\000\000\000\000\000\000\000\000\t\221\"\"\002\"\000\000\000\000\n\238\000\000\011\002\000\000\011\014\000\000\001\170\002&\002*\000\000\002.\"F\000\000\007*\000\000\014\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001f\003n\000\000\002>\000\000\014\029\014\029\000\000\014\029\002B\"R\000\000\000\000\005F\000\000\000\000\000\000\000\000\000\000\000\000\014\029\000\000#\002\014\029\014\029\005b\002F\000\000\014\029\000\000\014\029\000\000\"Z\000\000\014\029\000\000\000\000\002J\000\000\"b\000\000\000\193\000\000\000\000\002R\002^\000\000\000\000\000\000\002b\002\150\000\000\002\186\000\000\001\170\002\198\000\000\003\238\000\000\003\170\003V\000\246\000\000\003f\000\193\000\193\000\000\000\193\000\193\000\000\000\000\000\000\000\000\000\000\000\000\000\201\000\000\000\000\000\000\000\000\000\000\003j\003n\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\130\000\000\000\000\000\000\000\000\000\000\000\000\000\201\000\201\000\000\000\201\000\201\000\000\000\000\000\193\000\000\003r\000\193\000\000\000\000\000\000\000\000\004\006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\193\000\000\001\130\000\000\bY\001A\001A\000\000\001A\001A\000\193\000\193\000\000\000\193\000\000\000\000\000\201\000\000\000\000\000\201\000\000\000\193\000\000\000\193\000\000\000\193\000\193\bY\bY\000\000\bY\bY\004j\000\193\000\201\000\193\000\000\000\000\002\189\000\193\000\193\000\000\000\000\002\198\000\201\000\201\001A\000\201\003V\000\246\000\000\000\000\000\000\000\000\000\000\000\201\000\000\000\201\000\000\000\201\000\201\002\189\002\189\000\000\002\189\002\189\000\000\000\201\bY\000\201\000\000\bY\000\000\000\201\000\201\000\000\000\000\001A\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001A\000\000\000\000\000\000\000\000\004\213\000\000\000\000\001A\000\000\000\000\005\186\bY\000\000\bY\000\000\000\000\002\189\001A\001A\002\189\000\000\bY\000\000\bY\000\000\bY\bY\004\213\004\213\000\000\004\213\004\213\000\000\bY\000\000\bY\000\000\000\000\000\000\bY\bY\000\000\000\000\000\000\000\000\002\189\000\000\002\189\000\000\000\000\000\000\000\000\000\000\000\000\001*\002\189\000\000\002\189\000\000\002\189\002\189\000\000\000\000\000\000\000\000\000\000\000\000\002\189\004\213\002\189\000\000\004\213\000\000\005\210\002\189\001\018\001\022\018\190\000\000\000\000\000\000\001V\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001b\000\000\000\000\000\000\000\000\004\213\004\213\0052\004\213\000\000\000\000\000\000\000\000\000\000\007\137\004\253\004\213\003\166\012f\012z\004\213\004\213\000\000\000\000\000\000\004\234\000\000\002f\004\213\001\130\002\"\004^\000\000\000\000\000\000\004\213\000\000\000\000\000\000\001\170\002&\002*\000\000\002.\005\026\004b\005\030\000\000\004j\002n\001\018\001\022\000\000\000\000\000\000\000\000\001V\000\000\000\000\002\198\000\000\000\000\000\000\012n\003V\000\246\001b\000\000\000\000\"&\005F\002r\000\000\001\134\000\000\000\000\000\000\000\000\000\000\004\253\004\253\000\000\005b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\150\000\000\000\000\000\000\001\130\002\"\001\018\001\022\017\n\000\000\000\000\000\000\001V\000\000\001\170\002&\002*\000\000\002.\005\026\000\000\005\030\001b\000\000\000\000\t\169\000\000\006\129\000\000\001\134\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\005F\000\000\001\150\000\000\000\000\000\000\001\130\002\"\001\018\001\022\000\000\000\000\005b\000\000\001V\000\000\001\170\002&\002*\000\000\002.\005\026\000\000\005\030\001b\000\000\000\000\"\138\000\000\"J\000\000\001\134\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\005F\000\000\001\150\000\000\000\000\000\000\001\130\002\"\001\018\001\022\000\000\000\000\005b\000\000\001V\000\000\001\170\002&\002*\000\000\002.\005\026\000\000\005\030\001b\000\000\006\166\000\000\006\170\000\000\000\000\001\134\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\005F\000\000\004\234\000\000\000\000\000\000\001\130\002\"\001\018\001\022\000\000\000\000\005b\000\000\005V\000\000\001\170\002&\002*\000\000\002.\005\026\000\000\005\030\001b\000\000\006\166\000\000\006\170\003q\003q\001\134\000\000\000\000\000\000\003q\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003q\000\000\005F\000\000\001\150\000\000\000\000\003q\001\130\002\"\005\n\014\021\000\000\000\000\005b\000\000\000\000\000\000\001\170\002&\002*\000\000\002.\005\026\000\000\005\030\000\000\000\000\000\000\003q\003q\000\000\014\021\014\021\000\000\014\021\014\021\000\000\000\000\003q\003q\003q\000\000\003q\003q\000\000\003q\000\000\000\000\005F\000\000\001\018\001\022\025j\000\000\000\000\000\000\001V\000\000\000\000\000\000\005b\000\000\000\000\000\000\000\000\000\000\001b\000\000\000\000\003q\000\000\001\018\001\022\0052\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003q\000\000\000\000\000\000\000\000\014\021\001b\000\000\000\000\000\000\000\000\"\150\000\000\001\134\001\130\002\"\000\000\001\018\001\022\014\021\014\021\000\000\014\021\001V\001\170\002&\002*\nz\002.\005\026\017\137\005\030\000\000\001b\014\021\001\130\002\"\014\021\014\021\000\000\001\134\000\000\014\021\000\000\014\021\001\170\002&\002*\014\021\002.\005\026\000\000\005\030\017\137\017\137\005F\017\137\017\137\000\000\000\000\017\153\000\000\001\130\002\"\000\000\000\000\000\000\005b\000\000\000\000\000\000\000\000\001\170\002&\002*\000\000\002.\005\026\000\000\007*\000\000\000\000\000\000\017\153\017\153\000\000\017\153\017\153\005b\000\000\017\149\000\000\000\000\000\000\017\137\000\000\000\000\017\137\000\000\000\000\000\000\000\000\006\166\005F\006\170\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017\149\017\149\005b\017\149\017\149\000\000\000\000\000\000\024\206\000\000\017\137\017\153\017\137\000\000\017\153\000\000\000\000\000\000\000\000\000\000\017\137\000\000\bZ\000\000\017\137\017\137\000\000\001\161\000\000\000\000\000\000\001\161\017\137\000\000\024\014\024\018\000\000\000\000\000\000\017\137\017\153\017\149\017\153\t\189\017\149\000\000\000\000\000\000\001\"\t\221\017\153\000\000\t\221\t\221\017\153\017\153\030\254\000\000\000\000\000\000\000\000\000\000\017\153\t\166\000\000\000\000\000\000\000\000\000\000\017\153\017\149\000\000\017\149\000\000\025&\025.\005\022\000\000\001\"\000\000\017\149\000\000\000\000\000\000\017\149\017\149\000\000\000\000\000\000\000\000\t\221\000\000\017\149\007*\029z\000\000\000\000\000\000\000\000\017\149\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\025>\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020\006\000\000\t\221\000\000\000\000\000\000\006]\000\000\000\000\000\000\t\221\000\000\000\000\000\000\000\000\000\000\000\000\000\000\t\221\000\000\000\000\000\000\000\000\000\000\t\221"))
  
  and lhs =
    (16, "\000\006\000\005\000\004\000\003\000\002\000\001\000\000\001-\001-\001-\001-\001,\001,\001+\001+\001*\001*\001)\001)\001(\001(\001'\001'\001&\001&\001&\001%\001%\001%\001$\001#\001#\001#\001\"\001\"\001!\001!\001 \001 \001\031\001\031\001\030\001\030\001\029\001\029\001\028\001\028\001\028\001\028\001\028\001\028\001\028\001\028\001\028\001\028\001\028\001\027\001\027\001\026\001\026\001\026\001\026\001\026\001\026\001\025\001\025\001\024\001\023\001\023\001\023\001\023\001\023\001\023\001\023\001\023\001\023\001\023\001\022\001\021\001\021\001\020\001\020\001\020\001\020\001\020\001\020\001\020\001\020\001\020\001\019\001\019\001\019\001\018\001\018\001\018\001\018\001\018\001\018\001\018\001\018\001\018\001\018\001\018\001\018\001\018\001\017\001\017\001\017\001\017\001\016\001\016\001\015\001\014\001\r\001\r\001\r\001\012\001\012\001\011\001\011\001\011\001\011\001\011\001\011\001\011\001\011\001\011\001\011\001\011\001\011\001\011\001\n\001\n\001\n\001\n\001\t\001\b\001\b\001\007\001\006\001\006\001\005\001\005\001\004\001\004\001\004\001\004\001\003\001\003\001\003\001\003\001\003\001\002\001\001\001\000\001\000\001\000\001\000\000\255\000\254\000\254\000\254\000\254\000\254\000\254\000\254\000\254\000\254\000\254\000\254\000\254\000\253\000\252\000\252\000\252\000\251\000\251\000\250\000\250\000\249\000\249\000\248\000\248\000\247\000\247\000\246\000\246\000\245\000\245\000\244\000\244\000\243\000\243\000\242\000\242\000\241\000\241\000\240\000\240\000\239\000\239\000\239\000\238\000\238\000\238\000\238\000\238\000\237\000\237\000\237\000\237\000\237\000\237\000\236\000\236\000\236\000\236\000\236\000\236\000\236\000\235\000\235\000\234\000\234\000\234\000\234\000\234\000\234\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\233\000\232\000\231\000\230\000\230\000\229\000\228\000\228\000\228\000\228\000\228\000\228\000\227\000\227\000\227\000\227\000\227\000\227\000\226\000\226\000\225\000\225\000\225\000\225\000\224\000\224\000\224\000\224\000\223\000\223\000\223\000\223\000\222\000\221\000\221\000\220\000\220\000\219\000\218\000\217\000\216\000\215\000\215\000\215\000\215\000\214\000\214\000\214\000\214\000\214\000\214\000\213\000\213\000\212\000\212\000\211\000\211\000\211\000\211\000\210\000\210\000\209\000\209\000\209\000\209\000\208\000\208\000\208\000\208\000\208\000\208\000\207\000\207\000\206\000\206\000\206\000\206\000\206\000\205\000\205\000\204\000\203\000\203\000\203\000\202\000\202\000\201\000\201\000\201\000\201\000\201\000\201\000\200\000\199\000\199\000\198\000\198\000\197\000\197\000\196\000\196\000\196\000\195\000\195\000\194\000\194\000\193\000\193\000\193\000\193\000\193\000\192\000\192\000\192\000\192\000\192\000\191\000\191\000\190\000\190\000\189\000\189\000\188\000\188\000\187\000\187\000\187\000\186\000\185\000\185\000\184\000\184\000\183\000\183\000\182\000\182\000\181\000\181\000\180\000\180\000\179\000\179\000\178\000\178\000\177\000\177\000\176\000\176\000\175\000\175\000\174\000\174\000\173\000\173\000\172\000\172\000\171\000\171\000\170\000\170\000\169\000\169\000\168\000\168\000\167\000\167\000\166\000\166\000\165\000\165\000\164\000\164\000\164\000\164\000\163\000\163\000\162\000\162\000\161\000\161\000\160\000\160\000\159\000\159\000\158\000\158\000\157\000\157\000\156\000\156\000\155\000\155\000\154\000\154\000\153\000\153\000\152\000\152\000\151\000\150\000\149\000\149\000\149\000\149\000\148\000\148\000\148\000\147\000\147\000\147\000\146\000\146\000\145\000\145\000\144\000\144\000\143\000\143\000\142\000\142\000\142\000\142\000\142\000\142\000\141\000\140\000\140\000\140\000\140\000\140\000\140\000\140\000\140\000\139\000\139\000\138\000\137\000\137\000\137\000\137\000\136\000\136\000\136\000\136\000\136\000\135\000\135\000\134\000\134\000\133\000\132\000\132\000\131\000\131\000\130\000\130\000\130\000\129\000\129\000\128\000\128\000\127\000~\000~\000}\000}\000|\000|\000{\000{\000z\000z\000z\000z\000z\000z\000z\000z\000y\000y\000y\000y\000y\000y\000y\000y\000x\000x\000w\000w\000v\000v\000u\000u\000t\000t\000t\000s\000s\000r\000r\000r\000r\000q\000p\000p\000p\000p\000p\000o\000o\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000n\000m\000m\000l\000l\000k\000k\000j\000j\000i\000i\000h\000h\000g\000g\000f\000f\000e\000e\000d\000d\000c\000c\000b\000b\000a\000a\000`\000`\000_\000_\000^\000^\000]\000]\000\\\000\\\000[\000[\000Z\000Z\000Y\000Y\000X\000X\000W\000W\000V\000V\000U\000U\000T\000S\000S\000S\000R\000Q\000P\000O\000O\000N\000M\000M\000L\000L\000L\000K\000K\000K\000K\000K\000K\000K\000K\000K\000J\000J\000J\000J\000J\000J\000I\000I\000H\000G\000G\000F\000F\000E\000D\000D\000D\000D\000D\000D\000D\000D\000D\000D\000D\000D\000D\000D\000D\000C\000C\000C\000B\000B\000B\000B\000A\000A\000@\000@\000?\000?\000>\000>\000>\000>\000=\000=\000=\000=\000=\000=\000=\000<\000<\000;\000;\000;\000;\000:\000:\000:\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0009\0008\0008\0007\0007\0007\0007\0007\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0006\0005\0005\0005\0005\0005\0005\0005\0005\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0004\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0003\0002\0002\0002\0002\0001\0001\0001\0001\0000\0000\000/\000/\000/\000/\000.\000-\000-\000-\000-\000-\000-\000-\000-\000-\000-\000,\000,\000,\000,\000,\000,\000,\000,\000,\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000+\000*\000*\000)\000)\000)\000)\000(\000'\000'\000&\000%\000%\000$\000#\000#\000#\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000\"\000!\000!\000 \000 \000 \000 \000\031\000\030\000\029\000\029\000\029\000\028\000\028\000\027\000\027\000\027\000\027\000\027\000\027\000\026\000\026\000\025\000\025\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\024\000\023\000\022\000\021\000\020\000\019\000\018\000\017\000\017\000\017\000\016\000\016\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\014\000\r\000\012\000\012\000\011\000\011\000\n\000\n\000\n\000\n\000\n\000\n\000\t\000\b\000\b\000\007\000\007\000\007\000\007\000\007")
  
  and goto =
    ((16, "\006V\002\020\000\168\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001J\000\000\000\000\000g\018\232\002R\000<\000\023\000\030\000\203\000\000\000\000\000^#p\000\000\000\000\001\001\000\000\000\000\000\000\000%\000\000\000\194\000\000\000\000\000\249\000\000\000\000\000\000\000\000\000\000\000\000\000\000\028\140\000\159\000\000\000\000\000\000\000\000\000\000\000\000\001\004\021\242\000*\000\000\000\000\000\000\001j\000\000\n\246\000\000\bz\002\188\001\242\001h\000\000\002\b\000\134\001\174\000\000\000\242\000\000\000\000\000\000\001\204\000\000\000\000\000\000\002l\000\000\000\000\000\000\000\000\003\128\003\236\000\000\000\000\000\000\000\026\014\214\000\133\016 \000\000\016v\015\022\003$\002\158\002\228\017*\000\000\000\000\030r\000\220\000\000\016\018\005L6X\000\000\002\190\000\000\003\146\003\168\000\000\rn R*L\003\168\000\000\016~\007\184VX\b\224\024(\004v\000\000\016\196\000\000\000\000\000\000*L\000\252\004\004\000\000\001\025\004*\000\000\tX\000W\000\000\000\000\0290\000\000\000\000\000\000\000\000\016~\000\000\000\000\000\000\000\000\000\000\000\000\003.\000?\"\168\000\000#\226\003\138\000\000\000\000\0058\005b\029h\000\151\000\000\006\"\000\000\000\000\000\000\000\233\000\000$H+\200\000\000\000\000\000\000\000\000\006\014\000\216\022\184\000\000\b>\000tKL\000\000\000\000\000\000\000\000\002$0\216\000\000\006\156\000\216\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bz\017H\003Z\006`\b~Vn\005\b\000\000\000\000\bR\000\000\000\000\007\138\000\000\000\000\000\000R\028\000\000\007\146\000\000\000\000\n\224\000\000\r\\RB\000\000\000\000\000\000\002d\000\000\000\000\000\000S\014\002$\000\000R\248\000\000\000\143\000\000\000\000\022\254\000\000\000r\000\146\000\000\000\000\000\000\000\000\000\000\000\146\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\005\224\031\212\001n\004\004\b\246\0068\004\002\000$\003\014\b\016\000\000\001\248\001<\018\208$\148\000\000\000\000\014\252\000\000\023N\b8\t\"\b\220\t\"\000\000\t\202\000/\000\000\023|\000\000\000\000\029\024\000\000\000\000\000\000\011\252\000\000\000\000\014\224\000\000\000\000\000\000\000\t\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000`\000\000\000\000\000\000\b\168\000\000\0056\000\000\000\000\000\000\000\000\014B\000\000\000\000\000\000\000\000\000\000\015F\015h\023\214\000\000\000\000\000\000\000\000\020\192\000\000\000\000\000\000$8\000\000\000\000\000\000\024\184\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\024\238\000\000\000\000\025V\000\000\015|\005b\000\000\000\000\000\000\015\164\004\\\000\000\000\000\000\000\000\000\000\000\025\028\000\000\000\000\000\000\000\000\0040\015\016\014\162\000\000\007\210\000\000\000\000\b\018\000\000\000\000\000\000\000\000\0154\014\190\b \000\000\000\000\000\000\000\000\006\030\000\000\000\000\000\000\000\195\000\000N\176\000\000\000\000\003\152\000\000\000\000\006\156\000\000\002@\000\000\015\252\000\000\000\000\025z\000\000\000\000\000\000\025\208\000\000\0166\000#\000\000\000\000\000\000\000\000\000\000\016<$\164\000\000\000\000\000\000\000\000\000\000\000\000\016f$\222\000\000\000\000\000\000\000\000\000\000\003,\000\000\000\000\004\\\000\000\000\000\007\014\000\000\011\"\000\000\011\246\000\000\001\150\015^\003J\000\000\000\000\005\242\015l\005\014\000\000\006\016\000\000\b\212\000\000\000\000\004\156\006|\015p\006\022\000\000\n.\015|\tp\000\000\011\140\000\000\000\000\012\028\000\000\000\000\000\000\001r\030\128\000\000$\250\000\000\016v\000\000\0170\000\134\000\000\005\130\003\014\000\000\000\000\000\243\000\000\0178\000\000\000\000\000\000\000\000\000\000\000\000\006\"\000\000\015\164\0076\000\000\016\216\000\000\016n\000\000\000\000\000\000\015\224\002\194(\140\000\000\000\000\000\000\000\000\002\n\003\200\000\000\000\000\000\000\000\000\b\022\000\000\015\196&\018\016\182\000\000&~\000\000\016\130\000\000\006\"\000\000\000\000\007^\000\000\000\000\000\000\017\154\000\000\000\000\015\246\000\000\000\000\000\000\000\000.\134\000\000\000\0001\236\000\000\000\000\000\000\017\158\000\000\000\000&\150\000\000\005B\003\006P\172\000\000\001\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003z\000\000\000\000\000\000\000\000\016\242\000\000\018|\000\000\000\000\000\000\003:Q\022\002&\000\000\000\000\016\238\016\246QB\t\026\001\014\000\000\t\146\016\244\000\000\000\000\000\000Qz\000B\003z\002\246\016\026\021\232\016\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004L\000\000\000\000\000\000\000\000Q\154\000\000\000\000\000\000\b\186\000\000\000\000\002\228\012\226\000\000\000\000\000\000\000\000&\212\000\000Q\178\000\000\017\162\000\000\017\"/\152\000\000\000\000\000\000\005\224\017$\000\000\000\000\000\000\b\022\000\000\000\000\t\192\000\000\000\000\000\000\000\000\000\000\000\000\017\236\000\000\000\000\000\000\006\b\000\000\000\000\n\224\000\000\000\000\000\000\nV\000\000\000\000\000\000\000\000\0178\000\000\000\000\000\000\000\000\017\246\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\019\134\000\000R\222\000\000\000\000\000\000&T\t|\005Z&\234\000\000\000\000\000\000\005f@\192\000\000\000\000\000\000'V\000\000\nt\000\000Q\206\000\000'\134\000\242\000\000\005\136\000\000($\000\000\000\000\017>\024X\000\000\000\000\000\000\000\000\017R\000\000\000\000\000\000\000\000'\182'\200St\002$S\156\002$(6(\210\002$\000\000\000\000(\226\000\000\bz\018\030\007j\000\000\000\000\000\000\003\028\000_\000\000\003\0282t\000\000\000\000\000\000\000\000\000\000\000\000\000\000\017^\002\150\000\000\000\000\016|\014\004\000\0006\140\000\000\000\000\n\246\000\000\000\000\000\000\007\232\003\028\000\000\b\b\003\028\000\000\000\000\000\000\000\"\000\000\000\000\017h\018\134\000\000\000\000\000\000\000\000\000\000\017\140\b\142\020\250\000\000\000\000\000\000\000\000\0124\003\028\000\000\022\000\000\000\000\000\000\000\000\000\000\252'\200\000\000\000\000\000\000\002d\000\000)n\000\000)\174\000\000\017~\029\230\000\000\018 *\026\000\000*^\000\000*\202\000\000*\222\000\000+f\000\000+\166\000\000,@\000\000,X\000\000,\192\000\000,\242\000\000-2\000\000-r\000\000-\180\000\000.\026\000\000.\156\000\000/\024\000\000/>\000\000/\192\000\0000\0000B\000\000\000\0000h\000\0000\230\000\0001\142\000\0001\190\000\0002:\000\000\000\000\000\000\000\000\000\000\000\000\001\019\016\176\000\000\000\000\000\000\016\164\000\000$\216\000\000\000\000S\182\000\000\000\000\000\000\000\000T\000\000\000\000\0002J\000\000\000\000\b22\184\000\000\000\000\005\170\017\1442\234\000\000\000\000\000\000\000\000\000\000\0190\000\000\000\000\003\222\000\000\000\000\000\000\006\166\017\162\016\180\000\000\000\000\000\000\000\000\003 \000\000\000\00034\017\170\000\000\000\000\000\000\030\216\000\000\n\248\b\214\000\0003v\000\000\017\172\017\188\nB\000\0003\188\000\000\000\000\000,\017\21642\000\000\000\000\000\000\000\000\n\138\017$4\152\017&\017\202\000\000\017\210\011$\000\0004\190\000\000\000\000\017\208\000\000\000\000\017\212\018\\\000\000\000\000\005\228\000\000\000\000\000\000\000\000\000\000\000\000\017\236\011\136\017L58\017d\018\b\000\000\000\000\018\012\000\000\000\0005\156\018\016\000\000\018\022\011\198\017t5\180\017v\018\026\000\000\000\000\0180\000\000\000\000\000\000\000\000\000\000\000\0006\024\000\000\012X6\146\000\000\000\0006\184\000\000\030\232\0186\000\000\000\0007\030\000\000\000\0007\130\000\000\000\000\000\000\000\000\000\000\000\000\012|7\148\000\000\000\000\031t\0188\000\000\000\000\000\000\000\000\028\220\000\0008\014\000\000\0316\017&\000\000\000\0008n\000\000T\022\002$\000\000\000\000\018d,\024\000\000\004\1568z\000\000\000\000\000\0005\000\018h\004\174\000\000\018X\000\000\018t\007\202\000\000\018`\000\000\018~\b \000\000R2\018\1368\236\000\000\000\0008\254\000\000\017\194\018\016\000\000\000\000\000\000\000\000\018z\000\000\017\146\007\232\000\000\016~\000\000\000\0009b\000\0009\198\000\000\000\000\000\000\000\000\000\000:&\000\000\002\212\018\202\000\000/t\000\0009\238\000\000:V\000\000\004\208:\160\018\154\0015;\018\000\000\000\000\000\000;B\018\162\011d\000\000\018\142\000\000\018\168\0128\000\000\018\148\000\000\018\172\012R\000\000\031\212\018t\018z\000\000\000\000;\234\000\000;J\000\000\000\000<@\000\000<L\000\000\018\196<\166\000\000\000\000\000\000<\190\000\000\000\000\000\000=,\000\000\000\000\000\000TF\002$\r\224\003\028\011\180\001\248T\136\002$=F\000\000\000\000\011\182\012,\018\000\018\016\000\000\012\176\000\000Rj\000\000=\174\017\140=\246\000\000T\202\002$\019h\000\000>*\000\000\000\000\tT\018\154\000\000\000\000\000\000\000\242\001<\000\019\000\000\000\000\003,\012r\000\000\000\000\004\\\012\132\000\000\000\000\007\014\012\152\000\000\011\"\012\220\000\000\011\246\r\024\000\000\000\000\000\000\000\000\002\152\000\000>^\000\0004\232\000\000>\168\000\000\t\168U\130\000\000\019\156\000\000>\220\000\000\000\000\r\020\000\000\017\238\000\000\012B\000\000\003L\000\000\018F\006 \000\000\000\000\019\148\018\b\000\000\000\000\000\000\018\238\014\130\000\000\000\000\000\000\011\232\018@\n\180\018\196\000\000\019\194\000\000\000\000\000\000\000\000?^\000\000\000\000\019\198\000\000\000\000\026\006\000\000\019\200\000\000\000\000\026\146\000\000\004\214\000\000\000\000\000\000\000\000\000\000\018p\026\232\019\b\000\000\000\000\000\000\000\000\000\000\000\000\t\014\000\000\024\244 .\000\000?\152\000\000\000\000@\014\000\000\000\000\018<\014\142\000\000\019\234\000\000\000\000\027t\000\000\019\236\000\000\000\000\027\170\000\000\011\016\000\000 \\\000\000\000\000\0196\003\n\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\0062\000\000\000\000\000\000\011\224\000\000\000\000\000\000\000\206\012\006\000\000\000\000\0124\000\000\000\000\003\250\000\000\000\000\018\144\000\000\000\191\000\000\000\000\000\000\003\224\000\000\006f\012|\000\000\000\000\012\238\000\000\000\000\007\238\000\000\000\000\000\000\026b\000\000\000\000\000\000\000\000\003\168\018\226\000\000\000\000\rtV\200\000\000\000\000\000\000\000\000\r\226\002^\000\000\014@\000\000\000\000\000\000\014N\000\000\000\000\bp\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\185\019\030\006\142\014b\003\014\018:\007P\000\000\000\000\000\000\000\000\014\252\000\000\018>\t~\000\000\019l\018\244\000\000\000\000\018f\014^\000\000\020\b\000\000@J\000\000V\210\000\000\020\n\000\000@\136\000\000\000\000\r\170\000\000\018t\000\000\r\192\014\214\006n\000\000\tF\000\000\b$\019\030\000\000\000\000\014d\tD\000\000\000\000\000\000\000\000\000\000\000\000\006\168\000\000\011\192\000\000\rj\020\138\014n\rr\000\000\018d\019B\000\000\000\000\007|\020^\002\212T\238\002$\019\162\tH\r\168\014\198\000\000\000\000\000\000\000\000A\\\000\000\n|\006T\000\000\000\000\000\000\011@\000\000A\144\000\000\011\162\000\000\019z\000\000\000\000\015\224\000\000\019\138\000\000\000\000\017\146\000\000\019\160\000\000\000\000\000\000 \176\000\000\000\000\000\000\000\000\n\214\015>\000\000\019^\000\000\000\000\0204A:\018\196\000\000A\242\000\000\000\000\0206B\006\000\000\000\000B\130\000\000\0146\019\230El\000\000U\004\002$\019\206\019j\019\184\000\000 \222\000\000\000\000\014v\000\000\000\000\000\000\028\000\000\000\r\156\0286\019\130\000\000B\200\r\158\000\000\000\000\r\188\000\000\000\000\000\000\019\182\000,\n\214\000\000\015.\000\000\000\000\000\000\018bR\130\000\000\000\000\000|\000\000\000\000\000\000\020\134\005\184F\022\nt\000\000P<\n\140\000\000\000\000\000\000\000\000\000\000\001v\000\000\000\000\000\000\000\000\015\n\000\000\000\000\000\000\000\000\021\178\000\000\000\000\000\000\000\000\000\000B\240\015\026\000\000\019\176\000\000\015\156\000\000\019\178\000\000\015\192B\252\015\218\000\000C\168\015\240\000\000\019\182\000\000\015\254\000\000\019\184\000\000\016\014\000\000\000\000\019\188\000\000\016&\000\000\000\000\000\239\015h\000\000\000\000\016:\000\000\000\000\003\156\000\000D\012\000\000Ur\002$\000\000\000\000DD\000\000D\134\000\000D\184\000\000D\208\000\000E\000\000\000E8\000\000E|\000\000E\188\000\000F\182\000\000F\246\000\000G:\000\000Gr\000\000G~\000\000G\222\000\000G\240\000\000H\014\000\000Ht\000\000H\172\000\000Ih\000\000I\232I\248\000\000\000\000J\\\000\000Jl\000\000J\164\000\000J\232\000\000\000\000K\024\000\000\000\000\007X\000\000\000\000\000\000\002$Kb\000\000\000\000K\222\000\000\014\222LR\000\000\000\000Lf\000\000!\"\019\192\000\000\000\000M\002\000\000\000\000M\014\000\000\b\006\000\000\015\152\014\148\003\028W\000\015\176\000\000\000\000\000\000\tt\005\144\000\000\n$\000\000\000\000\000\000\nZ\000\000\000\000\b\184\000\000\000\000\000\r\019\178\n\166\015v\003\014\018\200\002$\000\194\n\144\003,\000\000\000\000\003\172\011\196\007 \000\000\0070\000\000\n\180\000\000\000\000\011\204\b^\012 \012T\000\000\012\026\012f\012x\000\000\r\018\000\000\000\000\r\190\000\000\000\000\000\000\000\000\000\000\015\138\000\000\018\202\004@\000\000\000\000\019\218\018\240\015\240\000\000\0146\015B\003\028\020\150\000\000L\204\000\000\000\000\015L\000\000\r\020\000\000\016|\td\000\000\000\000\011\014\000\000\012X\t\162\000\000\bX\000\000\000\000\bb\000\000\000\000\000\000M\026\000\000\000\000\000\000\000\000M\214\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\bz\000\000\000\000\000\000\020\018\021\128\000\000\000\000\000\000\000\000\005\224\000\000\000\000\000\000\000\000\000\000\000\000\000\000\019\238\019\248\028\238\000\000\000\000\000\0002J\000\000\000\000\000\000U~\000\000\000\000U\182\002$\000\000\000\000\000\000U\194\000\000N:\000\000\000\000\019\160R\140\020\030\000\000\n`\000\000\002\212\000\000\n\160\000\000\000\000\000\000\020*\019\180\000\000\n\232\000\000\r\198\000\000\012\n\000\000\000\000\n\214\0146\000\000\0202\019\196\000\000\012\136\000\000\0208\012\186\000\000\014d\000\000\020<\r\220\000\000\020<\014Z\000\000!\164\000\000\000\000\000\000\019\142\019\222\000\000\000\000\015LNJ\000\000\000\000!\214\020:\000\000\000\000\000\000\000\000\000\000\bz\018d\016\206\003\028$x\000\000\000\000\000\000\000\000\004(\000\000\000\000\021\140\000\000\000\000\b\130\000\000\000\000\000\000\014\176\020<\000\000\000\000\t2\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\028-,\000\000\000\000\000\000\000\000\t\232\000\000\000\000\022R\000\000\000\000\012X\000\000\000\000\000\000\015^\020@\000\000\000\000\t\200\000\000\000\000\000\000\000\000\000\000N\220\000\000\020D\000\000\000\000\002$\000\000\000\000\020F\000\000\000\000\000\000\000\000\000\000\000\000\000\000\020R5n\000\000\020X6L\000\000\020`=\166\000\000\000\000\000\000\000\000\003\028\000\000G\170\000\000\000\000\000\000\000\000O\"\000\000O@\000\000\000\000\000\000\000\000\000\000\020Z\000\000\000\000\000\000\000\000\000\000\000\000\012t\000\000\000\000\000\000\002$\000\000\000\000\000\000\000\000\000\000\000\000\020\016\019\198\019\222\000\000\0076\000\000\t\146\000\000\000\000\000\000\000\000\000\000\020\022\019\208\019\222\000\000\000\000\000\000\000\000\000\000\020\030\019\212\019\222\000\000\000\000\000\000\000\000\000\000\000\000\019\236\020h\019\166\020p\000\000\000\000\000\000\000\000\000\000\000\000\014\134\000\000\015\146\021\242\015\196\000\000\000\000\020\156\"L\000\000\000\000\000\000$\148\016t\000\000\017&\000\000\017d\000\000\nX\000\133\000\000\000\000\000\000\018H\000\000\019:\000\000\000\000\022\020\000\000\000\000\022\174\000\000\022\218\000\000\023&\000\000\000\000\000\000\000\t\018H\021\242$\148\r~\000\000\000\000\000\131\006\184\000\000\000\000\000\000\016x\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\168\000\000\000\000\005\220\005\224\002@\000\000\020\234\000\000\000\000\000\000\000\000\020\236\000\000\000\000\000\000\000\000\015\160\003\014\019\162\005\248\000\000\000\000\000\000\015\250\000\000\019\164\t\184\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000Oh\018\196\000\000O\188\000\000\000\000\000\000\000\000\" \020\172\n\248\000\000\000,\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\n\214\000\000\bz\000\000U\236\002$\000\000\000\000\000\000\000\000U\246\002$\000\000\000\000\000\000\011d\000\000\000\000\000\000#\014\000\000\000\000\000\000\"\240\000\000\000\000\000\000PZ\000\000\000\000\000\000\003\178\019\206\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\210\000\000\000\000\000\000\000\000\004\176\000\000\000\000\005`\000\000\000\000\000\000\000\000"), (16, "\000\229\000\230\002%\001\228\006\178\000\229\000\230\003\171\000L\007d\003\171\000L\001d\t$\000\230\005\237\005\241\005\186\001[\000H\000L\001\\\003\029\000Q\000L\b\236\001\194\006\241\004\t\000\185\000B\007\176\t\b\001\229\001\030\007\144\000}\002\022\000\127\000\231\b\211\000T\000\232\003\030\000\231\002\153\001\233\000\232\006\248\001\216\007\178\b\246\005F\000L\b\182\b*\b\248\b\250\b\184\003+\003\244\000\185\003\245\bK\001Z\b\180\002;\000\\\007\138\000\230\001[\bR\003\175\001\\\003\173\003\175\b\233\002\154\002\155\002\156\006\181\002\222\001U\007\146\0019\000\230\000\133\004\159\002\158\0060\000\210\003(\007\180\003,\001\197\0031\007\186\0032\007\190\0034\0066\007e\007g\005\186\0061\b\252\001\205\003(\001b\003,\003\216\b<\b\254\t\002\001\210\0034\000\229\000\230\t0\t1\006\189\0035\bM\001e\001f\005\244\003\246\0006\004\160\000H\000L\006\240\001|\002\153\005I\b\255\t2\002\201\006\241\t5\003\"\000\228\006e\001g\000L\006g\006\246\006\247\t%\002<\002=\000R\b\228\003H\003M\000\231\b\133\000\212\000\232\006\248\001b\000\238\0060\002o\002X\000L\005J\003\020\001q\005Q\001q\001c\006m\002(\000\128\001e\001f\006r\005\143\002\162\006\182\004\005\0038\0017\003N\006g\005\144\b\185\001\198\007\199\001\235\006v\001q\000`\005S\001g\000L\005\145\0038\004\015\001j\0039\001\b\007\127\003f\007\202\006h\001\b\0006\003f\007j\007s\007\r\007\023\005\186\006e\007#\0039\003g\007\127\007,\b\186\007\207\003g\001q\001l\005\133\001\228\007$\b\188\002;\004\212\002;\000}\000\239\000\127\006i\002\\\t&\006h\002]\000e\003F\007\140\000H\000L\002`\002\031\003i\003j\004\242\003\"\001j\003i\003j\000\131\000\\\001\229\003F\007\129\000\229\006\188\002\170\006s\006\189\b\227\000N\007|\002T\006i\001\233\000\240\001q\000\176\000L\006\240\000\240\001l\007\210\006h\001n\002B\006\241\006\243\007t\001g\000L\001s\002*\003m\006\246\006\247\002\217\002\161\007q\007u\006k\000o\001m\000\231\005\136\007\141\000\232\006\248\002$\007l\002a\006v\002%\006i\001r\001q\004\212\002<\002=\002<\002=\002\127\001\b\002\127\003f\007m\007o\b\224\005\004\005\005\001\249\004>\002X\000L\002X\000L\001n\000\\\003g\004\208\006s\001q\002\139\001s\004\212\000t\0076\t8\002\153\002\144\000\229\006\188\005\004\005\005\006\189\001q\000:\002\132\001\204\003\021\007\r\007\023\005\186\001\019\007#\006\240\000H\000L\003i\003j\005\006\007p\006\241\006\243\007t\000\128\007$\002\005\0009\001\252\006\246\006\247\003\020\002\130\001\234\007u\000\148\000=\000T\000\231\001q\000\240\000\232\006\248\000\240\002\153\001q\0006\001q\003\"\0078\007/\000\229\006\188\005\137\002\\\006\189\002\\\002]\007q\002]\b\217\000L\bw\002`\001\205\002`\006\240\001\235\002\022\006\017\002\199\002\"\001\210\006\241\006\243\007t\002\154\002\155\002\156\005\179\002\166\006\246\006\247\005\030\002\003\001\020\007u\002\158\006\018\002U\000\231\002\134\004\t\000\232\006\248\007\r\007\023\005\186\0006\007#\002\200\001\214\007l\000x\006v\000\131\006\022\002\218\0008\000\143\002\153\007$\006\024\004\145\007x\001\b\006\027\003f\007m\007o\004\011\004\r\003(\002a\003,\002a\0037\001q\001\228\006\129\0034\003g\002)\002\006\003\"\004Y\004?\000\229\000\230\002c\002d\006\189\002\154\002\155\002\156\001q\002\166\007\r\007\023\005\186\005\183\007#\006\240\002\158\005\004\005\005\t(\t)\001\229\006\241\t+\003i\003j\007$\007p\005^\004Y\006\246\006\247\002\201\002\130\001\233\0079\002\167\002\175\000\130\000\231\002\176\002\162\000\232\006\248\007.\007/\000|\000\240\001A\003\"\004\212\007l\003/\006v\001q\002\021\005\157\001q\001\251\0030\001\252\003(\002B\b>\001\b\007q\003f\007m\007o\0034\000\132\0017\000\240\000\185\001[\000\203\0038\001\\\007H\001q\003g\bi\005\b\003(\001\179\b\b\005\158\005\160\007z\005\162\005\163\0034\002\189\001q\004\201\0039\007\r\007\023\005\186\001\194\007#\006\178\004Y\007l\000\240\006v\002\231\002\162\001q\0071\003i\003j\007$\007p\005\184\000\185\001\b\001\180\003f\007m\007o\002\160\005r\002\219\002\170\005\167\004\015\000\229\000\230\t4\000\\\006\189\003g\000\240\000\205\003\"\003F\005\164\005\174\005\186\001q\005\192\006\240\001\228\001\237\002\202\002B\t2\005\133\006\241\t5\007q\0038\005\193\002\171\002\161\000l\006\246\006\247\005F\000L\004\193\003i\003j\001b\007p\000\231\001\199\005\168\000\232\006\248\0039\005s\001\229\0038\001\181\000\210\006\183\001\235\001e\001\186\001\187\0078\007/\002\181\000\240\001\233\bh\001\160\007l\002\170\006v\001q\0039\001q\003\171\000L\001\161\bg\001g\000L\005\130\001\b\007q\003f\007m\007o\005\173\000\141\002\031\002E\001q\003F\005\004\005\005\000\229\000\230\t7\003g\006\189\002\171\002\161\005\138\007\r\007\023\005\186\001q\007#\t-\002\n\006\240\0074\0006\000\\\003F\t2\002\153\006\241\t5\007$\002!\005I\001\155\003\208\000\177\006\246\006\247\005\245\003i\003j\002\181\007p\000\229\000\230\000\231\000\131\000\162\000\232\006\248\007\239\003\175\001\198\003\"\000\180\000\185\001q\000\253\001q\002\154\002\155\002\156\000\240\002\166\005J\003\029\001q\005Q\006\182\001q\002\158\000\151\001l\005F\000L\002\000\005\143\001\252\005\004\005\005\007q\b.\000\231\005\246\005\147\000\232\003\030\001\240\007}\002\020\002\167\003\n\005S\002\251\002\176\005\145\0079\001r\005\247\004\n\000\207\003\245\007\r\007\023\005\186\001q\007#\007l\005#\006v\001q\002.\001[\005\137\005'\001\\\000\255\002\161\007$\001\156\001\b\001\235\003f\007m\007o\0017\b\206\001\188\b\201\000\229\000\230\002*\001\189\006\189\000\229\000\230\003g\004a\006\189\007O\001q\003\"\007\028\004x\006\240\t8\004f\007~\004\196\006\240\000\169\006\241\006\243\t\n\001q\005I\006\241\006\243\b\006\006\246\006\247\002\162\006y\002\130\006\246\006\247\003i\003j\000\231\007p\004>\000\232\006\248\000\231\005\201\001d\000\232\006\248\003\"\004b\b\207\001[\b\202\002\130\001\\\003\017\001q\005J\004b\000\240\005Q\001\254\002\031\0078\007/\007l\001q\006v\000\211\005R\005]\004Y\001b\002\252\002\002\003\196\001\252\007q\001\b\002\n\003f\007m\007o\001r\007 \005S\004{\001e\001\186\001\190\004\005\003\016\002\189\005^\003g\007\r\007\023\005\186\b\196\007#\007\r\007\023\005\186\t8\007#\006~\002\191\001g\000L\002P\000L\007$\002\189\001q\002\170\001\b\007$\003f\005(\005\151\002+\000L\005p\005\133\003i\003j\002\208\007p\000\229\000\230\002\b\003g\006\189\001q\003\"\003\201\005\237\005\241\005\186\003\"\002k\001b\002\031\006\240\002\171\002\161\001\194\000\240\002\017\001\228\006\241\006\243\006\245\004>\001q\001q\001e\001f\006\246\006\247\002%\003i\003j\005\202\000L\007q\002\001\000\231\005\004\005\005\000\232\006\248\000\223\b\181\002\181\b\181\001g\000L\001q\001\229\b\209\b\191\b\204\b\191\000\240\007!\0079\005r\007l\001l\006v\003k\001\233\007l\005\154\006v\006\023\005\234\001q\003\211\001[\001\b\003m\003f\007m\007o\001\b\t\012\003f\007m\007o\0073\007/\b\192\001\202\b\192\001q\003g\001q\0075\007/\002\005\003g\001\252\007\r\007\023\005\186\001q\007#\b\216\001q\002F\001[\001j\002\005\002\018\001\252\005u\005{\001[\007$\001\175\001q\000\237\001\188\001q\005\244\003i\003j\001\189\007p\000\165\003i\003j\003\216\007p\000\229\000\230\001l\001q\006\189\000\229\000\230\003\"\003(\006\189\003)\002S\000L\000\240\000\240\006\240\0034\001\178\004*\000\240\006\240\001q\006\241\007k\001\185\000\\\001q\006\241\007n\001q\006\246\006\247\007q\001q\002\194\006\246\006\247\007q\005\155\000\231\001q\005\137\000\232\006\248\000\231\001Z\001\243\000\232\006\248\001\176\002\153\001[\001\198\004?\001\\\002;\001q\001n\bd\005\151\002\130\007l\000\227\006v\001s\003Z\002c\004\130\000\241\000\230\001q\003(\002\006\003D\001\b\b\183\003f\007m\007o\0034\001\235\001\176\002\154\002\155\002\156\002\006\002\166\003(\001\176\003G\003g\007\014\001\000\002\158\000\251\0034\007\r\007\023\005\186\0038\007#\007\r\007\023\005\186\005\240\007#\001\003\000\242\006\017\001\r\000\244\007\156\007$\002\169\000\185\007;\002B\007$\0039\002\134\003i\003j\001q\007p\005\179\004Y\000\240\006\018\000\241\000\230\001q\0021\007\015\001q\005\156\003\"\002\031\004\t\002<\002=\003\"\001b\b\226\000\240\005\200\006\022\001q\005\168\002<\002=\001q\006\024\001c\002X\000L\006\132\001e\001f\004k\003F\007\028\007q\0038\002X\000L\007\254\b\000\000\242\006\026\001\r\000\244\005\173\002\004\001Z\001\252\000\210\001g\000L\0038\001[\003\202\0039\001\\\005\157\002\162\001>\005\173\004\236\001D\007l\002\138\006v\004Y\001N\007l\005\185\006v\0039\002B\004>\004b\004p\001\b\000\245\003f\007m\007o\001\b\001Q\003f\007m\007o\004\t\005\158\005\160\005\248\005\162\005\163\003g\005\004\005\005\002\243\003F\003g\004Y\001q\002\\\005F\000L\002]\005\179\005\151\007\"\001j\005\155\002`\002\\\007E\003F\004\237\b\030\b \007\246\004b\002B\002`\006\178\b\\\003i\003j\002\138\007p\002\n\003i\003j\000\\\007p\002\005\001l\001\252\000\229\000\230\003\229\000\245\005\164\005\174\005\186\002\170\005\192\001b\001\b\000\240\001\016\002\138\007\024\001P\000\240\007\028\001q\001p\005\249\001q\003\029\001q\001e\001f\001\017\0078\007/\007q\001q\007\176\000\229\000\230\007q\002a\005\184\002\171\002\161\000\231\0054\005\243\000\232\003\030\001g\000L\005\236\bP\004\015\005I\007\178\007\213\005\201\001n\003\029\007\015\001\018\001\021\001q\002B\001s\002\014\007c\007\176\000\241\000\230\001q\002\181\000\229\000\230\001\b\000\231\001\016\007!\000\232\003\030\003\171\000L\006\017\000\240\001q\005J\007\178\007\179\005Q\003\000\001\017\002\012\002\138\007i\003\029\004Y\007\180\005T\005\173\004?\007\186\006\018\007\190\007\176\bf\001j\007\027\000\242\002\006\001\r\000\244\000\231\b\157\005S\000\232\003\030\007\191\002;\005\245\006\022\001\018\001\021\007\178\007\185\002B\006\024\006y\004\015\007\180\006*\001l\002\226\007\186\007\031\007\190\002\212\005\004\005\005\006y\003\"\001q\001q\006\026\000\240\b\015\003\175\005\184\007\015\007\191\005\157\005\155\001t\005\250\000\\\0079\007\193\001q\0077\007/\001\228\002B\002\130\001q\005\246\007\180\0055\006\182\005\208\007\186\001q\007\190\003\"\000\240\003\228\007\015\007I\000L\005\252\005\247\005\158\005\160\t\014\005\162\005\163\007\191\001n\005\173\001q\003\235\001\229\001q\002\143\001s\007\199\007!\006v\002\015\b\223\001q\006}\002<\002=\001\233\000\245\003H\003I\001\b\003\"\003f\007\202\001\130\006|\005\030\005\173\002\197\002X\000L\000\229\000\230\004Y\002\134\001]\003g\007f\003\247\007\199\007\207\006v\005F\000L\005\164\005\174\005\186\003\232\005\192\005\030\006\017\002B\001\b\003\029\003f\007\202\005\139\b\172\005\004\005\005\005\193\007\154\007\176\004\207\004\214\000\\\003i\003j\003g\006\018\000\231\001q\007\207\000\232\003\030\007\199\007-\006v\007\015\001\228\002\n\007\178\007\189\006R\001\b\005\139\001\016\006\022\001\b\000\240\003f\007\202\001q\006\024\000\229\000\230\007\210\006\025\003i\003j\001\017\002B\002\\\002\215\003g\002]\001q\003m\007\207\001\229\006\026\002`\007=\006S\000\\\003\254\003\029\005\173\001q\000\229\000\230\000\240\001\233\007\180\005I\007\176\001\245\007\186\007\210\007\190\001\018\001\021\002B\000\231\003i\003j\000\232\003\030\001q\003m\002\153\003\029\005\139\007\191\007\178\007\198\005F\000L\006\017\002\016\007\176\007?\002\n\000\240\005\245\t\016\005J\000\240\000\231\005Q\001\235\000\232\003\030\000\185\007\210\004\018\003\"\006\018\005l\007\178\007\201\002a\002\154\002\155\002\156\003m\002\166\000\185\004\164\003(\007=\003]\007G\002\158\005S\006\022\007\180\0034\004\215\004\219\007\186\006\024\007\190\004Y\004Y\006\027\004 \006\017\007=\005\246\000\241\000\230\007h\002\167\002\175\002B\007\191\002\176\006\026\000\229\000\230\007\180\005\004\005\005\005\247\007\186\006\018\007\190\002\201\004\160\007\199\002\019\006v\002B\000\210\005\024\001q\002\201\005I\003\"\0072\007\191\001\247\001\b\006\022\003f\007\202\002\201\000\210\000\242\006\024\001\r\000\244\007\015\006\031\005\128\001q\005\139\000\231\003g\007D\000\232\be\007\207\003\"\005\004\005\005\006\026\005\004\005\005\005J\004\217\006\175\005Q\000\229\000\230\001\235\005\129\007A\004;\0038\002\201\005\127\007B\002\162\007=\007<\004\237\001q\003i\003j\005\132\005\173\007\199\004\169\006v\003\029\004K\005S\0039\002\183\b\022\006\002\005\004\005\005\007\176\001\b\004\174\003f\007\202\005\228\002\201\000\240\000\231\005\135\bV\000\232\003\030\007\199\007\210\006v\007@\003g\006a\007\178\007\206\007\207\001q\001q\004Y\003m\001\b\002;\003f\007\202\004\160\005\148\000\229\000\230\b\157\003F\004\245\000\229\000\230\005\171\000\245\005\172\003g\004\160\005\197\004\249\007\207\003i\003j\003\"\007C\001q\005F\000L\003\029\004\253\005`\004\237\005#\003\029\005\150\007\180\002\170\007\176\005*\007\186\007=\007\190\007\176\001q\000\240\000\231\003i\003j\000\232\003\030\000\231\007\210\000\\\000\232\003\030\007\191\007\178\007\209\007\153\005\004\005\005\007\203\003m\005\000\007\187\005\030\002\171\002\161\005\171\000\240\005\175\006\015\003(\001Z\004\205\006G\007\210\007`\003\"\001[\0034\001\b\001\\\001\016\002<\002=\001\228\003m\003H\003S\001\b\005\153\003f\005\003\006T\005\205\002\181\001\017\007\180\002X\000L\006\002\007\186\007\180\007\190\007\015\003g\007\186\005I\007\190\007F\001[\001\141\001\143\001\\\005\171\001\229\005\178\007\191\0065\001q\001\179\005\171\007\191\005\182\006c\b\194\001\018\001\021\001\233\002c\005\215\007\199\005\171\006v\005\242\003i\003j\005\252\b\179\005J\003\"\006_\005Q\005\173\001\b\003\"\003f\007\202\001a\000\240\0055\005\143\by\001\193\006\174\007(\006b\006d\000\240\006\001\003g\003(\0038\007\017\007\207\007L\001Z\005S\001b\0034\005\145\002\\\001[\001q\002]\001\\\b\213\006\014\002\031\b\195\002`\0039\004\160\001e\001f\006T\006\002\007^\001\144\001\145\003i\003j\004\201\0066\007\199\005\235\006v\004\160\001\146\007\199\001b\006v\001w\001g\000L\001q\002B\001\b\007\249\003f\007\202\001\200\001\b\000\240\003f\001e\001\186\001\187\001\128\b\173\007\210\b\220\003F\003g\006\016\000\229\000\230\007\207\003g\005F\000L\003m\007\204\001\153\001~\001g\000L\001Z\b\135\004\237\002a\001\158\005\252\001[\001\228\001\157\001\\\003\029\003(\006j\007W\006\002\0038\003i\003j\002\031\0034\001\163\003i\003j\001j\002B\001b\003\216\000\231\001\162\bz\000\232\003\030\006\002\007\n\0039\001\235\b\174\001\229\005\252\000\240\001e\001f\000\229\000\230\000\240\006\002\007\210\006\142\001l\001[\001\233\007\210\001\\\001\219\007\020\007\022\006\002\003m\b\025\001\179\001g\000L\003m\006\002\003\029\b\181\007\020\007\021\001\172\001t\b\197\006\002\b\210\b\191\005I\003F\001\174\000\229\000\230\002\031\001l\000\231\005\233\006\002\000\232\003\030\001\183\0017\007\226\002\031\001\184\b|\001\193\002c\007T\001\228\001b\001\206\000\\\003\029\002\031\001\217\0038\001n\001\224\b\192\005J\001c\001q\005Q\001s\001e\001f\003\216\001\232\001\250\000\231\001j\005\143\000\232\003\030\0039\001\255\003\"\002\t\001\229\006\135\001q\001\004\000\230\002\r\b\132\000L\006\147\005S\001\188\001\201\005\145\001\233\001b\001\189\0017\001l\000\229\000\230\002\031\002\028\b\182\002#\003o\001\200\b\184\002'\000T\001e\001\186\001\187\0020\001\221\b\181\b\139\0024\003F\001t\b\189\003\029\b\190\b\191\br\0025\007\227\006\177\0029\002H\001g\000L\0017\003\"\002J\002Q\002W\006\017\000\231\002[\001\228\000\232\003\030\002g\001j\002\153\001\b\002}\003f\002\229\001\235\002\136\002\142\001n\006\151\b\192\006\018\002\150\001q\003o\001s\002\152\003g\003\167\bo\003(\003r\007\232\003\"\001l\001\229\001\228\006\169\0034\006\022\002\186\002\190\002\154\002\155\002\156\006\024\002\166\002\204\001\233\006$\006\157\002\220\002\225\002\158\003\014\001t\001\225\003i\003j\003o\001\226\006\160\006\026\0017\003\018\001\b\001\229\003f\006\164\b\148\003^\000\229\000\230\002\182\003U\003Q\006\168\001l\003[\001\233\000\240\003g\003\167\004\139\007\228\003r\003\166\003k\006\173\001n\003\165\003\172\003\180\003\029\001q\003\199\001s\006\180\003m\003\"\001\b\b\187\003f\001\235\003\214\003\213\000\229\000\230\003\223\003\238\000\231\003i\003j\000\232\003\030\003\234\003g\003\167\bY\003\243\003r\0038\004\002\003\250\004\001\003o\003\253\004\004\003\029\004\b\007b\004\007\001\188\001\201\000\240\b\186\000\\\001\189\001q\004\017\0039\003k\004\024\b\188\002\162\000\231\003i\003j\000\232\003\030\001\228\001\b\003m\b\002\004\021\004\023\002;\004\026\b\150\004)\004\031\002;\004&\004#\004%\001Z\001\b\b\003\003f\000\240\0017\001[\000\229\000\230\001\\\004(\003k\005]\0047\004I\001\229\003F\003g\003\167\b\012\004U\003r\003m\004^\b\152\004e\002~\001\235\001\233\003\029\004h\004j\b\004\b\005\004m\005^\004o\004u\004y\004z\0017\003\"\004\128\000\229\000\230\004\129\000\231\003i\003j\000\232\003\030\004\147\004\156\001\219\006\017\000\240\004\163\004\166\001\235\004\168\004\171\004\173\002\170\004\179\005p\003\029\004\178\003o\004\192\004\216\000\240\004\224\004\229\006\018\002<\002=\003\"\003k\002\127\002<\002=\004\235\000\231\003H\003P\000\232\003\030\002\153\003m\002X\000L\006\022\002\171\002\161\002X\000L\001b\006\024\005\019\005\026\005-\006)\003o\005&\005%\005+\001\228\001c\001\b\0051\003f\001e\001f\0053\006\026\005;\005@\005P\005M\002\154\002\155\002\156\002\181\002\166\003g\003\167\003\168\005o\003r\005r\002\158\001g\000L\005b\005g\005t\001\229\005\141\b\159\005\166\005\195\0060\003\"\001\b\005\199\003f\005\207\005\210\005\211\001\233\002\236\005\214\005\217\005\223\003i\003j\0061\0062\001\221\003g\003\167\007\236\002\\\003r\0063\002]\005\230\002\\\003o\005\239\002]\002`\001\235\006\141\006\012\006!\002`\000\240\003\"\005u\005v\005|\005y\006&\003k\006-\006?\000\\\001j\003i\003j\006<\006C\006H\006e\003m\006M\006O\006\\\006l\006p\001q\006\149\006\153\003o\006\162\006\166\000\\\006\171\001\b\007\006\003f\000\240\001l\007&\007*\007N\002\153\007R\003k\007S\002\162\005#\007Y\006m\003g\003\167\t\006\005'\003r\003m\002a\007\133\007\150\001t\001\225\002a\007\148\007\214\001\226\007\172\006t\007\182\006v\007\183\001\b\007\195\003f\001Z\002\154\002\155\002\156\007\196\002\166\001[\003i\003j\001\\\006h\b\161\002\158\003g\003\167\003\204\007\212\003r\007\211\007\215\001n\007\217\006\017\007\224\007\250\001q\b\026\001s\b%\b+\000\240\b3\002\167\003\n\b6\0060\002\176\003k\b9\bN\006i\006\018\006\017\003i\003j\001\235\b`\ba\003m\bl\0061\0062\bm\bt\bu\0060\002\170\b\130\0063\006\022\b\129\006\018\002;\b\127\b\128\006\024\000\240\006s\006\137\006\128\0061\0062\b\144\003k\b\203\b\208\b\215\b\222\0063\006\022\b\244\000\\\006\129\t\031\003m\006\024\002\171\002\161\006e\006N\000\000\000\229\000\230\000\000\000\000\000\000\001b\000\229\000\230\000\000\000\000\000\\\006\026\002\162\000\000\000\000\000\000\001c\006e\007\135\000\000\001e\001f\003\029\006\152\000\000\002\181\000\000\006m\003\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\170\000\000\000\000\000\231\001g\000L\000\232\003\030\006t\000\231\006v\006m\000\232\003\030\000\000\000\000\000\000\002\153\002<\002=\000\000\000\000\003H\003X\000\000\006h\001Z\000\000\006t\000\000\006v\000\000\001[\002X\000L\001\\\003\016\006\017\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006h\000\000\000\000\000\000\002\154\002\155\002\156\000\000\002\157\000\000\006i\006\018\006\017\000\000\002\170\002\158\001j\000\000\000\000\000\000\000\000\002;\000\000\000\000\000\229\000\230\000\000\000\000\000\000\006\022\006i\006\018\000\000\000\000\000\000\006\024\b\140\006s\006\130\006\128\000\000\001l\000\000\000\000\002\171\002\161\003\029\000\000\000\000\006\022\000\000\001\228\006\129\000\000\003\"\006\024\003`\006s\006\127\006\128\003\"\002\\\001\132\000\231\002]\000\000\000\232\003\030\000\000\000\000\002`\000\000\006\129\000\000\002\181\000\229\000\230\001b\000\000\000\\\000\000\001\229\000\000\000\000\000\000\000\000\003o\000\000\001c\000\000\000\000\000\000\001e\001f\001\233\000\000\001n\003\029\000\000\000\000\000\000\001q\000\000\001s\002<\002=\002\162\000\000\002\127\000\000\000\229\000\230\001g\000L\000\231\007\136\000\000\000\232\003\030\002X\000L\001\b\000\000\003f\000\000\000\000\b\141\001\b\001\228\003f\002a\000\000\003\029\000\000\000\000\000\000\000\000\003g\007\137\000\000\000\000\003r\000\000\003g\003\167\007\242\000\000\003r\000\000\000\231\001\228\000\000\000\232\003\030\000\000\001Z\000\000\000\000\001\229\003\"\000\000\001[\006\017\000\000\001\\\000\000\000\000\003i\003j\001j\000\000\001\233\000\000\003i\003j\000\000\000\000\000\000\001Z\000\000\001\229\006\018\000\000\000\000\001[\003o\000\000\001\\\001\228\002\170\000\240\000\000\002\\\001\233\001l\002]\000\240\003k\000\000\006\022\000\000\002`\000\000\003k\b\164\006\024\000\000\000\000\003m\006\140\003\"\000\000\001\133\000\000\003m\001t\001x\000\000\001\229\002\217\002\161\000\000\006\026\001Z\000\000\000\000\001\b\000\000\003f\001[\000\000\001\233\001\\\001y\000\000\000\000\b$\000\000\001\235\000\000\000\000\000\000\003g\003\167\b\018\003\"\003r\000\000\000\000\001n\000\000\001b\000\000\000\000\001q\000\000\001s\001\134\000\000\000\241\000\230\002a\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\000\000\000\000\003i\003j\001b\000\000\000\000\001\b\001y\003f\000\000\b\167\000\000\000\000\002\153\001c\001g\000L\000\000\001e\001f\000\000\000\000\003g\003\167\000\240\000\000\003r\000\242\000\000\b[\000\244\003k\b\169\000\000\000\000\000\000\007\142\000\000\001g\000L\000\000\001\b\003m\003f\001\235\002\154\002\155\002\156\001b\002\166\000\000\000\000\003i\003j\000\000\000\000\002\158\003g\007\143\001c\000\000\003r\000\000\001e\001f\001Z\001\235\000\000\000\000\000\000\b\171\001[\001j\000\000\001\\\000\240\002\167\003\n\000\000\000\000\002\176\000\000\003k\001g\000L\000\000\000\000\003i\003j\000\000\000\000\000\000\001Z\003m\000\000\001z\000\000\001l\001[\000\000\000\000\001\\\000\000\000\000\001\235\000\000\000\000\000\000\000\000\000\000\000\240\000\000\000\000\000\000\000\000\000\000\000\000\003k\001t\001\137\001l\000\000\001\140\000\245\000\000\000\000\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\000\001\166\001\143\000\000\000\000\000\000\001z\001t\001x\000\000\001Z\000\000\000\000\002\162\000\000\001\149\001[\000\000\001n\001\\\000\000\000\000\000\000\001q\000\000\001s\000\000\001b\001Z\000\000\000\000\001l\000\000\001\134\001[\000\000\000\000\001\\\001c\000\000\000\000\001n\001e\001f\000\000\005]\001q\000\000\001s\000\000\001{\000\000\001t\001x\001b\000\000\001\b\000\000\001\016\000\000\001\134\000\000\001g\000L\000\000\001c\000\000\001\152\005^\001e\001f\001Z\001\017\003\r\000\000\000\000\000\000\001[\001\144\001\145\001\\\000\000\000\000\000\000\000\000\001\209\001n\000\000\001\146\001g\000L\001q\000\000\001s\000\000\001\127\002\170\005p\001Z\000\000\000\000\000\000\001\018\001\021\001[\000\000\001b\001\\\000\000\000\000\000\000\000\000\001\134\000\000\000\000\000\000\000\000\001c\000\000\001j\000\000\001e\001f\001\153\001b\000\240\002\171\002\161\001\213\000\000\001\134\001\158\000\000\000\000\000\000\001c\000\000\000\000\000\000\001e\001f\001g\000L\000\000\001l\000\000\001j\001\168\000\000\000\000\000\000\000\000\000\000\000\000\005\157\005>\002\181\000\000\000\000\001g\000L\000\000\005r\000\000\000\000\001t\001\137\001b\001Z\000\000\000\000\001l\000\000\001\134\001[\000\000\000\000\001\\\001c\000\000\000\000\000\000\001e\001f\005\158\005\160\005\161\005\162\005\163\000\000\000\000\000\000\001t\001\137\001b\000\000\000\000\000\000\001j\001n\001\134\000\000\001g\000L\001q\001c\001s\000\000\000\000\001e\001f\001Z\005u\005v\005w\005y\001j\001[\000\000\000\000\001\\\000\000\000\000\001l\000\000\005C\001n\000\000\000\000\001g\000L\001q\000\000\001s\001q\005\164\005\174\005\186\000\000\005\192\000\000\001l\000\000\000\000\001t\001\137\000\000\000\000\000\000\000\000\000\000\005\193\000\000\000\000\001q\000\000\000\000\000\000\000\000\001j\000\000\000\000\001t\001\137\001b\000\000\000\000\000\000\000\000\000\000\001\134\000\000\000\000\000\000\000\000\001c\000\000\000\000\001n\001e\001f\001Z\000\000\001q\001l\001s\001j\001[\000\000\000\000\001\\\000\000\000\000\000\000\000\000\000\000\001n\000\000\000\000\001g\000L\001q\000\000\001s\000\000\001t\001\137\001b\001Z\000\000\000\000\001l\000\000\000\000\001[\000\000\000\000\001\\\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001t\001\137\000\000\000\000\000\000\000\000\005e\001n\000\000\000\000\001g\000L\001q\005\245\001s\000\000\000\000\000\000\000\000\001Z\000\000\000\000\000\000\000\000\001j\001[\000\000\000\000\001\\\000\000\000\000\000\000\000\000\005j\001n\000\000\000\000\005L\000\000\001q\000\000\001s\000\000\000\000\000\000\001b\001Z\000\000\000\000\001l\000\000\001\134\001[\000\000\000\000\001\\\001c\000\000\005\246\000\000\001e\001f\000\000\000\000\000\000\000\000\000\000\001j\000\000\000\000\001t\001\137\001b\005\247\000\000\000\000\006X\000\000\001\134\000\000\001g\000L\000\000\001c\000\000\001q\000\000\001e\001f\001Z\000\000\000\000\001l\000\000\000\000\001[\000\000\000\000\001\\\000\000\000\000\000\000\000\000\006`\001n\000\000\000\000\001g\000L\001q\000\000\001s\000\000\001t\001\225\001b\000\000\000\000\000\000\000\000\000\000\001\134\000\000\000\000\000\000\000\000\001c\000\000\005N\000\000\001e\001f\000\000\000\229\000\230\001[\000\000\001j\001\\\000\000\000\000\000\000\001b\000\000\b\229\000\000\000\000\001n\001\134\000\000\001g\000L\001q\001c\001s\003\029\000\000\001e\001f\001Z\000\000\000\000\001l\000\000\001j\001[\000\229\000\230\001\\\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\001g\000L\000\000\000\000\000\000\000\000\001t\001\137\001b\000\000\000\000\003\029\001l\000\000\000\000\000\000\000\000\000\229\000\230\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\000\000\000\231\000\000\001j\000\232\003\030\001t\001\137\000\000\000\000\001^\000\000\003\029\001n\000\000\000\000\001g\000L\001q\000\000\001s\001b\000\000\000\000\000\000\000\000\000\000\000\000\001l\000\231\001j\000\000\000\232\003\030\000\000\000\000\001e\001\186\004N\000\000\001n\000\000\000\000\000\000\000\000\001q\000\000\001s\000\000\001t\001\137\001b\000\000\000\229\000\230\001l\001g\000L\000\000\000\000\000\000\000\000\001c\000\000\003\"\000\000\001e\001f\000\000\000\000\000\000\000\000\000\000\001j\000\000\003\029\001t\001\137\000\000\000\000\000\000\000\000\000\000\001n\000\000\000\000\001g\000L\001q\000\000\001s\000\000\000\231\000\000\000\000\000\232\003\030\003\"\001l\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001n\000\000\000\000\000\000\000\000\001q\000\000\001s\000\000\001t\001x\000\000\000\000\001\004\000\230\003\"\007\149\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\000\001Z\000\000\000\000\001l\000\000\000\000\001[\000\000\001j\001\\\000\000\000\000\003g\007\143\000\000\000\000\003r\000\000\001n\000\000\000\000\000\000\000\000\001q\000\000\001s\000\000\000\000\bq\001\b\007\227\003f\000\000\001l\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\003i\003j\000\000\003g\bJ\000\229\000\230\003r\000\000\000\000\000\000\003\"\001t\001x\000\000\001\b\001\188\003f\000\000\003\029\000\000\004Q\000\000\000\240\000\000\000\000\000\000\003\029\000\000\000\000\003k\003g\b-\003i\003j\003r\000\231\000\000\000\000\000\232\003\030\003m\000\000\000\000\000\231\000\000\001n\000\232\003\030\000\000\000\000\001q\000\000\001s\001b\001[\000\240\000\000\001\\\000\000\000\000\003i\003j\003k\000\000\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\000\000\003m\000\229\000\230\000\000\001\b\000\000\003f\007\228\000\000\000\000\000\240\000\000\000\000\000\000\000\000\001g\000L\003k\000\000\000\000\003g\003q\000\000\003\029\003r\000\000\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\001Z\000\000\000\000\000\000\003\"\000\000\001[\000\000\000\000\001\\\000\000\000\000\003\"\000\000\000\000\000\000\000\000\001b\001j\000\240\001\b\000\000\b\002\000\000\000\000\000\000\003k\000\000\000\000\000\000\000\000\000\000\001e\001\186\001\190\000\000\b\003\003m\000\000\0046\000\000\000\000\000\000\001l\000\000\001Z\000\000\000\000\000\000\000\000\000\000\001[\001g\000L\001\\\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\001t\002\024\b\004\b\005\001Z\000\000\000\000\001\b\002\027\003f\001[\000\000\000\000\001\\\000\000\001\b\000\000\003f\003\"\000\000\000\000\000\000\000\000\003g\003\226\000\240\000\000\003r\000\000\000\000\000\000\003g\001b\000\231\001n\003\201\000\232\bc\004\184\001q\000\000\001s\000\000\001c\000\000\004H\001Z\001e\001f\000\000\000\000\000\000\001[\003i\003j\001\\\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\000\000\001g\000L\001Z\001l\000\000\000\000\000\000\000\000\001[\000\240\001b\001\\\000\000\000\000\000\000\000\000\003k\000\240\001\b\000\000\003f\001c\000\000\000\000\003k\001e\001f\003m\000\000\000\000\000\000\000\229\000\230\001b\003g\003m\000\000\000\000\003\201\000\000\000\000\000\000\000\000\000\000\001c\001g\000L\000\000\001e\001f\000\000\000\000\000\000\003\029\000\000\000\000\000\000\001j\001\188\000\000\000\000\000\000\003\"\004Q\003i\003j\000\000\000\000\001g\000L\000\231\000\000\000\000\000\232\003\030\001b\000\000\000\000\000\000\000\000\000\000\000\000\001l\000\000\000\000\000\000\001c\000\240\000\000\000\000\001e\001f\000\000\000\000\003k\000\000\000\229\000\230\001b\000\000\000\000\000\000\001j\001t\004\189\003m\000\000\000\000\000\000\001c\001g\000L\000\000\001e\001f\000\000\000\000\000\000\003\029\000\000\000\000\000\229\000\230\000\000\000\000\001j\000\000\001l\000\000\001\b\000\000\003f\000\000\001g\000L\000\231\000\000\001n\000\232\003\030\000\000\000\000\001q\003\029\001s\003g\000\000\000\000\001t\005W\001l\000\000\000\000\000\000\000\000\005Z\000\000\000\000\000\229\000\230\000\231\000\000\000\000\000\232\003\030\000\000\003\"\001j\000\000\000\000\000\000\001t\005W\000\000\000\000\003i\003j\000\000\005n\000\000\003\029\000\000\001n\000\000\000\000\001Z\000\000\001q\000\000\001s\001j\001[\001l\007\005\001\\\000\000\000\000\000\231\000\240\000\000\000\232\003\030\000\000\000\000\000\000\001n\000\000\000\000\001r\000\000\001q\000\000\001s\001t\005W\001l\000\000\000\000\000\000\000\000\006/\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\003\"\000\000\001\b\000\000\003f\001t\005W\000\000\000\000\b\143\000\000\000\000\006Q\000\000\000\000\000\000\001n\003\029\003g\000\000\000\000\001q\003\201\001s\000\000\003\"\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\231\000\000\000\000\000\232\003\030\001n\000\000\000\000\000\000\000\000\001q\000\000\001s\000\000\003i\003j\001b\001Z\007\223\003\029\000\000\000\000\000\000\001[\000\000\000\000\001\\\001c\003\"\000\000\000\000\001e\001f\001\b\000\000\003f\000\231\000\240\000\000\000\232\003\030\000\000\000\000\000\000\003k\000\000\000\000\000\000\000\000\003g\000\000\001g\000L\003l\000\000\003m\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\001Z\t\022\000\000\000\000\000\000\000\000\001[\000\000\003g\001\\\000\000\000\000\003\201\003i\003j\000\000\000\000\t\018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\b\003\"\003f\000\000\000\000\000\000\000\000\000\240\000\000\003i\003j\000\000\000\000\001j\007\210\000\000\003g\b\240\001b\000\000\003r\000\000\000\000\000\229\000\230\003m\000\000\000\000\000\000\001c\000\000\000\000\000\240\001e\001f\000\000\000\000\003\"\001l\003k\000\000\000\000\000\000\000\000\000\000\003\029\003i\003j\000\000\000\000\003m\000\000\000\000\001g\000L\000\000\000\000\000\000\000\000\001t\001x\000\000\000\231\000\000\000\000\000\232\003\030\001b\001\b\000\240\003f\001Z\000\000\000\000\000\229\000\230\003k\001[\001c\000\000\001\\\000\000\001e\001f\003g\000\000\000\000\003m\b1\000\000\000\000\000\000\000\000\001n\000\000\000\000\003\029\000\000\001q\000\000\001s\000\000\001g\000L\001\b\000\000\003f\000\000\000\000\000\000\001j\000\000\000\000\000\231\003i\003j\000\232\003\030\000\000\000\000\003g\000\000\000\000\001[\t\023\001Z\001\\\000\000\000\000\000\000\000\000\001[\000\000\001\179\001\\\001l\002;\000\240\000\000\000\000\000\000\000\000\000\000\000\000\003k\000\000\000\241\000\230\000\000\000\000\003i\003j\000\000\000\000\001Z\003m\001t\t\019\003\"\001j\001[\000\000\000\000\001\\\000\000\001\191\001\193\001b\001Z\000\000\000\000\007\234\000\000\000\240\001[\000\000\000\000\001\\\001c\000\000\003k\000\000\001e\001f\001l\000\242\000\000\001\r\000\244\000\000\001n\003m\000\000\000\000\000\000\001q\000\000\001s\000\000\000\000\000\000\000\000\001g\000L\000\000\001t\b\230\000\000\000\000\003\"\000\000\000\000\000\000\001b\000\000\000\000\000\000\000\000\000\000\002<\002=\001b\000\000\002\127\001\200\001\b\000\000\003f\001e\001\186\001\187\000\000\001c\000\000\002X\000L\001e\001f\000\000\001n\000\000\003g\000\000\000\000\001q\b0\001s\000\000\001g\000L\001b\000\000\000\000\000\000\000\000\000\000\001g\000L\000\000\001j\000\000\001c\000\000\000\000\001b\001e\001f\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\001c\001\b\000\000\003f\001e\001f\000\245\000\000\000\000\001l\001g\000L\000\000\000\000\000\000\000\000\000\000\003g\000\000\000\240\000\000\b(\000\000\000\000\001g\000L\003k\000\000\000\000\000\000\001t\001\136\002\\\001Z\000\000\002]\000\000\003m\001j\001[\000\000\002`\001\\\000\000\000\000\000\000\000\000\003i\003j\000\000\003\178\000\000\000\000\000\000\000\000\001l\000\000\000\000\000\000\000\000\000\000\000\229\000\230\001l\001n\000\000\000\000\001j\000\000\001q\000\240\001s\000\000\001\b\000\000\001\016\000\000\003k\000\000\000\000\000\000\001j\000\000\003\029\001t\001\223\000\000\001Z\003m\001\017\000\000\000\000\001l\001[\000\000\000\000\001\\\000\000\000\000\001Z\000\231\002a\000\000\000\232\003\030\001[\001l\000\000\001\\\000\000\001\188\001\201\000\000\001t\001\231\001\189\000\000\000\000\001n\001\018\001\021\000\000\000\000\001q\000\000\001s\000\000\001t\002\026\001b\001Z\000\000\000\000\000\000\000\000\000\000\001[\002\153\000\000\001\\\001c\000\000\000\240\000\000\001e\001f\000\000\001n\000\000\000\000\000\000\000\000\001q\000\000\001s\000\000\000\000\000\000\000\000\000\000\000\000\001n\000\000\000\000\001g\000L\001q\000\000\001s\002\154\002\155\002\156\000\000\002\166\000\000\000\000\000\000\000\000\000\000\000\000\002\158\000\000\000\000\001b\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\001c\001b\003\"\000\000\001e\001f\002\167\003\n\000\000\000\000\002\176\000\000\001c\000\000\000\000\000\000\001e\001f\003\029\000\000\000\229\000\230\000\000\000\000\001g\000L\000\000\001j\000\000\000\000\000\000\000\000\001b\000\000\000\000\000\231\001g\000L\000\232\003\030\000\000\000\000\003\029\001c\000\229\000\230\000\000\001e\001f\000\000\000\000\000\000\001l\000\229\000\230\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003\029\001g\000L\001\b\000\000\003f\000\000\001t\002I\003\029\000\000\002\162\000\000\000\000\000\000\001j\000\000\000\231\000\000\003g\000\232\003\030\000\000\004|\000\000\000\000\000\231\001j\000\000\000\232\003\030\000\000\000\000\000\000\002\153\004l\000\000\000\000\000\000\000\000\001l\001n\000\229\000\230\000\000\000\000\001q\000\000\001s\003i\003j\000\000\001l\000\000\000\000\000\000\000\000\000\000\001j\000\000\000\000\001t\002L\000\000\003\029\003\"\002\154\002\155\002\156\000\000\002\166\003\016\000\240\001t\002i\000\000\000\000\002\158\000\000\003k\000\000\000\231\000\000\001l\000\232\003\030\000\000\000\000\000\000\003\"\003m\000\000\000\000\000\000\002\170\001n\000\000\002\167\003\n\000\000\001q\002\176\001s\000\000\001t\002\178\000\000\001n\000\000\000\000\000\000\000\000\001q\003\"\001s\000\000\000\000\000\000\000\000\000\000\000\229\000\230\003\"\002;\002\171\002\161\000\000\000\000\000\229\000\230\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\001n\000\000\000\000\000\000\003\029\001q\000\000\001s\000\000\000\000\003g\000\000\003\029\000\000\004Z\000\000\002\181\000\000\001\b\000\000\003f\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\231\002\162\000\000\000\232\003\030\003g\000\000\000\000\000\000\004R\003\"\003i\003j\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\001\b\000\000\003f\003\011\000\000\000\000\000\000\003g\000\000\000\229\000\230\004L\000\240\003i\003j\000\000\003g\002<\002=\003k\003h\002>\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003m\003\029\002X\000L\000\000\000\000\000\240\003i\003j\003\016\000\000\000\229\000\230\003k\000\000\000\000\003i\003j\000\231\000\000\000\000\000\232\003\030\000\000\003m\001\b\000\000\003f\000\000\000\000\000\240\000\000\002\170\003\029\000\000\000\000\003\"\003k\000\000\000\240\000\000\003g\000\000\000\000\003\"\004A\003k\000\000\003m\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003m\000\000\000\000\000\000\000\000\002\171\002\161\000\000\000\229\000\230\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\002\\\000\000\000\000\002]\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\000\003\029\000\000\000\000\000\229\000\230\002\181\000\000\000\240\000\000\000\000\000\000\000\000\000\229\000\230\003k\000\000\001\b\000\231\003f\000\000\000\232\003\030\000\000\000\000\001\b\003m\003f\003\"\000\000\000\000\000\000\000\000\003g\000\000\003\029\000\000\004@\000\000\000\000\000\000\003g\000\000\000\231\000\000\004+\000\232\bX\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\002a\000\000\003\"\000\000\000\000\003i\003j\000\000\000\000\000\229\000\230\000\000\000\000\003i\003j\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\240\000\000\000\000\003\029\000\000\000\000\000\000\003k\000\240\001\b\000\000\003f\000\000\003\029\000\000\003k\000\000\000\000\003m\000\000\000\231\000\000\000\000\000\232\003\030\003g\003m\000\000\003\"\003l\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\"\000\000\003i\003j\003g\000\000\000\229\000\230\003n\003\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\240\000\000\000\000\003\029\000\000\000\000\000\000\003k\000\000\003i\003j\000\000\000\000\000\229\000\230\000\000\000\000\001\b\003m\003f\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\240\003g\000\000\003\029\000\000\003t\003\"\003k\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\003\"\000\000\003m\001\b\000\231\003f\000\000\000\232\003\030\000\000\003g\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\003g\000\000\000\231\000\000\003v\000\232\b'\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001[\000\000\000\000\001\\\000\000\000\240\000\000\003i\003j\000\229\000\230\000\000\003k\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\000\229\000\230\003m\001\b\000\000\003f\000\000\000\000\000\000\000\240\003\029\000\000\000\000\001\b\003\"\003f\000\000\000\000\000\240\003g\000\000\000\000\003\029\003x\000\000\003k\000\000\000\231\000\000\003g\000\232\003\030\000\000\003z\000\000\000\000\003m\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003\"\000\000\000\000\003i\003j\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\003\"\000\000\000\000\000\000\000\000\000\000\001b\000\000\000\000\000\240\000\000\003\029\000\000\000\000\000\229\000\230\003k\000\000\001\b\000\240\003f\001e\001\186\004]\000\000\000\000\003k\003m\000\231\000\000\000\000\000\232\003\030\000\000\003g\000\000\003\029\003m\003|\000\000\000\000\001g\000L\000\000\000\000\000\000\000\229\000\230\000\000\000\000\001\b\000\000\003f\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003\"\000\000\000\000\000\000\003i\003j\003g\001\b\003\029\003f\003~\000\000\003\"\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\002;\000\000\003g\000\000\000\231\000\000\000\240\000\232\003\030\000\000\000\000\000\000\000\000\003k\000\000\003i\003j\000\000\000\000\003\029\000\000\000\000\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\229\000\230\003i\003j\000\000\b\n\000\231\000\000\000\240\000\232\003\030\000\000\001l\003\"\000\000\003k\001\b\000\000\003f\000\000\000\000\000\000\003\029\000\000\000\000\000\240\003m\000\000\001\b\000\000\003f\000\000\003g\000\000\000\000\000\000\003\128\000\000\003\"\000\231\000\000\000\000\000\232\003\030\003g\000\000\000\000\000\000\003\130\000\000\000\000\000\229\000\230\002<\002=\000\000\000\000\002\127\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\001\188\002X\000L\003\"\000\000\004Q\003\029\003i\003j\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\240\000\000\000\000\000\000\000\000\000\231\000\000\003k\000\232\003\030\000\000\003g\000\240\000\000\000\000\003\132\000\000\003\"\003m\003k\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003m\000\229\000\230\000\000\000\000\000\000\003g\000\000\000\000\000\000\003\134\003i\003j\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\"\000\000\001\b\003\029\003f\000\000\002\\\000\000\002;\002]\000\000\000\000\000\000\000\000\000\240\002`\003i\003j\003g\000\000\000\231\003k\003\136\000\232\003\030\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003m\000\000\001\b\000\000\003f\000\000\000\000\000\240\000\000\000\000\000\000\000\229\000\230\000\000\003k\000\000\003i\003j\003g\003\"\000\000\000\000\003\138\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\229\000\230\000\000\003\029\000\000\001\b\000\000\003f\000\000\000\240\000\000\000\000\000\000\002a\000\000\000\000\003k\000\000\003i\003j\000\231\003g\003\029\000\232\003\030\003\140\000\000\003m\002\153\002<\002=\000\000\000\000\002_\000\000\000\000\000\000\000\000\000\000\000\231\000\000\000\240\000\232\003\030\002X\000L\002\153\000\000\003k\000\000\000\000\003i\003j\000\000\003\"\000\000\001\b\000\000\003f\003m\002\154\004\148\004\153\000\000\002\166\000\229\000\230\000\000\000\000\000\000\000\000\002\158\003g\000\000\000\240\000\000\003\142\000\000\002\154\002\155\002\156\003k\002\166\000\000\000\000\000\000\000\000\003\029\000\000\002\158\000\000\002\167\003m\000\000\000\000\004\197\000\000\000\229\000\230\000\000\000\000\000\000\003i\003j\000\231\000\000\000\000\000\232\003\030\002\167\002\185\000\000\000\000\002\176\000\000\000\000\003\"\002\\\000\000\003\029\002]\001\b\000\000\003f\000\000\000\240\002`\000\000\000\000\000\000\000\229\000\230\003k\000\000\000\000\003\"\000\231\003g\000\000\000\232\003\030\003\144\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\003\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\162\000\000\000\000\000\000\000\000\003i\003j\000\231\000\000\003\029\000\232\003\030\000\000\000\000\000\000\000\000\000\000\000\000\002\162\000\000\000\000\001\b\000\000\003f\002a\000\000\000\231\000\000\000\240\000\232\003\030\000\000\000\000\000\000\000\000\003k\000\000\003g\003\"\000\000\001\b\003\146\003f\000\241\000\230\000\000\003m\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\004\200\003g\000\000\000\000\000\000\003\148\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\003\"\000\000\003\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\242\002\170\000\243\000\244\003i\003j\000\000\000\231\000\240\000\000\000\232\003\030\000\000\000\000\000\000\003k\000\000\000\000\000\000\002\170\000\000\003\"\000\000\001\b\000\000\003f\003m\000\240\000\000\000\000\000\000\002\171\002\161\000\000\003k\000\000\000\000\000\000\000\000\003g\003\"\000\000\000\000\003\150\000\000\003m\000\000\000\000\000\000\002\171\002\161\000\000\000\229\000\230\000\000\001\b\000\000\003f\000\000\000\000\000\000\002\181\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\003g\000\000\000\000\003\029\003\154\000\229\000\230\000\000\002\181\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\231\000\240\000\000\000\232\003\030\000\245\000\000\003\029\003k\000\000\003i\003j\003\"\003g\000\000\000\000\001\b\003\153\003f\003m\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\003g\000\240\000\000\000\000\003\156\000\000\000\000\000\000\003k\000\000\000\000\003i\003j\000\000\002;\000\229\000\230\000\000\000\000\003m\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\000\240\000\000\000\000\003\029\000\000\000\000\001\b\003k\001\016\000\000\000\000\003\029\000\000\001\b\000\000\003f\000\000\000\000\003m\000\240\000\231\000\000\001\017\000\232\003\030\000\000\003k\000\000\000\231\003g\003\"\000\232\003\030\003\158\000\000\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\002;\000\000\000\000\000\000\001\018\001\021\003\"\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\002<\002=\000\000\003\029\002b\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\240\000\000\000\000\002X\000L\000\000\000\000\000\240\000\231\000\000\000\000\000\232\003\030\000\000\003k\000\000\003\029\000\000\000\000\000\000\000\000\000\000\001\b\000\000\003f\003m\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\231\000\000\000\000\000\232\003\030\003g\000\000\000\000\003\"\003\160\000\000\000\000\000\000\001\b\000\000\003f\003\"\000\000\000\000\000\000\003\029\000\000\000\000\002<\002=\000\000\000\000\003.\000\000\003g\000\000\000\229\000\230\003\162\000\000\003i\003j\000\231\002X\000L\000\232\003\030\000\000\002\\\000\000\000\000\002]\000\000\000\000\000\000\000\000\000\000\002`\003\029\000\000\000\000\000\000\000\000\000\240\003i\003j\000\000\000\000\000\000\000\000\003k\000\229\000\230\000\000\000\000\000\231\003\"\000\000\000\232\003\030\001\b\003m\003f\000\000\000\000\000\000\000\000\000\240\001\b\000\000\003f\000\000\000\000\003\029\003k\000\000\003g\000\000\000\000\000\000\003\164\003\"\000\000\000\000\003g\003m\000\000\000\000\003\189\000\000\000\231\000\000\000\000\000\232\003\030\000\000\002\\\002a\000\000\002]\000\000\000\000\000\000\000\000\000\000\002`\003i\003j\000\000\000\000\000\229\000\230\000\000\000\000\003i\003j\000\000\000\000\003\"\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\240\000\000\000\000\003\029\000\000\000\000\000\000\003k\000\240\000\000\003g\000\000\000\000\000\000\003\193\003k\000\000\000\000\003m\001\b\000\231\003f\003\"\000\232\003\030\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\003g\002a\000\000\000\000\003\198\003i\003j\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\003\029\000\000\001\b\003\"\003f\000\000\000\000\000\000\000\000\000\240\000\000\003i\003j\000\000\000\000\000\000\003k\000\231\003g\003\029\000\232\003\030\003\221\000\000\000\000\000\000\000\000\003m\000\000\001[\000\000\002\153\001\\\000\000\000\240\001\b\000\231\003f\000\000\000\232\003\030\003k\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\003g\003m\000\000\000\000\003\231\000\000\000\000\000\229\000\230\000\000\000\000\003\"\002\154\002\155\002\156\000\000\002\166\000\000\000\000\001\b\000\240\003f\000\000\002\158\000\000\000\000\000\000\003k\000\000\003\029\003i\003j\000\000\000\000\000\000\003g\000\000\000\000\003m\003\237\000\000\000\000\000\000\002\167\003\n\000\000\000\231\002\176\000\000\000\232\003\030\000\000\000\000\000\240\000\000\000\000\000\000\000\229\000\230\000\000\003k\000\000\003\"\000\000\000\000\003i\003j\000\000\001b\000\229\000\230\003m\002;\000\000\000\000\000\000\000\000\000\000\001\b\003\029\003f\003\"\000\000\001e\001\186\005\012\000\000\000\000\000\240\000\000\000\000\003\029\000\000\000\000\003g\003k\000\231\000\000\003\242\000\232\003\030\000\000\000\000\001g\000L\000\000\003m\b4\000\231\000\000\000\000\000\232\003\030\000\000\002\162\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\004g\000\000\000\000\003\029\003\"\000\000\000\000\003g\000\000\000\240\001\b\003\249\003f\001\004\000\230\000\000\003k\002<\002=\000\000\000\231\002\127\000\000\000\232\003\030\000\000\003g\003m\000\000\000\000\004\000\000\000\002X\000L\000\000\000\000\003\016\003i\003j\000\000\000\000\000\000\000\229\000\230\000\000\002;\000\000\001l\000\000\000\000\000\000\000\000\000\000\bj\003\"\007\227\003i\003j\000\000\002\170\000\240\000\229\000\230\000\000\003\029\000\000\003\"\003k\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\002;\003m\000\240\b7\000\231\000\000\003\029\000\232\003\030\003k\003g\000\000\002\171\002\161\004\020\000\000\000\000\000\000\000\000\000\000\003m\000\000\000\000\000\231\000\000\001\188\000\232\003\030\002\\\000\000\004Q\002]\000\000\000\000\000\000\000\229\000\230\002`\000\000\003\"\003i\003j\002\181\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\000\002<\002=\000\000\000\000\002\127\001\b\003\029\003f\000\000\003g\000\000\000\000\000\240\004\028\000\000\002X\000L\000\000\000\000\003k\007\228\003g\000\000\000\231\000\000\004\"\000\232\003\030\000\000\000\000\003m\000\000\002<\002=\000\229\000\230\003=\000\000\000\000\003i\003j\000\000\000\000\000\229\000\230\000\000\002a\002X\000L\003\"\000\000\003i\003j\000\000\000\000\001\b\003\029\003f\000\000\000\000\000\000\000\000\000\240\000\000\000\000\003\029\000\000\000\000\003\"\003k\000\000\003g\000\000\000\231\000\240\004.\000\232\003\030\000\000\000\000\003m\003k\000\231\000\000\000\000\000\232\003\030\001\b\002\\\b\002\000\000\002]\003m\000\000\000\000\000\000\000\000\002`\000\000\000\000\000\000\003i\003j\b\003\000\229\000\230\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\b\000\000\003f\003\"\002\\\000\000\000\000\002]\000\240\000\000\003\029\000\000\000\000\002`\000\000\003k\003g\b\004\b\005\001\b\0041\003f\000\000\000\000\000\000\000\000\003m\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\003g\000\229\000\230\000\000\0044\000\240\002a\000\229\000\230\000\000\000\000\003i\003j\000\000\000\000\000\000\000\000\000\000\003\"\000\000\000\000\000\000\000\000\003\029\000\000\000\000\000\000\003\"\000\000\003\029\003i\003j\000\000\000\000\000\240\001\b\000\000\003f\002a\000\000\000\231\003k\000\000\000\232\003\030\000\000\000\231\000\000\000\000\000\232\003\030\003g\003m\000\240\000\000\004:\000\000\000\000\000\000\000\000\003k\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\003m\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\001\b\003\029\003f\003\"\000\000\000\000\000\000\000\000\000\000\001\b\003\029\003f\000\000\000\000\000\000\000\000\003g\000\000\000\231\000\240\004=\000\232\003\030\000\000\000\000\003g\003k\000\231\000\000\004E\000\232\003\030\000\000\000\000\000\000\000\000\000\000\003m\000\229\000\230\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\003\"\000\000\000\000\000\000\003i\003j\003\"\000\000\000\000\003\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\240\001\b\000\000\003f\000\000\000\000\000\000\003k\000\231\000\240\000\000\000\232\003\030\000\000\000\000\000\000\003k\003g\003m\000\229\000\230\004P\000\000\000\000\000\000\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\029\000\000\000\000\001Z\003\"\000\000\003i\003j\001\b\001[\003f\000\000\001\\\003\"\001\b\000\000\003f\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003g\000\000\000\229\000\230\004V\000\240\003g\000\000\000\000\000\000\004`\000\000\003k\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003m\003\029\000\000\000\229\000\230\000\000\000\000\003i\003j\000\000\000\000\000\000\000\000\003i\003j\000\000\003\"\000\000\000\231\000\000\000\000\000\232\003\030\000\000\001\b\003\029\003f\000\000\000\000\000\000\000\240\000\000\000\000\001\b\000\000\003f\000\240\003k\000\000\000\000\003g\002\153\000\231\003k\004t\000\232\003\030\000\000\003m\003g\000\000\000\000\001b\004w\003m\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001c\000\000\000\000\003\"\001e\001f\000\000\003i\003j\000\000\002\154\002\155\002\156\000\000\002\166\000\000\003i\003j\000\000\000\000\001\b\002\158\003f\000\000\001g\000L\000\000\000\000\000\000\000\000\000\240\000\000\000\000\000\000\000\229\000\230\003g\003k\000\000\000\240\004\135\002\167\003\n\000\000\000\000\002\176\003k\000\000\003m\000\000\000\000\003\"\000\000\000\000\000\000\000\000\003\029\003m\000\000\002\153\000\000\000\000\000\229\000\230\000\000\000\000\003i\003j\000\000\000\000\001\b\000\000\003f\000\231\000\000\003\"\000\232\003\030\000\000\000\000\000\000\001j\000\000\000\000\003\029\000\000\003g\000\000\000\000\000\240\004\137\002\154\002\155\002\156\000\000\002\166\003k\000\000\000\000\000\000\000\000\000\231\002\158\000\000\000\232\003\030\001l\003m\000\000\000\000\000\000\000\000\002\162\000\000\000\000\000\000\003i\003j\001\b\000\000\003f\000\000\002\167\003\n\000\000\000\000\002\176\001t\004\150\000\000\000\000\000\000\000\000\000\000\003g\000\000\004\170\000\000\004\143\000\240\000\000\000\000\001\b\000\000\003f\000\000\003k\001Z\000\000\000\000\000\000\000\000\000\000\001[\000\000\000\000\001\\\003m\003g\000\000\000\000\001n\004\152\000\000\003i\003j\001q\000\000\001s\003\"\000\000\000\000\003\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\240\003i\003j\001Z\000\229\000\230\002\162\003k\002\170\001[\003\"\000\000\001\\\000\000\000\000\000\000\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\240\000\000\003\029\000\000\000\000\000\000\004\165\003k\000\000\000\000\000\000\000\000\000\000\000\000\002\171\002\161\000\000\000\000\003m\000\231\000\000\000\000\000\232\003\030\000\000\001\b\000\000\003f\000\000\000\000\001Z\000\000\001b\000\000\000\000\000\000\001[\000\229\000\230\001\\\000\000\003g\003\016\001c\002\181\004\158\000\000\001e\001f\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\003\029\000\000\000\000\000\000\000\000\000\000\002\170\000\000\001g\000L\003g\000\000\003i\003j\004\183\000\000\001b\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\000\000\000\001c\000\000\000\000\000\000\001e\001f\000\229\000\230\000\240\002\171\002\161\000\000\000\000\003i\003j\003k\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\001g\000L\003m\000\000\003\029\003\"\000\000\000\000\000\000\000\000\000\000\000\000\000\240\000\000\001j\002\181\001b\003\029\000\000\003k\000\000\000\231\000\000\000\000\000\232\003\030\000\000\001c\000\000\000\000\003m\001e\001f\000\000\000\231\000\000\000\000\000\232\003\030\001l\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\001g\000L\000\000\000\000\000\000\000\000\001j\000\000\000\000\001t\004\181\003\"\000\000\000\000\000\000\000\000\000\000\000\000\003\029\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\002;\001l\000\229\000\230\000\000\000\231\000\000\003g\000\232\003\030\000\000\004\188\000\000\001n\000\000\000\000\000\000\000\000\001q\000\000\001s\000\000\001t\004\186\003\029\000\000\000\000\001j\000\000\000\000\000\000\000\000\000\000\001Z\000\000\b:\003\"\003i\003j\001[\000\000\000\231\001\\\000\000\000\232\003\030\000\000\000\000\001\b\003\"\003f\000\000\001l\000\000\000\229\000\230\001n\000\000\000\000\000\000\000\240\001q\000\000\001s\003g\000\000\000\000\003k\004\195\000\000\000\000\000\000\000\000\001t\004\191\000\000\003\029\000\000\003m\000\000\000\000\000\000\000\000\002<\002=\000\000\000\000\002\127\000\000\000\000\000\000\000\229\000\230\000\231\003i\003j\000\232\003\030\002X\000L\000\000\003\"\000\000\001\b\000\000\003f\000\000\001n\000\000\000\000\000\000\000\000\001q\003\029\001s\000\000\001\b\000\240\003f\003g\000\000\000\000\001Z\004\199\003k\000\000\000\000\000\000\001[\001b\000\231\001\\\003g\000\232\003\030\003m\004\211\003\"\000\000\000\000\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\001g\000L\000\000\000\000\001\b\000\000\003f\002\\\000\240\000\000\002]\000\000\000\000\000\000\000\000\003k\002`\000\000\000\000\000\000\003g\000\240\000\000\001Z\004\223\003\"\003m\000\000\003k\001[\000\000\000\000\001\\\000\000\000\000\000\000\000\000\000\000\000\000\003m\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\001Z\000\000\001b\000\000\003g\001j\001[\000\000\004\225\001\\\003\"\000\000\000\000\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\000\240\000\000\000\000\002a\000\000\000\000\000\000\003k\000\000\001l\000\000\000\000\000\000\003i\003j\000\000\001g\000L\003m\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001t\004\231\000\000\000\000\000\000\003g\000\240\000\000\001Z\005\n\000\000\000\000\000\000\003k\001[\000\000\001b\001\\\000\000\000\000\000\000\000\000\000\000\000\000\003m\000\000\001\b\001c\003f\000\000\000\000\001e\001f\000\000\001n\003i\003j\000\000\001Z\001q\000\000\001s\003g\001j\001[\001b\005\014\001\\\000\000\000\000\000\000\001g\000L\000\000\000\000\000\000\001c\000\000\000\240\000\000\001e\001f\000\000\000\000\000\000\003k\000\000\000\000\001l\001Z\000\000\000\000\003i\003j\000\000\001[\003m\000\000\001\\\000\000\001g\000L\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001t\005\021\000\000\000\000\002\153\000\000\000\240\000\000\000\000\000\000\000\000\000\000\000\000\003k\000\000\001b\000\000\000\000\000\000\001j\000\000\000\000\000\000\000\000\003m\000\000\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\001n\000\000\002\154\002\155\002\156\001q\002\166\001s\000\000\000\000\001l\001b\000\000\002\158\001j\000\000\001g\000L\000\000\000\000\000\000\000\000\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\000\000\001t\0058\002\167\002\250\001Z\000\000\002\176\000\000\001l\000\000\001[\001b\000\000\001\\\000\000\001g\000L\002\153\000\000\000\000\000\000\000\000\001c\000\000\000\000\000\000\001e\001f\000\000\001t\005Y\000\000\000\000\000\000\001n\000\000\000\000\000\000\000\000\001q\000\000\001s\001j\002\153\000\000\000\000\001g\000L\000\000\002\154\002\155\002\156\000\000\002\166\000\000\000\000\000\000\000\000\000\000\000\000\002\158\000\000\000\000\001n\000\000\000\000\000\000\001l\001q\000\000\001s\000\000\001j\002\162\000\000\002\154\002\155\002\156\000\000\002\166\002\167\003\n\000\000\000\000\002\176\000\000\002\158\000\000\001t\005\\\000\000\000\229\000\230\000\000\000\000\000\000\000\000\001l\000\000\000\000\001b\000\229\000\230\001j\000\000\000\000\002\167\003\n\000\000\000\000\002\176\001c\000\000\003\029\000\000\001e\001f\000\000\001t\005\219\000\000\000\000\001n\003\029\000\000\000\000\000\000\001q\001l\001s\000\231\000\000\000\000\000\232\003\030\001g\000L\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\000\001t\005\225\002\162\001n\000\000\000\000\000\000\002\170\001q\000\000\001s\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006%\000\000\002\162\000\000\000\000\000\000\000\000\000\000\001n\000\000\003\029\002\171\002\161\001q\000\000\001s\000\000\001j\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\006 \000\231\001Z\000\000\000\232\003\030\000\000\000\000\001[\000\000\003\016\001\\\000\000\000\000\000\000\002\181\001l\000\000\002\153\000\000\000\000\000\000\000\000\000\000\002\153\003\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\170\000\000\003\"\003\016\001t\006;\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\154\002\155\002\156\000\000\002\166\000\000\002\154\002\155\002\156\002\170\002\166\002\158\000\000\002\171\002\161\000\000\000\000\002\158\000\000\000\000\000\000\001n\000\000\000\000\000\000\000\000\001q\000\000\001s\000\000\000\000\002\167\003\n\000\000\000\000\002\176\000\000\002\167\003\n\002\171\002\161\002\176\001\b\002\181\003f\000\000\000\000\003\"\001b\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\003g\001c\002\153\000\000\006>\001e\001f\000\000\000\000\000\000\003g\002\181\000\000\000\000\006B\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001g\000L\000\000\000\000\000\000\003i\003j\000\000\000\000\002\154\002\155\002\156\000\000\002\166\000\000\003i\003j\000\000\000\000\002\162\002\158\000\000\000\000\000\000\000\000\002\162\000\229\000\230\000\240\000\000\000\000\001\b\000\000\003f\000\000\003k\000\000\000\000\000\240\000\000\002\167\003\n\000\000\006\148\002\176\003k\003m\003g\003\029\006\165\000\000\006E\000\000\000\000\000\229\000\230\003m\001j\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\000\000\000\000\000\003\029\003i\003j\003\016\000\000\000\000\001l\000\000\000\000\003\016\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\240\000\000\002\170\001t\006^\000\000\000\000\003k\002\170\003\029\000\000\002\162\000\229\000\230\000\000\000\000\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\231\000\000\000\000\000\232\003\030\000\000\002\171\002\161\003\029\006\161\000\000\001n\002\171\002\161\000\000\000\000\001q\000\000\001s\000\000\003\029\000\000\000\229\000\230\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\000\000\000\003\"\002\181\000\231\000\000\000\000\000\232\003\030\002\181\000\000\003\029\003\016\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\231\000\000\003\"\000\232\003\030\000\000\000\000\002\170\000\000\000\000\000\000\003\029\000\000\000\000\000\000\000\000\002\153\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003\"\000\000\002\171\002\161\000\000\000\000\001\b\000\000\003f\000\000\003\029\000\000\000\000\002\154\004\148\004\153\000\000\002\166\000\000\000\000\000\229\000\230\003g\000\000\002\158\003\"\006\185\000\231\000\000\000\000\000\232\003\030\002\181\000\000\001\b\000\000\003f\003\"\000\000\000\000\000\000\000\000\003\029\000\000\002\167\000\000\000\000\000\000\004\197\000\000\003g\000\000\003i\003j\006\191\000\000\000\000\000\000\000\000\000\231\000\000\003\"\000\232\003\030\000\000\000\000\002\153\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\240\000\000\000\000\000\000\000\000\003i\003j\003k\003g\000\000\000\000\000\000\006\193\000\000\003\"\000\000\000\000\001\b\003m\003f\000\000\000\000\000\000\002\154\004\148\004\153\000\000\002\166\000\240\001\b\000\000\003f\000\000\003g\002\158\003k\000\000\006\195\003i\003j\002\162\000\000\000\000\000\000\000\000\003g\003m\000\000\003\"\006\197\000\000\000\000\000\000\001\b\002\167\003f\000\000\000\000\004\197\000\000\000\000\000\240\000\000\003i\003j\000\000\000\000\000\000\003k\003g\000\229\000\230\000\000\006\199\000\000\003i\003j\000\000\000\000\003m\003\"\001\b\000\000\003f\000\000\000\000\000\240\000\000\000\000\000\000\000\000\000\000\003\029\003k\000\000\006I\000\000\003g\000\240\003i\003j\006\201\000\229\000\230\003m\003k\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\001\b\003m\003f\000\000\000\000\000\000\000\000\000\240\002\170\003\029\002\162\000\000\003i\003j\003k\000\000\003g\000\000\000\000\000\000\006\203\000\229\000\230\000\000\000\000\003m\000\231\000\000\000\000\000\232\003\030\000\000\001\b\000\000\003f\000\240\000\000\000\000\002\171\002\161\000\000\000\000\003k\003\029\000\000\000\000\003i\003j\003g\000\229\000\230\000\000\006\205\003m\000\000\000\229\000\230\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\006x\000\000\000\000\002\181\000\240\000\000\003\029\000\000\000\000\000\000\000\000\003k\003\029\003i\003j\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003m\000\231\000\000\003\"\000\232\003\030\002\170\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\240\000\000\000\229\000\230\000\000\000\000\000\000\003k\000\000\000\000\000\000\000\229\000\230\000\000\002;\000\000\000\000\000\000\003m\000\000\000\000\003\"\002\171\002\161\003\029\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\003\029\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003\029\bA\000\231\000\000\002\181\000\232\003\030\003\"\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003g\000\000\000\000\000\000\006\207\000\229\000\230\000\000\000\000\000\000\000\000\003\"\000\000\000\000\000\000\000\000\001\b\003\"\003f\000\000\000\000\000\000\000\000\000\000\000\000\002<\002=\003\029\000\000\002\127\003i\003j\003g\000\229\000\230\000\000\006\209\000\000\000\000\000\000\002X\000L\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\001\b\000\000\003f\000\240\000\000\003\029\000\000\000\000\000\000\000\000\003k\000\000\003i\003j\000\000\003\"\003g\000\000\000\000\000\000\006\211\003m\000\231\000\000\003\"\000\232\003\030\000\000\001\b\000\000\003f\000\000\000\000\000\000\001\b\000\240\003f\000\000\000\000\003\"\000\000\000\000\003k\000\000\003g\000\000\003i\003j\006\213\000\000\003g\000\000\000\000\003m\006\215\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\\\000\000\000\000\002]\000\000\000\000\000\240\000\000\000\000\002`\000\000\003i\003j\003k\000\229\000\230\000\000\003i\003j\001\b\000\000\003f\000\000\000\000\003m\000\000\000\000\003\"\001\b\000\000\003f\000\000\000\000\000\000\000\240\003g\003\029\000\000\000\000\006\217\000\240\003k\000\000\001\b\003g\003f\000\000\003k\006\219\000\000\000\000\000\000\003m\000\231\000\000\003\"\000\232\003\030\003m\003g\000\000\000\000\000\000\006\221\000\000\003i\003j\000\000\000\000\002a\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\240\003i\003j\000\000\000\000\000\000\001\b\003k\003f\000\240\000\000\000\000\003\029\000\000\000\000\000\000\003k\000\000\003m\000\000\003\029\000\000\003g\000\000\000\240\000\000\006\223\003m\000\000\000\231\000\000\003k\000\232\003\030\001\b\000\000\003f\000\231\000\000\000\000\000\232\003\030\003m\000\000\000\000\000\000\000\000\000\000\000\229\000\230\003g\000\000\003i\003j\006\225\000\000\000\229\000\230\000\000\000\000\000\000\003\"\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003\029\000\000\000\000\000\000\000\000\000\240\000\000\000\000\003\029\000\000\003i\003j\003k\000\000\000\229\000\230\000\000\000\231\000\000\000\000\000\232\003\030\000\000\003m\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\000\000\240\000\000\000\000\003\029\000\000\000\000\000\000\003k\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\003m\000\000\000\231\000\000\003\"\000\232\003\030\001\b\000\000\003f\000\000\000\000\003\"\000\000\000\000\000\000\000\000\000\000\000\000\003\029\000\000\000\229\000\230\003g\000\000\000\000\000\000\006\227\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003\029\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\000\229\000\230\000\231\000\000\003\"\000\232\003\030\000\000\000\000\000\000\000\000\000\000\003\"\001\b\000\000\003f\000\000\000\000\000\240\000\000\000\000\001\b\003\029\003f\000\000\003k\000\000\000\000\000\231\003g\000\000\000\232\000\233\006\231\000\000\000\000\003m\003g\000\000\000\231\003\"\006\230\000\232\003\030\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\229\000\230\000\000\000\000\000\000\003i\003j\000\000\000\000\001\b\000\000\003f\003\"\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\240\000\000\003\029\000\000\000\000\003g\000\000\003k\000\240\006\233\000\000\000\000\000\000\003g\000\000\003k\003\"\006\235\003m\000\231\000\000\000\000\000\232\003\030\000\000\001\b\003m\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\229\000\230\000\000\003g\003\"\003i\003j\006\237\000\000\000\000\000\229\000\230\000\000\000\000\000\000\003\"\000\000\000\000\000\000\000\000\000\240\001\b\003\029\003f\000\000\000\000\000\000\003k\000\240\000\000\000\000\000\000\003\029\003i\003j\003k\000\000\003g\003m\000\231\000\000\006\239\000\232\003\030\000\000\001\b\003m\003f\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\000\240\000\000\000\000\000\000\000\000\003g\000\000\003k\000\000\006\242\001Z\003i\003j\000\000\000\000\001\b\001[\003f\003m\001\\\000\000\003\"\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\003g\000\229\000\230\000\240\003i\003j\000\000\000\229\000\230\000\000\003k\003g\000\000\000\229\000\230\006\250\000\000\000\000\000\000\000\000\000\000\003m\000\000\003\029\000\000\000\000\000\000\000\240\000\000\003\029\003i\003j\000\000\000\000\003k\003\029\000\000\000\000\000\000\000\000\000\231\003i\003j\000\232\003\030\003m\000\231\000\000\003\"\000\232\003\030\000\000\000\231\000\240\000\000\000\232\003\030\001\b\003\"\003f\000\000\000\000\000\000\000\000\000\240\000\000\000\000\000\000\000\000\000\000\000\000\003k\000\000\003g\000\000\001b\000\000\006\253\000\000\000\000\000\000\000\000\003m\000\000\000\000\000\000\001c\000\000\000\000\000\000\001e\001f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\000\229\000\230\000\000\001g\000L\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\b\000\240\003f\000\000\003\029\000\000\003g\000\000\003k\000\000\007\000\003\"\000\000\000\000\000\000\000\000\003g\003\"\000\000\003m\007\003\000\231\000\000\003\"\000\232\003\030\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\000\000\000\000\003i\003j\000\000\000\000\000\229\000\230\001j\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\000\000\000\000\000\000\003\029\000\000\000\000\000\000\000\000\000\240\000\000\000\000\003\029\000\000\000\000\000\000\003k\001l\000\000\000\240\000\000\000\231\000\000\000\000\000\232\003\030\003k\003m\001\b\000\231\003f\000\000\000\232\003\030\001\b\000\000\003f\003m\001t\007[\001\b\000\000\003f\000\000\003g\000\000\000\000\000\000\007\t\000\000\003g\000\000\001[\000\000\007\012\001\\\003g\000\000\000\000\000\000\007r\000\000\001\179\000\229\000\230\000\000\000\000\003\"\000\000\000\000\000\000\000\000\001n\000\000\003i\003j\000\000\001q\000\000\001s\003i\003j\000\000\000\000\000\000\003\029\003i\003j\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\196\000\000\000\240\000\229\000\230\000\000\000\000\000\231\000\240\003k\000\232\003\030\000\000\000\000\000\240\003k\000\000\000\000\000\229\000\230\003m\003k\003\"\000\000\000\000\003\029\003m\000\000\000\000\000\000\003\"\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\000\001\b\003\029\003f\000\231\001Z\000\000\000\232\003\030\001b\000\000\001[\000\000\000\000\001\\\000\000\000\000\003g\000\000\000\231\001\181\007w\000\232\003\030\001e\001\186\001\187\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\001g\000L\000\000\003i\003j\000\000\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\001\b\000\000\003f\000\000\000\000\003\029\003\"\000\000\003g\000\000\000\000\000\240\007\167\000\000\000\000\000\000\003g\000\000\003k\000\000\007\220\000\000\000\231\000\000\000\000\000\232\003\030\000\000\000\000\003m\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\003\"\001b\000\000\000\000\000\000\003i\003j\002\153\000\000\000\000\000\000\000\000\001c\000\000\000\000\003\"\001e\001f\000\000\000\000\000\240\000\000\002\153\000\000\000\000\000\000\001l\003k\000\240\000\000\000\000\000\000\001\b\000\000\003f\003k\001g\000L\003m\002\154\004\148\004\153\000\000\002\166\000\000\000\000\003m\000\000\003g\000\000\002\158\000\000\b#\000\000\002\154\002\155\002\156\000\000\002\166\000\000\000\000\000\000\000\000\002\153\000\000\002\158\000\000\001\b\000\000\003f\002\167\000\000\000\000\000\000\004\197\000\000\000\000\003\"\003i\003j\000\000\001\188\001\b\003g\003f\002\167\001\189\bF\000\000\t\026\t\028\000\000\000\000\001j\000\000\002\154\002\155\002\156\003g\002\166\000\000\000\240\bH\000\000\000\000\000\000\002\158\000\000\003k\000\000\000\000\000\000\000\000\003i\003j\000\000\002\153\000\000\001l\003m\000\000\000\000\000\000\000\000\000\000\000\000\002\167\000\000\003i\003j\002\240\000\000\000\000\000\000\000\000\000\000\000\240\000\000\002\153\001t\b\232\002\162\000\000\003k\001\b\000\000\003f\000\000\002\154\002\155\002\156\000\240\002\166\000\000\003m\000\000\002\162\000\000\003k\002\158\003g\000\000\000\000\000\000\b\235\000\000\002\153\000\000\000\000\003m\002\154\002\155\002\156\001n\002\166\000\000\000\000\000\000\001q\002\167\001s\002\158\002\153\002\230\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\002\153\000\000\006{\002\162\002\154\002\155\002\156\002\167\002\166\000\000\000\000\002\228\000\000\000\000\002\153\002\158\000\000\000\000\000\000\000\240\002\154\002\155\002\156\000\000\002\166\000\000\003k\000\000\000\000\000\000\002\170\002\158\002\154\002\155\002\156\002\167\002\166\003m\000\000\002\223\000\000\000\000\000\000\002\158\000\000\002\170\002\154\002\155\002\156\000\000\002\166\002\167\000\241\000\230\000\000\002\205\002\162\002\158\000\000\000\000\002\171\002\161\000\000\002\167\002\153\000\000\000\000\002\180\000\000\000\000\000\000\000\241\000\230\000\000\000\000\002\171\002\161\002\167\002\162\000\000\000\000\003\002\000\000\000\000\000\000\000\000\002\170\000\000\000\000\000\000\002\181\000\242\002\153\001\007\000\244\000\000\002\154\002\155\002\156\000\000\002\166\000\000\000\000\000\000\002\153\002\181\002\162\002\158\000\000\002\153\000\242\000\000\001\015\000\244\000\000\000\000\002\171\002\161\000\000\000\000\000\000\000\000\002\162\000\000\002\154\002\155\002\156\002\167\002\166\000\000\000\000\004r\000\000\000\000\002\162\002\158\002\154\002\155\002\156\002\170\002\166\002\154\002\155\002\156\000\000\002\166\002\181\002\158\002\162\000\000\002\153\000\000\002\158\000\000\000\000\002\167\000\000\000\000\000\000\004\221\000\000\002\170\000\241\000\230\000\000\000\000\000\000\002\167\000\000\002\171\002\161\006o\002\167\000\229\000\230\000\000\007\171\000\000\000\000\000\000\000\000\000\000\002\154\002\155\002\156\000\000\002\166\000\245\000\000\002\170\000\000\002\171\002\161\002\158\000\000\000\000\000\000\000\000\002\162\002\181\000\000\000\242\000\000\001\026\000\244\002\170\000\245\000\000\000\000\000\000\000\000\000\000\000\231\002\238\000\000\000\232\001\023\002\170\000\000\002\171\002\161\002\181\000\000\000\000\000\229\000\230\002\162\000\000\000\000\000\000\000\000\002\170\000\000\000\000\000\000\002\171\002\161\000\000\002\162\000\000\000\000\000\000\000\000\002\162\000\229\000\230\000\000\002\171\002\161\002\181\000\000\000\000\000\000\000\000\001\b\000\000\001\016\000\241\000\230\000\000\000\000\002\171\002\161\000\231\000\000\002\181\000\232\003\025\000\000\000\000\001\017\000\000\000\000\001\b\000\000\001\016\000\000\002\181\000\000\000\000\000\000\002\170\000\000\000\231\002\162\000\000\000\232\003\027\000\000\001\017\000\000\002\181\000\000\000\000\000\241\000\230\000\242\000\245\003\181\000\244\001\018\001\021\000\000\000\000\000\000\000\229\000\230\000\000\003\"\002\170\000\000\002\171\002\161\000\000\000\000\000\000\000\000\000\000\000\000\001\018\001\021\002\170\000\000\000\240\000\000\000\000\002\170\000\000\000\000\000\229\000\230\000\000\000\000\000\242\000\000\003\186\000\244\000\000\000\000\002\171\002\161\002\181\000\240\000\000\000\231\000\000\000\000\000\232\004X\000\000\000\000\002\171\002\161\000\000\000\000\000\000\002\171\002\161\000\000\003\"\000\000\000\000\000\229\000\230\001\b\000\000\001\016\002\170\000\231\002\181\000\000\000\232\004\203\000\000\000\000\001\b\000\000\003f\000\000\003\"\001\017\002\181\000\000\000\000\000\000\000\000\002\181\000\000\000\000\000\000\000\000\003g\000\245\000\000\000\000\000\229\000\230\002\171\002\161\000\000\000\000\000\231\000\000\000\000\000\232\004\209\000\000\000\000\000\000\000\000\001\018\001\021\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\229\000\230\001\b\002\181\003f\000\245\000\000\000\000\000\000\000\240\000\231\000\000\000\000\000\232\004\227\000\000\003\"\000\000\003g\000\000\000\240\000\000\001\b\000\000\003f\000\000\000\000\000\000\000\231\000\000\000\000\000\232\006\n\000\000\000\000\001\b\000\000\001\016\003g\000\231\003\"\000\000\000\232\006K\000\000\000\000\000\000\000\000\003i\003j\000\000\001\017\000\000\000\000\000\000\000\229\000\230\000\000\000\000\000\000\000\000\000\241\000\230\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\240\001\b\003\"\001\016\000\000\000\000\000\000\000\000\000\000\000\000\001\018\001\021\001\b\000\000\003f\000\000\000\000\001\017\000\229\000\230\000\240\000\000\000\000\000\231\000\241\000\230\000\232\006\187\003g\000\242\002;\007\157\000\244\000\240\000\000\003\"\001\b\000\000\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\229\000\230\001\018\001\021\000\000\000\229\000\230\003g\003\"\000\000\000\000\000\000\000\231\003i\003j\000\232\007\160\000\000\000\242\003\"\007\165\000\244\000\000\000\000\001\b\000\240\003f\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\240\003i\003j\000\231\003g\000\000\000\232\t\003\000\231\000\000\000\000\000\232\t\t\000\000\000\000\000\000\000\000\000\000\001\004\000\230\000\000\001\b\000\000\003f\000\240\000\000\000\000\000\000\000\000\001\004\000\230\000\000\002<\002=\003i\003j\005\017\003g\003\"\001\b\000\000\003f\000\000\000\000\000\245\000\000\000\000\002X\000L\000\000\001\b\000\000\003f\000\000\000\000\003g\000\000\000\240\b^\000\000\007\227\000\000\000\000\000\000\000\000\000\000\003g\003i\003j\001\005\000\000\007\227\003\"\000\000\000\000\000\000\000\000\000\000\000\245\000\000\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\000\000\000\000\000\240\000\000\000\000\000\000\000\000\000\000\003i\003j\000\000\003\"\000\000\000\000\000\000\000\000\003\"\001\b\000\000\003f\000\240\000\000\000\000\001\b\002;\001\016\000\000\000\000\000\000\002;\000\000\000\240\002\\\003g\000\000\002]\000\000\000\000\000\000\001\017\000\000\002`\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\b\002;\003f\000\000\000\000\000\000\001\b\000\000\001\016\000\000\000\000\000\000\003i\003j\007\228\000\000\003g\000\000\001\018\001\021\000\000\000\000\001\017\000\000\000\000\007\228\000\000\001\b\000\000\003f\000\000\000\000\001\b\000\000\003f\000\240\000\000\000\000\000\000\000\000\000\000\000\240\000\000\003g\000\000\000\000\003i\003j\003g\000\000\002a\000\000\001\018\001\021\000\000\000\000\002<\002=\000\000\000\000\005\170\002<\002=\000\000\000\000\005\221\000\000\000\000\000\000\000\240\000\000\002X\000L\003i\003j\000\240\002X\000L\003i\003j\000\000\001\b\000\000\b\002\002<\002=\000\000\000\000\007\019\000\000\000\000\000\000\001\b\000\000\b\002\000\000\000\240\b\003\000\000\002X\000L\000\240\000\000\000\000\000\000\000\000\000\000\000\000\b\003\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\004\b\005\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\004\b\005\000\000\000\000\000\000\000\000\002\\\000\000\000\000\002]\000\000\002\\\000\240\000\000\002]\002`\000\000\000\000\000\000\000\000\002`\000\000\000\000\000\240\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\\\000\000\000\000\002]\000\000\000\000\000\000\000\000\000\000\002`\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002a\000\000\000\000\000\000\000\000\002a\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002a"))
  
  and semantic_action =
    [|
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) = let _1 = 
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 1767 "src/reason-parser/reason_parser.ml"
         in
        
# 3737 "src/reason-parser/reason_parser.mly"
                                                       ( ([_1], Closed) )
# 1772 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _2_inlined1 : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2_inlined1 in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) = let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 1820 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3738 "src/reason-parser/reason_parser.mly"
                                                       ( ([_1], Closed) )
# 1826 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _2_inlined1 : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2_inlined1 in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) = let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 1888 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3739 "src/reason-parser/reason_parser.mly"
                                                       ( ([_1], Open)   )
# 1894 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _2_inlined1 : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2_inlined1 in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) = let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 1951 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3741 "src/reason-parser/reason_parser.mly"
    ( let (fields, closed) = _3 in _1 :: fields, closed )
# 1957 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4643 "src/reason-parser/reason_parser.mly"
                  ( "+"  )
# 1982 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4644 "src/reason-parser/reason_parser.mly"
                  ( "+." )
# 2007 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 2044 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1908 "src/reason-parser/reason_parser.mly"
  ( let (ident, binding, virt, params) = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Ci.mk ident binding ~virt ~params ~attrs:_1 ~loc
  )
# 2058 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 2103 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 2108 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1908 "src/reason-parser/reason_parser.mly"
  ( let (ident, binding, virt, params) = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Ci.mk ident binding ~virt ~params ~attrs:_1 ~loc
  )
# 2122 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 2159 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2315 "src/reason-parser/reason_parser.mly"
  ( let (ident, binding, virt, params) = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Ci.mk ident binding ~virt ~params ~attrs:_1 ~loc
  )
# 2173 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 2218 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 2223 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2315 "src/reason-parser/reason_parser.mly"
  ( let (ident, binding, virt, params) = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Ci.mk ident binding ~virt ~params ~attrs:_1 ~loc
  )
# 2237 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 2274 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2345 "src/reason-parser/reason_parser.mly"
  ( let (ident, instance_type, virt, params) = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Ci.mk ident instance_type ~virt ~params ~attrs:_1 ~loc
  )
# 2288 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 2333 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 2338 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2345 "src/reason-parser/reason_parser.mly"
  ( let (ident, instance_type, virt, params) = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Ci.mk ident instance_type ~virt ~params ~attrs:_1 ~loc
  )
# 2352 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _4 in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 2386 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_binding) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 2398 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 2404 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1679 "src/reason-parser/reason_parser.mly"
  ( Mb.mk _3 _4 ~attrs:_1 ~loc:(mklocation _symbolstartpos _endpos) )
# 2415 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _4 in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 2455 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_binding) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 2468 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 2475 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 2480 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1679 "src/reason-parser/reason_parser.mly"
  ( Mb.mk _3 _4 ~attrs:_1 ~loc:(mklocation _symbolstartpos _endpos) )
# 2491 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _4 in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 2525 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_declaration) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 2537 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 2543 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1901 "src/reason-parser/reason_parser.mly"
  ( Md.mk _3 _4 ~attrs:_1 ~loc:(mklocation _symbolstartpos _endpos) )
# 2554 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _4 in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 2594 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_declaration) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 2607 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 2614 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 2619 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1901 "src/reason-parser/reason_parser.mly"
  ( Md.mk _3 _4 ~attrs:_1 ~loc:(mklocation _symbolstartpos _endpos) )
# 2630 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = 
# 3800 "src/reason-parser/reason_parser.mly"
    ( [] )
# 2648 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : ((Migrate_parsetree.Ast_404.Ast_helper.str *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Asttypes.variance)
   list *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
   list * Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  Lexing.position * Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 2689 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3802 "src/reason-parser/reason_parser.mly"
    ( let (ident, params, cstrs, kind, priv, manifest), endpos, and_types = _3 in
      let loc = mklocation _symbolstartpos endpos in
      Type.mk ident ~params ~cstrs ~kind ~priv ?manifest ~attrs:_1 ~loc
      :: and_types
    )
# 2703 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : ((Migrate_parsetree.Ast_404.Ast_helper.str *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Asttypes.variance)
   list *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
   list * Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  Lexing.position * Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 2752 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 2757 "src/reason-parser/reason_parser.ml"
          
        in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3802 "src/reason-parser/reason_parser.mly"
    ( let (ident, params, cstrs, kind, priv, manifest), endpos, and_types = _3 in
      let loc = mklocation _symbolstartpos endpos in
      Type.mk ident ~params ~cstrs ~kind ~priv ?manifest ~attrs:_1 ~loc
      :: and_types
    )
# 2771 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4234 "src/reason-parser/reason_parser.mly"
                    ( (Nolabel, _1) )
# 2797 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 2838 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4236 "src/reason-parser/reason_parser.mly"
    ( (Labelled _2, _4) )
# 2848 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4237 "src/reason-parser/reason_parser.mly"
                                           ( _1 )
# 2875 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) = let _2 =
          let _1 = _1_inlined1 in
          let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 2929 "src/reason-parser/reason_parser.ml"
           in
          
# 4253 "src/reason-parser/reason_parser.mly"
                                                                             (_1)
# 2934 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4256 "src/reason-parser/reason_parser.mly"
                                                 ( _2 )
# 2940 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4221 "src/reason-parser/reason_parser.mly"
    ( List.fold_right mktyp_arrow _2 _4 )
# 2989 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 3032 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4223 "src/reason-parser/reason_parser.mly"
    ( mktyp_arrow (_1, false) _3 )
# 3038 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4225 "src/reason-parser/reason_parser.mly"
    ( mktyp (Ptyp_arrow (Nolabel, _1, _3)) )
# 3077 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (string) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (string Location.loc) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 3105 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4702 "src/reason-parser/reason_parser.mly"
                           ( _1 )
# 3111 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string Location.loc) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (string) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (string Location.loc) = let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4703 "src/reason-parser/reason_parser.mly"
                               ( mkloc (_1 ^ "." ^ _3.txt) (mklocation _symbolstartpos _endpos) )
# 3152 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.payload) = Obj.magic _3 in
        let _2 : (string Location.loc) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = 
# 4707 "src/reason-parser/reason_parser.mly"
                                        ( (_2, _3) )
# 3198 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1176 "src/reason-parser/reason_parser.mly"
       (string)
# 3219 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = let _endpos = _endpos__1_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4708 "src/reason-parser/reason_parser.mly"
              ( doc_attr _1 (mklocation _symbolstartpos _endpos) )
# 3229 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = 
# 4012 "src/reason-parser/reason_parser.mly"
                                     ( _1 :: _2 )
# 3261 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = 
# 4013 "src/reason-parser/reason_parser.mly"
                                   ( _1 )
# 3286 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = 
# 4012 "src/reason-parser/reason_parser.mly"
                                     ( _1 :: _2 )
# 3318 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = 
# 4013 "src/reason-parser/reason_parser.mly"
                                   ( _1 )
# 3343 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 3375 "src/reason-parser/reason_parser.ml"
         in
        
# 3909 "src/reason-parser/reason_parser.mly"
  ( {_3 with pcd_attributes = _1 @ _3.pcd_attributes} )
# 3380 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 3420 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 3425 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3909 "src/reason-parser/reason_parser.mly"
  ( {_3 with pcd_attributes = _1 @ _3.pcd_attributes} )
# 3431 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.row_field) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 3463 "src/reason-parser/reason_parser.ml"
         in
        
# 4408 "src/reason-parser/reason_parser.mly"
  ( match _3 with
    | Rtag (name, attrs, amp, typs) ->
        Rtag (name, _1 @ attrs, amp, typs)
    | Rinherit typ ->
        Rinherit {typ with ptyp_attributes = _1 @ typ.ptyp_attributes}
  )
# 3473 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.row_field) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 3513 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 3518 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4408 "src/reason-parser/reason_parser.mly"
  ( match _3 with
    | Rtag (name, attrs, amp, typs) ->
        Rtag (name, _1 @ attrs, amp, typs)
    | Rinherit typ ->
        Rinherit {typ with ptyp_attributes = _1 @ typ.ptyp_attributes}
  )
# 3529 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.lid) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4324 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_constr(_1, _2)) )
# 3562 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3570 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3576 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _3 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 3620 "src/reason-parser/reason_parser.ml"
              
            in
            
# 4326 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_class(_2, _3)) )
# 3626 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3635 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3641 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4328 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_var _2) )
# 3674 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3682 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3688 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 3725 "src/reason-parser/reason_parser.ml"
              
            in
            
# 4330 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_class(_2, [])) )
# 3731 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3740 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3746 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4332 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_any) )
# 3772 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3780 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3786 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.lid) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4334 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_constr(_1, [])) )
# 3812 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3820 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3826 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4336 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 3852 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3860 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3866 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4338 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_variant (_2, Closed, None)) )
# 3906 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3914 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3920 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4340 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_variant (_2, Open, None)) )
# 3960 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 3968 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 3974 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (string list) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4342 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_variant (_2, Closed, Some _3)) )
# 4021 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 4029 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 4035 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4344 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_extension _1) )
# 4061 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 4069 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4345 "src/reason-parser/reason_parser.mly"
    (_1)
# 4075 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (bool) = 
# 133 "<standard.mly>"
    ( false )
# 4093 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (bool) = 
# 135 "<standard.mly>"
    ( true )
# 4118 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2388 "src/reason-parser/reason_parser.mly"
    ( add_brace_attr _2 )
# 4158 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 4166 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2407 "src/reason-parser/reason_parser.mly"
  (_1)
# 4172 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2390 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      syntax_error_exp loc
        "Record construction must have at least one field explicitly set" )
# 4231 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 4240 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2407 "src/reason-parser/reason_parser.mly"
  (_1)
# 4246 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2394 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos__4_ _endpos__4_ in
      raise_record_trailing_semi_error loc )
# 4301 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 4309 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2407 "src/reason-parser/reason_parser.mly"
  (_1)
# 4315 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2397 "src/reason-parser/reason_parser.mly"
    ( mk_record_expr _2 )
# 4357 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 4365 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2407 "src/reason-parser/reason_parser.mly"
  (_1)
# 4371 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _endpos = _endpos__3_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2399 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let (exten, fields) = _2 in
      mkexp ~loc (Pexp_extension (mkloc ("bs.obj") loc,
             PStr [mkstrexp (mkexp ~loc (Pexp_record(fields, exten))) []]))
    )
# 4420 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 4429 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2407 "src/reason-parser/reason_parser.mly"
  (_1)
# 4435 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_structure) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2406 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_object _2) )
# 4475 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 4483 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2407 "src/reason-parser/reason_parser.mly"
  (_1)
# 4489 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = 
# 2221 "src/reason-parser/reason_parser.mly"
                        ( _1 )
# 4514 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = 
# 2223 "src/reason-parser/reason_parser.mly"
    ( List.fold_right mkcty_arrow _1 _3 )
# 4556 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_type option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _endpos = _endpos__2_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1931 "src/reason-parser/reason_parser.mly"
  ( match _1 with
    | None -> _2
    | Some ct -> Cl.constraint_ ~loc:(mklocation _symbolstartpos _endpos) _2 ct
  )
# 4596 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 4630 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 = 
# 124 "<standard.mly>"
    ( None )
# 4644 "src/reason-parser/reason_parser.ml"
         in
        let _3 = 
# 124 "<standard.mly>"
    ( None )
# 4649 "src/reason-parser/reason_parser.ml"
         in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 4657 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 4671 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 4719 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 =
          let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
          let x =
            let _endpos = _endpos__2_ in
            let _startpos = _startpos__1_ in
            
# 2538 "src/reason-parser/reason_parser.mly"
                  (
    let loc = mklocation _startpos _endpos in
    ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], false)
  )
# 4741 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 4747 "src/reason-parser/reason_parser.ml"
          
        in
        let _3 = 
# 124 "<standard.mly>"
    ( None )
# 4753 "src/reason-parser/reason_parser.ml"
         in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 4761 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 4775 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = x;
                    MenhirLib.EngineTypes.startp = _startpos_x_;
                    MenhirLib.EngineTypes.endp = _endpos_x_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined2 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 4837 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let x =
            let _1 =
              let _1 =
                let x =
                  let _1 = _1_inlined1 in
                  let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 4858 "src/reason-parser/reason_parser.ml"
                   in
                  
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 4863 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 200 "<standard.mly>"
    ( x )
# 4869 "src/reason-parser/reason_parser.ml"
                
              in
              
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 4875 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2542 "src/reason-parser/reason_parser.mly"
                                               (
    (_1, false)
  )
# 4883 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 4889 "src/reason-parser/reason_parser.ml"
          
        in
        let _3 = 
# 124 "<standard.mly>"
    ( None )
# 4895 "src/reason-parser/reason_parser.ml"
         in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 4903 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 4917 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 4972 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 =
          let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
          let x =
            let _endpos = _endpos__3_ in
            let _startpos = _startpos__1_ in
            
# 2545 "src/reason-parser/reason_parser.mly"
                      (
      let loc = mklocation _startpos _endpos in
      ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], true)
  )
# 4994 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5000 "src/reason-parser/reason_parser.ml"
          
        in
        let _3 = 
# 124 "<standard.mly>"
    ( None )
# 5006 "src/reason-parser/reason_parser.ml"
         in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 5014 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 5028 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = x;
                      MenhirLib.EngineTypes.startp = _startpos_x_;
                      MenhirLib.EngineTypes.endp = _endpos_x_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _2_inlined1 : (unit option) = Obj.magic _2_inlined1 in
        let _1_inlined2 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined2 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 5097 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let x =
            let _3 =
              let (_2, _1) = (_2_inlined1, _1_inlined1) in
              let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 5116 "src/reason-parser/reason_parser.ml"
               in
              
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 5121 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2549 "src/reason-parser/reason_parser.mly"
                                                  (
      let patterns = List.map (fun p ->
          match p.txt with

          | Term (Optional _, x, y)  ->
            syntax_error p.loc "Uncurried function definition with labelled \
                                arguments is not supported at the moment.";
            {p with txt = Term (Nolabel, x, y)}
          | _ -> p
        ) _3
      in
      (patterns, true)
  )
# 5139 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5145 "src/reason-parser/reason_parser.ml"
          
        in
        let _3 = 
# 124 "<standard.mly>"
    ( None )
# 5151 "src/reason-parser/reason_parser.ml"
         in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 5159 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 5173 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = x;
                    MenhirLib.EngineTypes.startp = _startpos_x_;
                    MenhirLib.EngineTypes.endp = _endpos_x_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined2 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 5237 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 = 
# 124 "<standard.mly>"
    ( None )
# 5251 "src/reason-parser/reason_parser.ml"
         in
        let _3 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let x =
            let _1 =
              let _1 =
                let x =
                  let _1 = _1_inlined1 in
                  let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 5263 "src/reason-parser/reason_parser.ml"
                   in
                  
# 2322 "src/reason-parser/reason_parser.mly"
                                                             (_1)
# 5268 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 200 "<standard.mly>"
    ( x )
# 5274 "src/reason-parser/reason_parser.ml"
                
              in
              
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 5280 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2326 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 5286 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5292 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 5301 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 5315 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined3;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined3_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined2;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = x;
                        MenhirLib.EngineTypes.startp = _startpos_x_;
                        MenhirLib.EngineTypes.endp = _endpos_x_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _menhir_s;
                          MenhirLib.EngineTypes.semv = _1;
                          MenhirLib.EngineTypes.startp = _startpos__1_;
                          MenhirLib.EngineTypes.endp = _endpos__1_;
                          MenhirLib.EngineTypes.next = _menhir_stack;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1_inlined3 : unit = Obj.magic _1_inlined3 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined2 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 5393 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 =
          let (_endpos__2_, _startpos__1_, _2, _1) = (_endpos__2_inlined1_, _startpos__1_inlined3_, _2_inlined1, _1_inlined3) in
          let x =
            let _endpos = _endpos__2_ in
            let _startpos = _startpos__1_ in
            
# 2538 "src/reason-parser/reason_parser.mly"
                  (
    let loc = mklocation _startpos _endpos in
    ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], false)
  )
# 5415 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5421 "src/reason-parser/reason_parser.ml"
          
        in
        let _3 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let x =
            let _1 =
              let _1 =
                let x =
                  let _1 = _1_inlined1 in
                  let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 5434 "src/reason-parser/reason_parser.ml"
                   in
                  
# 2322 "src/reason-parser/reason_parser.mly"
                                                             (_1)
# 5439 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 200 "<standard.mly>"
    ( x )
# 5445 "src/reason-parser/reason_parser.ml"
                
              in
              
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 5451 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2326 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 5457 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5463 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 5472 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 5486 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined4;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined4_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined3;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined3_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _1_inlined2;
                        MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                        MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = _1_inlined1;
                          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _;
                            MenhirLib.EngineTypes.semv = x;
                            MenhirLib.EngineTypes.startp = _startpos_x_;
                            MenhirLib.EngineTypes.endp = _endpos_x_;
                            MenhirLib.EngineTypes.next = {
                              MenhirLib.EngineTypes.state = _menhir_s;
                              MenhirLib.EngineTypes.semv = _1;
                              MenhirLib.EngineTypes.startp = _startpos__1_;
                              MenhirLib.EngineTypes.endp = _endpos__1_;
                              MenhirLib.EngineTypes.next = _menhir_stack;
                            };
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _2_inlined1 : (unit option) = Obj.magic _2_inlined1 in
        let _1_inlined4 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined4 in
        let _1_inlined3 : unit = Obj.magic _1_inlined3 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined2 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 5578 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 =
          let (_3, _2, _1_inlined1, _1) = (_3_inlined1, _2_inlined1, _1_inlined4, _1_inlined3) in
          let x =
            let _1 =
              let _1 =
                let x =
                  let _1 = _1_inlined1 in
                  let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 5599 "src/reason-parser/reason_parser.ml"
                   in
                  
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 5604 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 200 "<standard.mly>"
    ( x )
# 5610 "src/reason-parser/reason_parser.ml"
                
              in
              
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 5616 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2542 "src/reason-parser/reason_parser.mly"
                                               (
    (_1, false)
  )
# 5624 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5630 "src/reason-parser/reason_parser.ml"
          
        in
        let _3 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let x =
            let _1 =
              let _1 =
                let x =
                  let _1 = _1_inlined1 in
                  let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 5643 "src/reason-parser/reason_parser.ml"
                   in
                  
# 2322 "src/reason-parser/reason_parser.mly"
                                                             (_1)
# 5648 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 200 "<standard.mly>"
    ( x )
# 5654 "src/reason-parser/reason_parser.ml"
                
              in
              
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 5660 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2326 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 5666 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5672 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 5681 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 5695 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined3;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined3_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined2;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _1_inlined1;
                        MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = x;
                          MenhirLib.EngineTypes.startp = _startpos_x_;
                          MenhirLib.EngineTypes.endp = _endpos_x_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _menhir_s;
                            MenhirLib.EngineTypes.semv = _1;
                            MenhirLib.EngineTypes.startp = _startpos__1_;
                            MenhirLib.EngineTypes.endp = _endpos__1_;
                            MenhirLib.EngineTypes.next = _menhir_stack;
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1_inlined3 : unit = Obj.magic _1_inlined3 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined2 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 5780 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 =
          let (_endpos__3_, _startpos__1_, _3, _2, _1) = (_endpos__3_inlined1_, _startpos__1_inlined3_, _3_inlined1, _2_inlined1, _1_inlined3) in
          let x =
            let _endpos = _endpos__3_ in
            let _startpos = _startpos__1_ in
            
# 2545 "src/reason-parser/reason_parser.mly"
                      (
      let loc = mklocation _startpos _endpos in
      ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], true)
  )
# 5802 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5808 "src/reason-parser/reason_parser.ml"
          
        in
        let _3 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let x =
            let _1 =
              let _1 =
                let x =
                  let _1 = _1_inlined1 in
                  let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 5821 "src/reason-parser/reason_parser.ml"
                   in
                  
# 2322 "src/reason-parser/reason_parser.mly"
                                                             (_1)
# 5826 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 200 "<standard.mly>"
    ( x )
# 5832 "src/reason-parser/reason_parser.ml"
                
              in
              
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 5838 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2326 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 5844 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 5850 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 5859 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 5873 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined2;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined2_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined4;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined4_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined3;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined3_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _3;
                      MenhirLib.EngineTypes.startp = _startpos__3_;
                      MenhirLib.EngineTypes.endp = _endpos__3_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _2;
                        MenhirLib.EngineTypes.startp = _startpos__2_;
                        MenhirLib.EngineTypes.endp = _endpos__2_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = _1_inlined2;
                          MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                          MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _;
                            MenhirLib.EngineTypes.semv = _1_inlined1;
                            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                            MenhirLib.EngineTypes.next = {
                              MenhirLib.EngineTypes.state = _;
                              MenhirLib.EngineTypes.semv = x;
                              MenhirLib.EngineTypes.startp = _startpos_x_;
                              MenhirLib.EngineTypes.endp = _endpos_x_;
                              MenhirLib.EngineTypes.next = {
                                MenhirLib.EngineTypes.state = _menhir_s;
                                MenhirLib.EngineTypes.semv = _1;
                                MenhirLib.EngineTypes.startp = _startpos__1_;
                                MenhirLib.EngineTypes.endp = _endpos__1_;
                                MenhirLib.EngineTypes.next = _menhir_stack;
                              };
                            };
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _2_inlined2 : (unit option) = Obj.magic _2_inlined2 in
        let _1_inlined4 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined4 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1_inlined3 : unit = Obj.magic _1_inlined3 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined2 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 5972 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _4 =
          let (_2_inlined1, _1_inlined1, _2, _1) = (_2_inlined2, _1_inlined4, _2_inlined1, _1_inlined3) in
          let x =
            let _3 =
              let (_2, _1) = (_2_inlined1, _1_inlined1) in
              let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 5991 "src/reason-parser/reason_parser.ml"
               in
              
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 5996 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2549 "src/reason-parser/reason_parser.mly"
                                                  (
      let patterns = List.map (fun p ->
          match p.txt with

          | Term (Optional _, x, y)  ->
            syntax_error p.loc "Uncurried function definition with labelled \
                                arguments is not supported at the moment.";
            {p with txt = Term (Nolabel, x, y)}
          | _ -> p
        ) _3
      in
      (patterns, true)
  )
# 6014 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 6020 "src/reason-parser/reason_parser.ml"
          
        in
        let _3 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let x =
            let _1 =
              let _1 =
                let x =
                  let _1 = _1_inlined1 in
                  let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 6033 "src/reason-parser/reason_parser.ml"
                   in
                  
# 2322 "src/reason-parser/reason_parser.mly"
                                                             (_1)
# 6038 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 200 "<standard.mly>"
    ( x )
# 6044 "src/reason-parser/reason_parser.ml"
                
              in
              
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 6050 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2326 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 6056 "src/reason-parser/reason_parser.ml"
            
          in
          
# 126 "<standard.mly>"
    ( Some x )
# 6062 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 6071 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1917 "src/reason-parser/reason_parser.mly"
  (
    let tree = match _4 with
    | None -> []
    | Some (lpl, _uncurried) -> lpl
    in
    let body = List.fold_right mkclass_fun tree _5 in
    let params = match _3 with None -> [] | Some x -> x in
    (_2, body, _1, params)
  )
# 6085 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 6135 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 6152 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2331 "src/reason-parser/reason_parser.mly"
  ( (_2, _5, _1, _3) )
# 6158 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 6202 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2307 "src/reason-parser/reason_parser.mly"
  ( let (ident, binding, virt, params) = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    (Ci.mk ident binding ~virt ~params ~attrs:_1 ~loc :: _4)
  )
# 6216 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 6268 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 6273 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2307 "src/reason-parser/reason_parser.mly"
  ( let (ident, binding, virt, params) = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    (Ci.mk ident binding ~virt ~params ~attrs:_1 ~loc :: _4)
  )
# 6287 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 1969 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 6313 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6321 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6327 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x =
            let _2 =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _endpos = _endpos__2_ in
              let _startpos = _startpos__1_ in
              
# 2538 "src/reason-parser/reason_parser.mly"
                  (
    let loc = mklocation _startpos _endpos in
    ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], false)
  )
# 6389 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1971 "src/reason-parser/reason_parser.mly"
    ( let (lp, _) = _2 in
      List.fold_right mkclass_fun lp _4 )
# 6396 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6405 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6411 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined2;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined2 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x =
            let _2 =
              let (_3, _1_inlined1, _1) = (_3_inlined1, _1_inlined2, _1_inlined1) in
              let _1 =
                let _1 =
                  let x =
                    let _1 = _1_inlined1 in
                    let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 6486 "src/reason-parser/reason_parser.ml"
                     in
                    
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 6491 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 200 "<standard.mly>"
    ( x )
# 6497 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 6503 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2542 "src/reason-parser/reason_parser.mly"
                                               (
    (_1, false)
  )
# 6511 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1971 "src/reason-parser/reason_parser.mly"
    ( let (lp, _) = _2 in
      List.fold_right mkclass_fun lp _4 )
# 6518 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6527 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6533 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x =
            let _2 =
              let (_endpos__3_, _startpos__1_, _3, _1) = (_endpos__3_inlined1_, _startpos__1_inlined1_, _3_inlined1, _1_inlined1) in
              let _endpos = _endpos__3_ in
              let _startpos = _startpos__1_ in
              
# 2545 "src/reason-parser/reason_parser.mly"
                      (
      let loc = mklocation _startpos _endpos in
      ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], true)
  )
# 6602 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1971 "src/reason-parser/reason_parser.mly"
    ( let (lp, _) = _2 in
      List.fold_right mkclass_fun lp _4 )
# 6609 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6618 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6624 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__4_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__4_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined2;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _4_inlined1 : unit = Obj.magic _4_inlined1 in
        let _2_inlined1 : (unit option) = Obj.magic _2_inlined1 in
        let _1_inlined2 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined2 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x =
            let _2 =
              let (_4, _1_inlined1, _1) = (_4_inlined1, _1_inlined2, _1_inlined1) in
              let _3 =
                let (_2, _1) = (_2_inlined1, _1_inlined1) in
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 6704 "src/reason-parser/reason_parser.ml"
                 in
                
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 6709 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2549 "src/reason-parser/reason_parser.mly"
                                                  (
      let patterns = List.map (fun p ->
          match p.txt with

          | Term (Optional _, x, y)  ->
            syntax_error p.loc "Uncurried function definition with labelled \
                                arguments is not supported at the moment.";
            {p with txt = Term (Nolabel, x, y)}
          | _ -> p
        ) _3
      in
      (patterns, true)
  )
# 6727 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1971 "src/reason-parser/reason_parser.mly"
    ( let (lp, _) = _2 in
      List.fold_right mkclass_fun lp _4 )
# 6734 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6743 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6749 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 1981 "src/reason-parser/reason_parser.mly"
    ( mkclass(Pcl_apply(_1, _2)) )
# 6784 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6792 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6798 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 1983 "src/reason-parser/reason_parser.mly"
    ( {_2 with pcl_attributes = _1 :: _2.pcl_attributes} )
# 6831 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6839 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6845 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _3 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 6889 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1997 "src/reason-parser/reason_parser.mly"
    ( mkclass(Pcl_constr(_2, _3)) )
# 6895 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6904 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6910 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 1999 "src/reason-parser/reason_parser.mly"
    ( mkclass(Pcl_extension _1) )
# 6936 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6944 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2000 "src/reason-parser/reason_parser.mly"
    (_1)
# 6950 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 1939 "src/reason-parser/reason_parser.mly"
               ( _1 )
# 6976 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = if _startpos_x_ != _endpos_x_ then
            _startpos_x_
          else
            _endpos in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 6987 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1943 "src/reason-parser/reason_parser.mly"
    (_1)
# 6993 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Reason_parser_def.let_bindings) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 1941 "src/reason-parser/reason_parser.mly"
    ( class_of_let_bindings _1 _3 )
# 7033 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = if _startpos_x_ != _endpos_x_ then
            _startpos_x_
          else
            _endpos in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7044 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1943 "src/reason-parser/reason_parser.mly"
    (_1)
# 7050 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_structure) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 1942 "src/reason-parser/reason_parser.mly"
                ( mkclass (Pcl_structure _1) )
# 7076 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = if _startpos_x_ != _endpos_x_ then
            _startpos_x_
          else
            _endpos in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7087 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1943 "src/reason-parser/reason_parser.mly"
    (_1)
# 7093 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _5 : (string option) = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 7141 "src/reason-parser/reason_parser.ml"
             in
            
# 2019 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_inherit (_3, _4, _5)) _1 )
# 7146 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7155 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7161 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (string option) = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 7217 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 7222 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2019 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_inherit (_3, _4, _5)) _1 )
# 7228 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7237 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7243 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 7278 "src/reason-parser/reason_parser.ml"
             in
            
# 2021 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_val _3) _1 )
# 7283 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7292 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7298 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 7341 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 7346 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2021 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_val _3) _1 )
# 7352 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7361 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7367 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 7401 "src/reason-parser/reason_parser.ml"
             in
            
# 2023 "src/reason-parser/reason_parser.mly"
      ( let (a, b) = _3 in mkcf_attrs (Pcf_method (a, _2, b)) _1 )
# 7406 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7415 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7421 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 7463 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 7468 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2023 "src/reason-parser/reason_parser.mly"
      ( let (a, b) = _3 in mkcf_attrs (Pcf_method (a, _2, b)) _1 )
# 7474 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7483 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7489 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 7524 "src/reason-parser/reason_parser.ml"
             in
            
# 2025 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_constraint _3) _1 )
# 7529 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7538 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7544 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 7587 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 7592 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2025 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_constraint _3) _1 )
# 7598 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7607 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7613 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _3 =
              let x =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 7654 "src/reason-parser/reason_parser.ml"
                
              in
              let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7663 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 7669 "src/reason-parser/reason_parser.ml"
             in
            
# 2027 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_initializer _3) _1 )
# 7674 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7683 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7689 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _3 =
              let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
              let x =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 7738 "src/reason-parser/reason_parser.ml"
                
              in
              let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7747 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 7754 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 7759 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2027 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_initializer _3) _1 )
# 7765 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7774 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7780 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 7807 "src/reason-parser/reason_parser.ml"
             in
            
# 2029 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_extension _2) _1 )
# 7812 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7821 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7827 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 7862 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 7867 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2029 "src/reason-parser/reason_parser.mly"
      ( mkcf_attrs (Pcf_extension _2) _1 )
# 7873 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4801 "src/reason-parser/reason_parser.mly"
   ( {x with pcf_loc = {x.pcf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7882 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2030 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 7888 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 7913 "src/reason-parser/reason_parser.ml"
         in
        
# 2032 "src/reason-parser/reason_parser.mly"
    ( List.map (fun x -> mkcf ~loc:x.loc (Pcf_attribute x.txt)) _1 )
# 7918 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 7955 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2234 "src/reason-parser/reason_parser.mly"
    ( mkcty (Pcty_constr (_1, _2)) )
# 7961 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__2_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4773 "src/reason-parser/reason_parser.mly"
  ( {x with pcty_loc = {x.pcty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 7970 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2243 "src/reason-parser/reason_parser.mly"
    (_1)
# 7976 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = let _1 =
          let x = 
# 2238 "src/reason-parser/reason_parser.mly"
    ( {_2 with pcty_attributes = _1 :: _2.pcty_attributes} )
# 8009 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4773 "src/reason-parser/reason_parser.mly"
  ( {x with pcty_loc = {x.pcty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8017 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2243 "src/reason-parser/reason_parser.mly"
    (_1)
# 8023 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = let _1 =
          let x = 
# 2240 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 8049 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4773 "src/reason-parser/reason_parser.mly"
  ( {x with pcty_loc = {x.pcty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8057 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2243 "src/reason-parser/reason_parser.mly"
    (_1)
# 8063 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = let _1 =
          let x = 
# 2242 "src/reason-parser/reason_parser.mly"
    ( mkcty (Pcty_extension _1) )
# 8089 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4773 "src/reason-parser/reason_parser.mly"
  ( {x with pcty_loc = {x.pcty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8097 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2243 "src/reason-parser/reason_parser.mly"
    (_1)
# 8103 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 8124 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4569 "src/reason-parser/reason_parser.mly"
                                 ( Lident _1 )
# 8132 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 8165 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = 
# 4570 "src/reason-parser/reason_parser.mly"
                                 ( Ldot(_1, _3) )
# 8175 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = 
# 1964 "src/reason-parser/reason_parser.mly"
               ( _2 )
# 8207 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 2268 "src/reason-parser/reason_parser.mly"
                 ( _2 )
# 8239 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_signature) = 
# 2260 "src/reason-parser/reason_parser.mly"
  ( Csig.mk _1 [] )
# 8264 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_signature) = 
# 2262 "src/reason-parser/reason_parser.mly"
  ( Csig.mk _1 _3 )
# 8303 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_signature) = let _endpos = _endpos__1_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _endpos in
        
# 2264 "src/reason-parser/reason_parser.mly"
  ( Csig.mk (Typ.mk ~loc:(mklocation _symbolstartpos _endpos) Ptyp_any) _1 )
# 8333 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 = 
# 4837 "src/reason-parser/reason_parser.mly"
                ( [] )
# 8358 "src/reason-parser/reason_parser.ml"
         in
        
# 2256 "src/reason-parser/reason_parser.mly"
                                               ( List.concat _1 )
# 8363 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 8396 "src/reason-parser/reason_parser.ml"
           in
          
# 4838 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 8401 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2256 "src/reason-parser/reason_parser.mly"
                                               ( List.concat _1 )
# 8407 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 8441 "src/reason-parser/reason_parser.ml"
             in
            
# 2274 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_inherit _3) _1 )
# 8446 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8455 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 8461 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 8503 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 8508 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2274 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_inherit _3) _1 )
# 8514 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8523 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 8529 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (string * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 8565 "src/reason-parser/reason_parser.ml"
             in
            
# 2276 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_val _3) _1 )
# 8570 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8579 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 8585 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 8629 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 8634 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2276 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_val _3) _1 )
# 8640 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8649 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 8655 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 8702 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _4 = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 8714 "src/reason-parser/reason_parser.ml"
             in
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 8719 "src/reason-parser/reason_parser.ml"
             in
            
# 2278 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_method (_4, Private, _3, _6)) _1 )
# 8724 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8733 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 8739 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 8792 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _4 =
              let _1 = _1_inlined1 in
              
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 8807 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 8814 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 8819 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2278 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_method (_4, Private, _3, _6)) _1 )
# 8825 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8834 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 8840 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 8887 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _4 = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 8899 "src/reason-parser/reason_parser.ml"
             in
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 8904 "src/reason-parser/reason_parser.ml"
             in
            
# 2280 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_method (_4, Public, _3, _6)) _1 )
# 8909 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 8918 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 8924 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 8977 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _4 =
              let _1 = _1_inlined1 in
              
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 8992 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 8999 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 9004 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2280 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_method (_4, Public, _3, _6)) _1 )
# 9010 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9019 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 9025 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 9060 "src/reason-parser/reason_parser.ml"
             in
            
# 2282 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_constraint _3) _1 )
# 9065 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9074 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 9080 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 9123 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 9128 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2282 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_constraint _3) _1 )
# 9134 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9143 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 9149 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 9176 "src/reason-parser/reason_parser.ml"
             in
            
# 2284 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_extension _2) _1 )
# 9181 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9190 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 9196 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 9231 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 9236 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2284 "src/reason-parser/reason_parser.mly"
      ( mkctf_attrs (Pctf_extension _2) _1 )
# 9242 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4777 "src/reason-parser/reason_parser.mly"
  ( {x with pctf_loc = {x.pctf_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9251 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2285 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 9257 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 9282 "src/reason-parser/reason_parser.ml"
         in
        
# 2287 "src/reason-parser/reason_parser.mly"
    ( List.map (fun x -> mkctf ~loc:x.loc (Pctf_attribute x.txt)) _1 )
# 9287 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 9317 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2005 "src/reason-parser/reason_parser.mly"
    ( mkclass(Pcl_constr(_1, [])) )
# 9323 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9331 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2012 "src/reason-parser/reason_parser.mly"
    (_1)
# 9337 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x =
            let _1 = 
# 2014 "src/reason-parser/reason_parser.mly"
                                                                ( _2 )
# 9378 "src/reason-parser/reason_parser.ml"
             in
            
# 2007 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 9383 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9392 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2012 "src/reason-parser/reason_parser.mly"
    (_1)
# 9398 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 2009 "src/reason-parser/reason_parser.mly"
    ( mkclass(Pcl_constraint(_2, _4)) )
# 9452 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9460 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2012 "src/reason-parser/reason_parser.mly"
    (_1)
# 9466 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 =
          let x = 
# 2011 "src/reason-parser/reason_parser.mly"
    ( _2 )
# 9506 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4797 "src/reason-parser/reason_parser.mly"
  ( {x with pcl_loc = {x.pcl_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 9514 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2012 "src/reason-parser/reason_parser.mly"
    (_1)
# 9520 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 9552 "src/reason-parser/reason_parser.ml"
         in
        
# 2227 "src/reason-parser/reason_parser.mly"
                                                     (_1)
# 9557 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_signature) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 2247 "src/reason-parser/reason_parser.mly"
    ( mkcty ~loc:(mklocation _startpos _endpos) (Pcty_signature _2) )
# 9598 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.class_signature) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = let _endpos = _endpos__4_ in
        let _startpos = _startpos__1_ in
        
# 2249 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos _endpos in
      let ct = mkcty ~loc (Pcty_signature _3) in
      {ct with pcty_attributes = [uncurry_payload loc]}
    )
# 9649 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _4 in
        let _3 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 9692 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 9709 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2354 "src/reason-parser/reason_parser.mly"
  ( (_2, _4, _1, _3) )
# 9715 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 9766 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2337 "src/reason-parser/reason_parser.mly"
  ( let (ident, instance_type, virt, params) = _4 in
    let loc = mklocation _symbolstartpos _endpos in
    (Ci.mk ident instance_type ~virt ~params ~attrs:_1 ~loc :: _5)
  )
# 9780 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 9839 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 9844 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2337 "src/reason-parser/reason_parser.mly"
  ( let (ident, instance_type, virt, params) = _4 in
    let loc = mklocation _symbolstartpos _endpos in
    (Ci.mk ident instance_type ~virt ~params ~attrs:_1 ~loc :: _5)
  )
# 9858 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 9879 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4564 "src/reason-parser/reason_parser.mly"
                                 ( Lident _1 )
# 9887 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 9920 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = 
# 4565 "src/reason-parser/reason_parser.mly"
                                 ( Ldot(_1, _3) )
# 9930 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1102 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 9951 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4428 "src/reason-parser/reason_parser.mly"
                 ( let (n, m) = _1 in ([], Pconst_integer (n, m)) )
# 9960 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1060 "src/reason-parser/reason_parser.mly"
       (char)
# 9981 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4429 "src/reason-parser/reason_parser.mly"
                 ( ([], Pconst_char _1) )
# 9990 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1081 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 10011 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4430 "src/reason-parser/reason_parser.mly"
                 ( let (f, m) = _1 in ([], Pconst_float (f, m)) )
# 10020 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 10041 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4431 "src/reason-parser/reason_parser.mly"
                 (
    let (s, raw, d) = _1 in
    let attr = match raw with
      | None -> []
      | Some raw ->
        let constant = Ast_helper.Exp.constant (Pconst_string (raw, None)) in
        [Location.mknoloc "reason.raw_literal", PStr [mkstrexp constant []]]
    in
    (attr, Pconst_string (s, d))
  )
# 10059 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4515 "src/reason-parser/reason_parser.mly"
                                  ( _1 )
# 10084 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Longident.t) = 
# 4516 "src/reason-parser/reason_parser.mly"
                                  ( Lident "[]" )
# 10116 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Longident.t) = 
# 4517 "src/reason-parser/reason_parser.mly"
                                  ( Lident "()" )
# 10148 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4518 "src/reason-parser/reason_parser.mly"
                                  ( Lident "false" )
# 10173 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4519 "src/reason-parser/reason_parser.mly"
                                  ( Lident "true" )
# 10198 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t) = let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2297 "src/reason-parser/reason_parser.mly"
  ( (_1, _3, mklocation _symbolstartpos _endpos) )
# 10240 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 2302 "src/reason-parser/reason_parser.mly"
  ( (_1, _3) )
# 10280 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments) = 
# 3942 "src/reason-parser/reason_parser.mly"
                       ( Pcstr_tuple [_1] )
# 10305 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments) = 
# 3946 "src/reason-parser/reason_parser.mly"
                       ( Pcstr_record _1 )
# 10330 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let x : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments) = let _1 =
          let _1 = 
# 200 "<standard.mly>"
    ( x )
# 10370 "src/reason-parser/reason_parser.ml"
           in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 10375 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3947 "src/reason-parser/reason_parser.mly"
                                      ( Pcstr_record _1 )
# 10381 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments) = let _1 =
          let _1 = 
# 200 "<standard.mly>"
    ( x )
# 10421 "src/reason-parser/reason_parser.ml"
           in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 10426 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3949 "src/reason-parser/reason_parser.mly"
    ( Pcstr_tuple _1 )
# 10432 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 10464 "src/reason-parser/reason_parser.ml"
         in
        
# 3938 "src/reason-parser/reason_parser.mly"
                                                    (_1)
# 10469 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 10498 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let x = 
# 4500 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 10507 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 10515 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 10522 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 10535 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let x = 
# 4501 "src/reason-parser/reason_parser.mly"
                      ( "[]" )
# 10576 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 10584 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 10591 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 10604 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let x = 
# 4502 "src/reason-parser/reason_parser.mly"
                      ( "()" )
# 10645 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 10653 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 10660 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 10673 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let x = 
# 4503 "src/reason-parser/reason_parser.mly"
                      ( "::" )
# 10707 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 10715 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 10722 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 10735 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let x = 
# 4505 "src/reason-parser/reason_parser.mly"
                      ( "false" )
# 10769 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 10777 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 10784 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 10797 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let x = 
# 4506 "src/reason-parser/reason_parser.mly"
                      ( "true" )
# 10831 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 10839 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 10846 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 10859 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1_inlined1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 10894 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4500 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 10905 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 10913 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 10921 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 10926 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 10939 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4501 "src/reason-parser/reason_parser.mly"
                      ( "[]" )
# 10988 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 10996 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 11004 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 11009 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 11022 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4502 "src/reason-parser/reason_parser.mly"
                      ( "()" )
# 11071 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 11079 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 11087 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 11092 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 11105 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4503 "src/reason-parser/reason_parser.mly"
                      ( "::" )
# 11147 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 11155 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 11163 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 11168 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 11181 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4505 "src/reason-parser/reason_parser.mly"
                      ( "false" )
# 11223 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 11231 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 11239 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 11244 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 11257 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4506 "src/reason-parser/reason_parser.mly"
                      ( "true" )
# 11299 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 11307 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 11315 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 11320 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3914 "src/reason-parser/reason_parser.mly"
  ( let args, res = _3 in
    let loc = mklocation _symbolstartpos _endpos in
    Type.constructor ~attrs:_1 _2 ~args ?res ~loc )
# 11333 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = 
# 3893 "src/reason-parser/reason_parser.mly"
  ( let (cstrs, constraints, endpos, and_types) = _2 in
    (_1 :: cstrs, constraints, endpos, and_types)
  )
# 11375 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = 
# 3900 "src/reason-parser/reason_parser.mly"
    ( let (cstrs, constraints, endpos, and_types) = _2 in
      (_1 :: cstrs, constraints, endpos, and_types)
    )
# 11417 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _1 = 
# 3832 "src/reason-parser/reason_parser.mly"
    ( [] )
# 11446 "src/reason-parser/reason_parser.ml"
         in
        let _endpos__1_ = _endpos__0_ in
        
# 3904 "src/reason-parser/reason_parser.mly"
    ( ([], _1, _endpos__1_, _2) )
# 11452 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _2 in
        let _1 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _1 = 
# 3833 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 11490 "src/reason-parser/reason_parser.ml"
         in
        
# 3904 "src/reason-parser/reason_parser.mly"
    ( ([], _1, _endpos__1_, _2) )
# 11495 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4186 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 11521 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 11529 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4189 "src/reason-parser/reason_parser.mly"
    (_1)
# 11535 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (string) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4188 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_alias(_1, _4)) )
# 11582 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 11590 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4189 "src/reason-parser/reason_parser.mly"
    (_1)
# 11596 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = ct;
          MenhirLib.EngineTypes.startp = _startpos_ct_;
          MenhirLib.EngineTypes.endp = _endpos_ct_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let ct : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic ct in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_ct_ in
        let _endpos = _endpos_ct_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 11621 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos_ct_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos_ct_ in
        
# 4202 "src/reason-parser/reason_parser.mly"
  ( match _1 with
    | [] -> ct
    | attrs ->
      let loc_start = _symbolstartpos and loc_end = _endpos in
      let ptyp_loc = {ct.ptyp_loc with loc_start; loc_end} in
      let ptyp_attributes = attrs @ ct.ptyp_attributes in
      {ct with ptyp_attributes; ptyp_loc}
  )
# 11639 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = ct;
          MenhirLib.EngineTypes.startp = _startpos_ct_;
          MenhirLib.EngineTypes.endp = _endpos_ct_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let ct : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic ct in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_ct_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 11672 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 11677 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos_ct_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos_ct_ in
        
# 4202 "src/reason-parser/reason_parser.mly"
  ( match _1 with
    | [] -> ct
    | attrs ->
      let loc_start = _symbolstartpos and loc_end = _endpos in
      let ptyp_loc = {ct.ptyp_loc with loc_start; loc_end} in
      let ptyp_attributes = attrs @ ct.ptyp_attributes in
      {ct with ptyp_attributes; ptyp_loc}
  )
# 11695 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.direction_flag) = 
# 4607 "src/reason-parser/reason_parser.mly"
                  ( Upto )
# 11720 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.direction_flag) = 
# 4608 "src/reason-parser/reason_parser.mly"
                  ( Downto )
# 11745 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (unit) = 
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 11770 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (unit) = 
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 11795 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = let _1 = 
# 2022 "src/reason-parser/reason_parser.mly"
                                 (Public)
# 11820 "src/reason-parser/reason_parser.ml"
         in
        
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 11825 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = let _1 = 
# 2022 "src/reason-parser/reason_parser.mly"
                                               (Private)
# 11850 "src/reason-parser/reason_parser.ml"
         in
        
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 11855 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = 
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 11880 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) = 
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 11905 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = 
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 11930 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = 
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 11955 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let x : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = let _1 =
          let _1 = 
# 200 "<standard.mly>"
    ( x )
# 12001 "src/reason-parser/reason_parser.ml"
           in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 12006 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12012 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = 
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12043 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 = 
# 183 "<standard.mly>"
    ( x )
# 12075 "src/reason-parser/reason_parser.ml"
         in
        
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12080 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_expr) = let _1 = 
# 2014 "src/reason-parser/reason_parser.mly"
                                                                ( _2 )
# 12119 "src/reason-parser/reason_parser.ml"
         in
        
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12124 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = let _1 = 
# 183 "<standard.mly>"
    ( x )
# 12156 "src/reason-parser/reason_parser.ml"
         in
        
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12161 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type) = 
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12186 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 = 
# 183 "<standard.mly>"
    ( x )
# 12218 "src/reason-parser/reason_parser.ml"
         in
        
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12223 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12248 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 = 
# 183 "<standard.mly>"
    ( x )
# 12280 "src/reason-parser/reason_parser.ml"
         in
        
# 4813 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12285 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 4814 "src/reason-parser/reason_parser.mly"
      ( _1 )
# 12310 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) = let x = 
# 1374 "src/reason-parser/reason_parser.mly"
                                     ( raise End_of_file )
# 12335 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12340 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) = let x = 
# 1375 "src/reason-parser/reason_parser.mly"
                                     ( Ptop_def _1 )
# 12372 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12377 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) = let x = 
# 1376 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 12409 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12414 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = let x = 
# 1381 "src/reason-parser/reason_parser.mly"
                                   ( [] )
# 12439 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12444 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = let x = 
# 1382 "src/reason-parser/reason_parser.mly"
                                               ( Ptop_def _1  :: _3 )
# 12483 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12488 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = let x = 
# 1383 "src/reason-parser/reason_parser.mly"
                                               ( _1 :: _3 )
# 12527 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12532 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = let x = 
# 1384 "src/reason-parser/reason_parser.mly"
                                     ( [Ptop_def _1 ] )
# 12564 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12569 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = let x = 
# 1385 "src/reason-parser/reason_parser.mly"
                                     ( [_1] )
# 12601 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12606 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = let x = 
# 3862 "src/reason-parser/reason_parser.mly"
                      ( (mktyp (Ptyp_var _2) , Invariant    ) )
# 12639 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12644 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = let x = 
# 3863 "src/reason-parser/reason_parser.mly"
                      ( (mktyp (Ptyp_any)    , Invariant    ) )
# 12670 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12675 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = let x = 
# 3864 "src/reason-parser/reason_parser.mly"
                      ( (mktyp (Ptyp_var _3) , Covariant    ) )
# 12715 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12720 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = let x = 
# 3865 "src/reason-parser/reason_parser.mly"
                      ( (mktyp (Ptyp_any)    , Covariant    ) )
# 12753 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12758 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = let x = 
# 3866 "src/reason-parser/reason_parser.mly"
                      ( (mktyp (Ptyp_var _3) , Contravariant) )
# 12798 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12803 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = let x = 
# 3867 "src/reason-parser/reason_parser.mly"
                      ( (mktyp Ptyp_any      , Contravariant) )
# 12836 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12841 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) = let x = 
# 4577 "src/reason-parser/reason_parser.mly"
                          ( Pdir_none )
# 12859 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12864 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 12885 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) = let x = 
# 4578 "src/reason-parser/reason_parser.mly"
                          ( let (s, _, _) = _1 in Pdir_string s )
# 12893 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12898 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1102 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 12919 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) = let x = 
# 4579 "src/reason-parser/reason_parser.mly"
                          ( let (n, m) = _1 in Pdir_int (n, m) )
# 12927 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12932 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) = let x = 
# 4580 "src/reason-parser/reason_parser.mly"
                          ( Pdir_ident _1 )
# 12957 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12962 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) = let x = 
# 4581 "src/reason-parser/reason_parser.mly"
                          ( Pdir_ident _1 )
# 12987 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 12992 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) = let x = 
# 4582 "src/reason-parser/reason_parser.mly"
                          ( Pdir_bool false )
# 13017 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 13022 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) = let x = 
# 4583 "src/reason-parser/reason_parser.mly"
                          ( Pdir_bool true )
# 13047 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 13052 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = let x = 
# 4612 "src/reason-parser/reason_parser.mly"
                  ( Public )
# 13070 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 13075 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = let x = 
# 4613 "src/reason-parser/reason_parser.mly"
                  ( Private )
# 13100 "src/reason-parser/reason_parser.ml"
         in
        
# 104 "<standard.mly>"
    ( x )
# 13105 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc list * bool) = let _1 =
          let _endpos = _endpos__2_ in
          let _startpos = _startpos__1_ in
          
# 2538 "src/reason-parser/reason_parser.mly"
                  (
    let loc = mklocation _startpos _endpos in
    ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], false)
  )
# 13143 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2565 "src/reason-parser/reason_parser.mly"
                         ( _1 )
# 13149 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined1 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc list * bool) = let _1 =
          let _1 =
            let _1 =
              let x =
                let _1 = _1_inlined1 in
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 13200 "src/reason-parser/reason_parser.ml"
                 in
                
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 13205 "src/reason-parser/reason_parser.ml"
                
              in
              
# 200 "<standard.mly>"
    ( x )
# 13211 "src/reason-parser/reason_parser.ml"
              
            in
            
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 13217 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2542 "src/reason-parser/reason_parser.mly"
                                               (
    (_1, false)
  )
# 13225 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2565 "src/reason-parser/reason_parser.mly"
                         ( _1 )
# 13231 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc list * bool) = let _1 =
          let _endpos = _endpos__3_ in
          let _startpos = _startpos__1_ in
          
# 2545 "src/reason-parser/reason_parser.mly"
                      (
      let loc = mklocation _startpos _endpos in
      ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], true)
  )
# 13276 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2565 "src/reason-parser/reason_parser.mly"
                         ( _1 )
# 13282 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _2_inlined1 : (unit option) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc list * bool) = let _1 =
          let _3 =
            let (_2, _1) = (_2_inlined1, _1_inlined1) in
            let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 13338 "src/reason-parser/reason_parser.ml"
             in
            
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 13343 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2549 "src/reason-parser/reason_parser.mly"
                                                  (
      let patterns = List.map (fun p ->
          match p.txt with

          | Term (Optional _, x, y)  ->
            syntax_error p.loc "Uncurried function definition with labelled \
                                arguments is not supported at the moment.";
            {p with txt = Term (Nolabel, x, y)}
          | _ -> p
        ) _3
      in
      (patterns, true)
  )
# 13361 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2565 "src/reason-parser/reason_parser.mly"
                         ( _1 )
# 13367 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc list * bool) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 13395 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2567 "src/reason-parser/reason_parser.mly"
    ( ([{_1 with txt = Term (Nolabel, None, mkpat ~loc:_1.loc Ppat_any)}], false) )
# 13401 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc list * bool) = 
# 2569 "src/reason-parser/reason_parser.mly"
    ( ([Location.mkloc (Term (Nolabel, None, _1)) _1.ppat_loc], false) )
# 13426 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 13460 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2741 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 13466 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 13475 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 13481 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 13487 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x = 
# 2743 "src/reason-parser/reason_parser.mly"
    ( _2 _3 )
# 13529 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 13537 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 13543 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 13549 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Reason_parser_def.labelled_parameter Location.loc list * bool) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _endpos = _endpos__4_ in
              let _startpos = _startpos__1_ in
              
# 2745 "src/reason-parser/reason_parser.mly"
    ( let (ps, uncurried) = _2 in
      let exp = List.fold_right mkexp_fun ps _4 in
      if uncurried then
        let loc = mklocation _startpos _endpos in
        {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
      else exp
    )
# 13606 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 13615 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 13621 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 13627 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Reason_parser_def.labelled_parameter Location.loc list * bool) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _endpos = _endpos__6_ in
              let _startpos = _startpos__1_ in
              
# 2753 "src/reason-parser/reason_parser.mly"
    ( let (ps, uncurried) = _2 in
    let exp = List.fold_right mkexp_fun ps
        (ghexp_constraint (mklocation _startpos__4_ _endpos) _6 (Some _4, None))  in
    if uncurried then
      let loc = mklocation _startpos _endpos in
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
    )
# 13699 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 13708 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 13714 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 13720 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case list) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case) = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _3 =
                let (_2, _1) = (_2_inlined1, _1_inlined1) in
                let _1 = 
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 13772 "src/reason-parser/reason_parser.ml"
                 in
                
# 3313 "src/reason-parser/reason_parser.mly"
                                                            ( _1 )
# 13777 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2766 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_function _3)) )
# 13783 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__2_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 13792 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 13798 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 13804 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case list) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case) = Obj.magic _1_inlined1 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _5 =
                let (_2, _1) = (_2_inlined1, _1_inlined1) in
                let _1 = 
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 13877 "src/reason-parser/reason_parser.ml"
                 in
                
# 3313 "src/reason-parser/reason_parser.mly"
                                                            ( _1 )
# 13882 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2769 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_match (_3, _5))) )
# 13888 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 13897 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 13903 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 13909 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case list) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case) = Obj.magic _1_inlined1 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _5 =
                let (_2, _1) = (_2_inlined1, _1_inlined1) in
                let _1 = 
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 13982 "src/reason-parser/reason_parser.ml"
                 in
                
# 3313 "src/reason-parser/reason_parser.mly"
                                                            ( _1 )
# 13987 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2772 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_try (_3, _5))) )
# 13993 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14002 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14008 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14014 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _5 = 
# 124 "<standard.mly>"
    ( None )
# 14067 "src/reason-parser/reason_parser.ml"
               in
              let _4 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 14076 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2775 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_ifthenelse(_3, _4, _5))) )
# 14082 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14091 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14097 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14103 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _1_inlined2 : unit = Obj.magic _1_inlined2 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _5 =
                let _1 = _1_inlined2 in
                let x = 
# 183 "<standard.mly>"
    ( x )
# 14172 "src/reason-parser/reason_parser.ml"
                 in
                
# 126 "<standard.mly>"
    ( Some x )
# 14177 "src/reason-parser/reason_parser.ml"
                
              in
              let _4 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 14187 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2775 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_ifthenelse(_3, _4, _5))) )
# 14193 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos_x_ = _startpos__1_ in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14202 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14208 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14214 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _4 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 14271 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2777 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_while(_3, _4))) )
# 14277 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14286 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14292 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14298 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _9;
            MenhirLib.EngineTypes.startp = _startpos__9_;
            MenhirLib.EngineTypes.endp = _endpos__9_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _8;
              MenhirLib.EngineTypes.startp = _startpos__8_;
              MenhirLib.EngineTypes.endp = _endpos__8_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _7;
                MenhirLib.EngineTypes.startp = _startpos__7_;
                MenhirLib.EngineTypes.endp = _endpos__7_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _6;
                  MenhirLib.EngineTypes.startp = _startpos__6_;
                  MenhirLib.EngineTypes.endp = _endpos__6_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _5;
                    MenhirLib.EngineTypes.startp = _startpos__5_;
                    MenhirLib.EngineTypes.endp = _endpos__5_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _4;
                      MenhirLib.EngineTypes.startp = _startpos__4_;
                      MenhirLib.EngineTypes.endp = _endpos__4_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _3;
                        MenhirLib.EngineTypes.startp = _startpos__3_;
                        MenhirLib.EngineTypes.endp = _endpos__3_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = _2;
                          MenhirLib.EngineTypes.startp = _startpos__2_;
                          MenhirLib.EngineTypes.endp = _endpos__2_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _menhir_s;
                            MenhirLib.EngineTypes.semv = _1;
                            MenhirLib.EngineTypes.startp = _startpos__1_;
                            MenhirLib.EngineTypes.endp = _endpos__1_;
                            MenhirLib.EngineTypes.next = _menhir_stack;
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _9 : unit = Obj.magic _9 in
        let _8 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Asttypes.direction_flag) = Obj.magic _7 in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _10 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 14397 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2780 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_for(_4, _6, _8, _7, _10))) )
# 14403 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14412 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14418 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14424 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _8;
          MenhirLib.EngineTypes.startp = _startpos__8_;
          MenhirLib.EngineTypes.endp = _endpos__8_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _8 : unit = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__8_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _endpos = _endpos__8_ in
              let _symbolstartpos = _startpos__1_ in
              
# 2782 "src/reason-parser/reason_parser.mly"
    ( let loc_colon = mklocation _startpos__2_ _endpos__2_ in
      let loc = mklocation _symbolstartpos _endpos in
      mkexp_cons loc_colon (mkexp ~ghost:true ~loc (Pexp_tuple[_5;_7])) loc
    )
# 14506 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__8_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14515 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14521 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14527 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1093 "src/reason-parser/reason_parser.mly"
       (string)
# 14561 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4461 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 14575 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 14583 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 14593 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14602 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14608 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14614 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1094 "src/reason-parser/reason_parser.mly"
       (string)
# 14648 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4462 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 14662 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 14670 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 14680 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14689 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14695 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14701 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1095 "src/reason-parser/reason_parser.mly"
       (string)
# 14735 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4463 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 14749 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 14757 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 14767 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14776 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14782 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14788 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1096 "src/reason-parser/reason_parser.mly"
       (string)
# 14822 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4464 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 14836 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 14844 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 14854 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14863 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14869 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14875 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4466 "src/reason-parser/reason_parser.mly"
                      ( "/>" )
# 14919 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 14927 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 14937 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 14946 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 14952 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 14958 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1099 "src/reason-parser/reason_parser.mly"
       (string)
# 14992 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4467 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 15006 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15014 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15024 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15033 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15039 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15045 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4468 "src/reason-parser/reason_parser.mly"
                      ( "+" )
# 15089 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15097 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15107 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15116 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15122 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15128 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4469 "src/reason-parser/reason_parser.mly"
                      ( "+." )
# 15172 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15180 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15190 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15199 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15205 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15211 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4470 "src/reason-parser/reason_parser.mly"
                      ( "-" )
# 15255 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15263 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15273 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15282 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15288 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15294 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4471 "src/reason-parser/reason_parser.mly"
                      ( "-." )
# 15338 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15346 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15356 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15365 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15371 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15377 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4472 "src/reason-parser/reason_parser.mly"
                      ( "*" )
# 15421 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15429 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15439 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15448 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15454 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15460 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4473 "src/reason-parser/reason_parser.mly"
                      ( "<" )
# 15504 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15512 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15522 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15531 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15537 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15543 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4474 "src/reason-parser/reason_parser.mly"
                      ( ">" )
# 15587 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15595 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15605 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15614 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15620 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15626 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4475 "src/reason-parser/reason_parser.mly"
                      ( "or" )
# 15670 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15678 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15688 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15697 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15703 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15709 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4476 "src/reason-parser/reason_parser.mly"
                      ( "||" )
# 15753 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15761 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15771 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15780 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15786 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15792 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4477 "src/reason-parser/reason_parser.mly"
                      ( "&" )
# 15836 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15844 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15854 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15863 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15869 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15875 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4478 "src/reason-parser/reason_parser.mly"
                      ( "&&" )
# 15919 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 15927 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 15937 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 15946 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 15952 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 15958 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4479 "src/reason-parser/reason_parser.mly"
                      ( ":=" )
# 16002 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16010 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 16020 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16029 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16035 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16041 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4480 "src/reason-parser/reason_parser.mly"
                      ( "+=" )
# 16085 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16093 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 16103 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16112 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16118 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16124 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4481 "src/reason-parser/reason_parser.mly"
                      ( "%" )
# 16168 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16176 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 16186 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16195 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16201 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16207 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4488 "src/reason-parser/reason_parser.mly"
                      ( "<..>" )
# 16251 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16259 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 16269 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16278 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16284 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16290 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4489 "src/reason-parser/reason_parser.mly"
                      ( ">>" )
# 16341 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16349 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 16359 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16368 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16374 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16380 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4490 "src/reason-parser/reason_parser.mly"
                     ( ">..." )
# 16424 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16432 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 16442 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16451 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16457 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16463 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let x : (string) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16501 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2793 "src/reason-parser/reason_parser.mly"
    ( mkuminus _1 _2 )
# 16507 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos_x_ = _endpos__2_ in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16516 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16522 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16528 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let x : (string) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16566 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2795 "src/reason-parser/reason_parser.mly"
    ( mkuplus _1 _2 )
# 16572 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos_x_ = _endpos__2_ in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16581 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16587 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16593 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let x = 
# 2796 "src/reason-parser/reason_parser.mly"
                ("!")
# 16629 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16637 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2797 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_apply(mkoperator _1, [Nolabel,_2])) )
# 16643 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16652 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16658 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16664 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _3 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 16726 "src/reason-parser/reason_parser.ml"
                
              in
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 16735 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2799 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_setfield(_1, _3, _5)) )
# 16741 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16750 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16756 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16762 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 16831 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos = _endpos__6_ in
              let _symbolstartpos = _startpos__1_ in
              
# 2801 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "Array" "set") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp,
                       [Nolabel,_1; Nolabel,_3; Nolabel,_6]))
    )
# 16843 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16852 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16858 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16864 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__7_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 16940 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos = _endpos__7_ in
              let _symbolstartpos = _startpos__1_ in
              
# 2807 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "String" "set") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp,
                       [Nolabel,_1; Nolabel,_4; Nolabel,_7]))
    )
# 16952 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__7_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 16961 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 16967 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 16973 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__4_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__4_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined2;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _5 : unit = Obj.magic _5 in
        let _4_inlined1 : (unit option) = Obj.magic _4_inlined1 in
        let _1_inlined2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1_inlined2 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_4, _1_inlined1, _1) = (_4_inlined1, _1_inlined2, _1_inlined1) in
                let _3 =
                  let _1 = _1_inlined1 in
                  
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 17057 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 2899 "src/reason-parser/reason_parser.mly"
                                                                 ( _3 )
# 17063 "src/reason-parser/reason_parser.ml"
                
              in
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 17072 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos = _endpos__4_ in
              let _symbolstartpos = _startpos__1_ in
              
# 2813 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      bigarray_set ~loc _1 _2 _4
    )
# 17082 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 17091 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 17097 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 17103 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 17138 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 17150 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 17158 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2817 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_setinstvar(_1, _3)) )
# 17164 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 17173 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 17179 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 17185 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 17227 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2819 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_assert _2) )
# 17233 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 17242 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 17248 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 17254 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 17296 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2821 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_lazy _2) )
# 17302 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 17311 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 17317 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 17323 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x = 
# 2847 "src/reason-parser/reason_parser.mly"
    ( (* Should use ghost expressions, but not sure how that would work with source maps *)
      (* So ? will become true and : becomes false for now*)
      let loc_question = mklocation _startpos__2_ _endpos__2_ in
      let loc_colon = mklocation _startpos__4_ _endpos__4_ in
      let fauxTruePat =
        Pat.mk ~loc:loc_question (Ppat_construct({txt = Lident "true"; loc = loc_question}, None)) in
      let fauxFalsePat =
        Pat.mk ~loc:loc_colon (Ppat_construct({txt = Lident "false"; loc = loc_colon}, None)) in
      let fauxMatchCaseTrue = Exp.case fauxTruePat _3 in
      let fauxMatchCaseFalse = Exp.case fauxFalsePat _5 in
      mkexp (Pexp_match (_1, [fauxMatchCaseTrue; fauxMatchCaseFalse]))
    )
# 17389 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 17397 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 17403 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2868 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 17409 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2870 "src/reason-parser/reason_parser.mly"
                     ( {_2 with pexp_attributes = _1 :: _2.pexp_attributes} )
# 17442 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 17450 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2873 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 17456 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list *
  Migrate_parsetree.Ast_404.Parsetree.expression option) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 17489 "src/reason-parser/reason_parser.ml"
         in
        
# 3351 "src/reason-parser/reason_parser.mly"
  ( match List.rev _1 with
    (* Check if the last expr has been spread with `...` *)
    | ((dotdotdot, e) as hd)::es ->
      let (es, ext) = match dotdotdot with
      | Some _ -> (es, Some e)
      | None -> (hd::es, None)
      in
      let msg = "Lists can only have one `...` spread, at the end.
Explanation: lists are singly-linked list, where a node contains a value and points to the next node. `[a, ...bc]` efficiently creates a new item and links `bc` as its next nodes. `[...bc, a]` would be expensive, as it'd need to traverse `bc` and prepend each item to `a` one by one. We therefore disallow such syntax sugar.
Solution: directly use `concat` or other List helpers." in
      let exprList = filter_raise_spread_syntax msg es in
      (List.rev exprList, ext)
    | [] -> [], None
  )
# 17507 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 17539 "src/reason-parser/reason_parser.ml"
         in
        
# 3345 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 17544 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3373 "src/reason-parser/reason_parser.mly"
         ( _1 )
# 17569 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3375 "src/reason-parser/reason_parser.mly"
    ( ghexp_constraint (mklocation _symbolstartpos _endpos) _1 _2 )
# 17604 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.payload) = Obj.magic _3 in
        let _2 : (string Location.loc) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = 
# 4725 "src/reason-parser/reason_parser.mly"
                                           ( (_2, _3) )
# 17650 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 17679 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 =
          let x = 
# 4500 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 17688 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 17696 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4018 "src/reason-parser/reason_parser.mly"
  ( let args, res = _2 in
    let loc = mklocation _symbolstartpos _endpos in
    Te.decl _1 ~args ?res ~loc
  )
# 17707 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          let x = 
# 4501 "src/reason-parser/reason_parser.mly"
                      ( "[]" )
# 17749 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 17757 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4018 "src/reason-parser/reason_parser.mly"
  ( let args, res = _2 in
    let loc = mklocation _symbolstartpos _endpos in
    Te.decl _1 ~args ?res ~loc
  )
# 17768 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          let x = 
# 4502 "src/reason-parser/reason_parser.mly"
                      ( "()" )
# 17810 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 17818 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4018 "src/reason-parser/reason_parser.mly"
  ( let args, res = _2 in
    let loc = mklocation _symbolstartpos _endpos in
    Te.decl _1 ~args ?res ~loc
  )
# 17829 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 =
          let x = 
# 4503 "src/reason-parser/reason_parser.mly"
                      ( "::" )
# 17863 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 17871 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4018 "src/reason-parser/reason_parser.mly"
  ( let args, res = _2 in
    let loc = mklocation _symbolstartpos _endpos in
    Te.decl _1 ~args ?res ~loc
  )
# 17882 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 =
          let x = 
# 4505 "src/reason-parser/reason_parser.mly"
                      ( "false" )
# 17916 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 17924 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4018 "src/reason-parser/reason_parser.mly"
  ( let args, res = _2 in
    let loc = mklocation _symbolstartpos _endpos in
    Te.decl _1 ~args ?res ~loc
  )
# 17935 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 =
          let x = 
# 4506 "src/reason-parser/reason_parser.mly"
                      ( "true" )
# 17969 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 17977 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4018 "src/reason-parser/reason_parser.mly"
  ( let args, res = _2 in
    let loc = mklocation _symbolstartpos _endpos in
    Te.decl _1 ~args ?res ~loc
  )
# 17988 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 18023 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18034 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__3_ = _endpos_x_ in
        let _1 =
          let x = 
# 4500 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 18042 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18050 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4026 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    Te.rebind _1 _3 ~loc
  )
# 18060 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18109 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__3_ = _endpos_x_ in
        let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          let x = 
# 4501 "src/reason-parser/reason_parser.mly"
                      ( "[]" )
# 18118 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18126 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4026 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    Te.rebind _1 _3 ~loc
  )
# 18136 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18185 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__3_ = _endpos_x_ in
        let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          let x = 
# 4502 "src/reason-parser/reason_parser.mly"
                      ( "()" )
# 18194 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18202 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4026 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    Te.rebind _1 _3 ~loc
  )
# 18212 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18254 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__3_ = _endpos_x_ in
        let _1 =
          let x = 
# 4503 "src/reason-parser/reason_parser.mly"
                      ( "::" )
# 18262 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18270 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4026 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    Te.rebind _1 _3 ~loc
  )
# 18280 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18322 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__3_ = _endpos_x_ in
        let _1 =
          let x = 
# 4505 "src/reason-parser/reason_parser.mly"
                      ( "false" )
# 18330 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18338 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4026 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    Te.rebind _1 _3 ~loc
  )
# 18348 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18390 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__3_ = _endpos_x_ in
        let _1 =
          let x = 
# 4506 "src/reason-parser/reason_parser.mly"
                      ( "true" )
# 18398 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18406 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4026 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    Te.rebind _1 _3 ~loc
  )
# 18416 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 18451 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 18462 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3480 "src/reason-parser/reason_parser.mly"
   ( (_1, _3) )
# 18468 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 18489 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__1_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3482 "src/reason-parser/reason_parser.mly"
   ( let loc = mklocation _symbolstartpos _endpos in
     let lident_loc = mkloc _1 loc in
     let lident_lident_loc = mkloc (Lident _1) loc in
     (lident_loc, mkexp (Pexp_ident lident_lident_loc))
   )
# 18503 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          let _endpos = _endpos__2_ in
          let _startpos = _startpos__1_ in
          
# 2538 "src/reason-parser/reason_parser.mly"
                  (
    let loc = mklocation _startpos _endpos in
    ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], false)
  )
# 18556 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3329 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (pl, uncurried) = _1 in
    let exp = List.fold_right mkexp_fun pl
        (match _2 with
        | None -> _3
        | Some ct -> Exp.constraint_ ~loc _3 ct)
    in
    if uncurried then
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
  )
# 18574 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _2_inlined1 : (unit option) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let (_3, _2) = (_3_inlined1, _2_inlined1) in
          let _1 =
            let _1 =
              let x =
                let _1 = _1_inlined1 in
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 18640 "src/reason-parser/reason_parser.ml"
                 in
                
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 18645 "src/reason-parser/reason_parser.ml"
                
              in
              
# 200 "<standard.mly>"
    ( x )
# 18651 "src/reason-parser/reason_parser.ml"
              
            in
            
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 18657 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2542 "src/reason-parser/reason_parser.mly"
                                               (
    (_1, false)
  )
# 18665 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3329 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (pl, uncurried) = _1 in
    let exp = List.fold_right mkexp_fun pl
        (match _2 with
        | None -> _3
        | Some ct -> Exp.constraint_ ~loc _3 ct)
    in
    if uncurried then
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
  )
# 18683 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let (_endpos__3_, _3, _2) = (_endpos__3_inlined1_, _3_inlined1, _2_inlined1) in
          let _endpos = _endpos__3_ in
          let _startpos = _startpos__1_ in
          
# 2545 "src/reason-parser/reason_parser.mly"
                      (
      let loc = mklocation _startpos _endpos in
      ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], true)
  )
# 18743 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3329 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (pl, uncurried) = _1 in
    let exp = List.fold_right mkexp_fun pl
        (match _2 with
        | None -> _3
        | Some ct -> Exp.constraint_ ~loc _3 ct)
    in
    if uncurried then
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
  )
# 18761 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _4 : unit = Obj.magic _4 in
        let _2_inlined2 : (unit option) = Obj.magic _2_inlined2 in
        let _1_inlined1 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let (_2_inlined1, _2) = (_2_inlined2, _2_inlined1) in
          let _3 =
            let (_2, _1) = (_2_inlined1, _1_inlined1) in
            let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 18832 "src/reason-parser/reason_parser.ml"
             in
            
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 18837 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2549 "src/reason-parser/reason_parser.mly"
                                                  (
      let patterns = List.map (fun p ->
          match p.txt with

          | Term (Optional _, x, y)  ->
            syntax_error p.loc "Uncurried function definition with labelled \
                                arguments is not supported at the moment.";
            {p with txt = Term (Nolabel, x, y)}
          | _ -> p
        ) _3
      in
      (patterns, true)
  )
# 18855 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3329 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (pl, uncurried) = _1 in
    let exp = List.fold_right mkexp_fun pl
        (match _2 with
        | None -> _3
        | Some ct -> Exp.constraint_ ~loc _3 ct)
    in
    if uncurried then
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
  )
# 18873 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          let _endpos = _endpos__2_ in
          let _startpos = _startpos__1_ in
          
# 2538 "src/reason-parser/reason_parser.mly"
                  (
    let loc = mklocation _startpos _endpos in
    ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], false)
  )
# 18926 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3329 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (pl, uncurried) = _1 in
    let exp = List.fold_right mkexp_fun pl
        (match _2 with
        | None -> _3
        | Some ct -> Exp.constraint_ ~loc _3 ct)
    in
    if uncurried then
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
  )
# 18944 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _2_inlined1 : (unit option) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let (_3, _2) = (_3_inlined1, _2_inlined1) in
          let _1 =
            let _1 =
              let x =
                let _1 = _1_inlined1 in
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 19010 "src/reason-parser/reason_parser.ml"
                 in
                
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 19015 "src/reason-parser/reason_parser.ml"
                
              in
              
# 200 "<standard.mly>"
    ( x )
# 19021 "src/reason-parser/reason_parser.ml"
              
            in
            
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 19027 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2542 "src/reason-parser/reason_parser.mly"
                                               (
    (_1, false)
  )
# 19035 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3329 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (pl, uncurried) = _1 in
    let exp = List.fold_right mkexp_fun pl
        (match _2 with
        | None -> _3
        | Some ct -> Exp.constraint_ ~loc _3 ct)
    in
    if uncurried then
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
  )
# 19053 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let (_endpos__3_, _3, _2) = (_endpos__3_inlined1_, _3_inlined1, _2_inlined1) in
          let _endpos = _endpos__3_ in
          let _startpos = _startpos__1_ in
          
# 2545 "src/reason-parser/reason_parser.mly"
                      (
      let loc = mklocation _startpos _endpos in
      ([mkloc (Term (Nolabel, None, mkpat_constructor_unit loc loc)) loc], true)
  )
# 19113 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3329 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (pl, uncurried) = _1 in
    let exp = List.fold_right mkexp_fun pl
        (match _2 with
        | None -> _3
        | Some ct -> Exp.constraint_ ~loc _3 ct)
    in
    if uncurried then
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
  )
# 19131 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _4 : unit = Obj.magic _4 in
        let _2_inlined2 : (unit option) = Obj.magic _2_inlined2 in
        let _1_inlined1 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let (_2_inlined1, _2) = (_2_inlined2, _2_inlined1) in
          let _3 =
            let (_2, _1) = (_2_inlined1, _1_inlined1) in
            let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 19202 "src/reason-parser/reason_parser.ml"
             in
            
# 2535 "src/reason-parser/reason_parser.mly"
                                                          ( _1 )
# 19207 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2549 "src/reason-parser/reason_parser.mly"
                                                  (
      let patterns = List.map (fun p ->
          match p.txt with

          | Term (Optional _, x, y)  ->
            syntax_error p.loc "Uncurried function definition with labelled \
                                arguments is not supported at the moment.";
            {p with txt = Term (Nolabel, x, y)}
          | _ -> p
        ) _3
      in
      (patterns, true)
  )
# 19225 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3329 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (pl, uncurried) = _1 in
    let exp = List.fold_right mkexp_fun pl
        (match _2 with
        | None -> _3
        | Some ct -> Exp.constraint_ ~loc _3 ct)
    in
    if uncurried then
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
  )
# 19243 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = let _endpos = _endpos__2_ in
        let _startpos = _startpos__1_ in
        
# 1426 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos _endpos in
      [mkloc (Some (mkloc "*" loc), None) loc]
    )
# 19281 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = 
# 1437 "src/reason-parser/reason_parser.mly"
                                   ([_2])
# 19324 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = 
# 1438 "src/reason-parser/reason_parser.mly"
                                         ([_2])
# 19374 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined2;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined2 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = Obj.magic _1_inlined2 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1_inlined1 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = let _1 =
          let _1 =
            let x =
              let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
              let _1 =
                let _2 = _2_inlined1 in
                let _3 =
                  let _1 = _1_inlined1 in
                  
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 19448 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 4849 "src/reason-parser/reason_parser.mly"
                                         ( _1 :: _3 )
# 19454 "src/reason-parser/reason_parser.ml"
                
              in
              
# 1421 "src/reason-parser/reason_parser.mly"
                                                         (_1)
# 19460 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 19466 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 19472 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1439 "src/reason-parser/reason_parser.mly"
                                                            ( _1 )
# 19478 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 3934 "src/reason-parser/reason_parser.mly"
  ( ((match _1 with None -> Pcstr_tuple [] | Some x -> x), _2) )
# 19511 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 2640 "src/reason-parser/reason_parser.mly"
                      ( ">..." )
# 19536 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (string) = 
# 2640 "src/reason-parser/reason_parser.mly"
                      ( ">..." )
# 19568 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 19589 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4453 "src/reason-parser/reason_parser.mly"
                       ( _1 )
# 19597 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 19618 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4453 "src/reason-parser/reason_parser.mly"
                       ( _1 )
# 19626 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (
# 1323 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.structure)
# 19658 "src/reason-parser/reason_parser.ml"
        ) = 
# 1365 "src/reason-parser/reason_parser.mly"
  ( apply_mapper_to_structure _1 reason_mapper )
# 19662 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (
# 1325 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.signature)
# 19694 "src/reason-parser/reason_parser.ml"
        ) = 
# 1370 "src/reason-parser/reason_parser.mly"
  ( apply_mapper_to_signature _1 reason_mapper )
# 19698 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.payload) = Obj.magic _3 in
        let _2 : (string Location.loc) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = 
# 4729 "src/reason-parser/reason_parser.mly"
                                                  ( (_2, _3) )
# 19744 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string Location.loc) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) = 
# 4721 "src/reason-parser/reason_parser.mly"
                  ( ([], _2) )
# 19776 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2644 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let body = mktailexp_extension loc _2 None in
      makeFrag loc body
    )
# 19820 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2649 "src/reason-parser/reason_parser.mly"
    ( let (component, _) = _1 in
      let loc = mklocation _symbolstartpos _endpos in
      component [
        (Labelled "children", mktailexp_extension loc [] None);
        (Nolabel, mkexp_constructor_unit loc loc)
      ] loc
    )
# 19863 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (
# 1151 "src/reason-parser/reason_parser.mly"
       (string)
# 19902 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__4_ in
        
# 2657 "src/reason-parser/reason_parser.mly"
    ( let (component, start) = _1 in
      let loc = mklocation _startpos__4_ _endpos in
      (* TODO: Make this tag check simply a warning *)
      let endName = Longident.parse _4 in
      let _ = ensureTagsAreEqual start endName loc in
      let siblings = if List.length _3 > 0 then _3 else [] in
      component [
        (Labelled "children", mktailexp_extension loc siblings None);
        (Nolabel, mkexp_constructor_unit loc loc)
      ] loc
    )
# 19927 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (
# 1151 "src/reason-parser/reason_parser.mly"
       (string)
# 19966 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (string) = Obj.magic _2 in
        let _1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__4_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2670 "src/reason-parser/reason_parser.mly"
    ( let (component, start) = _1 in
      let loc = mklocation _symbolstartpos _endpos in
      (* TODO: Make this tag check simply a warning *)
      let endName = Longident.parse _4 in
      let _ = ensureTagsAreEqual start endName loc in
      let child = _3 in
      component [
        (Labelled "children", child);
        (Nolabel, mkexp_constructor_unit loc loc)
      ] loc
    )
# 19992 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 2574 "src/reason-parser/reason_parser.mly"
              ( [] )
# 20012 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _5 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 20066 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _4 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let _endpos = _endpos__1_ in
          let _startpos = _startpos__1_ in
          
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 20080 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2576 "src/reason-parser/reason_parser.mly"
    ( (* a=?b *)
      [(Optional _1, _4)] @ _5
    )
# 20088 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _3 in
        let _2 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 20124 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 2580 "src/reason-parser/reason_parser.mly"
    ( (* <Foo ?bar /> punning with explicitly passed optional *)
      let loc_lident = mklocation _startpos__2_ _endpos__2_ in
      [(Optional _2, mkexp (Pexp_ident {txt = Lident _2; loc = loc_lident}) ~loc:loc_lident)] @ _3
    )
# 20138 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _4 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 20185 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _3 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let _endpos = _endpos__1_ in
          let _startpos = _startpos__1_ in
          
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 20199 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2585 "src/reason-parser/reason_parser.mly"
    ( (* a=b *)
      [(Labelled _1, _3)] @ _4
    )
# 20207 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 20237 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 2589 "src/reason-parser/reason_parser.mly"
    ( (* a (punning) *)
      let loc_lident = mklocation _startpos__1_ _endpos__1_ in
      [(Labelled _1, mkexp (Pexp_ident {txt = Lident _1; loc = loc_lident}) ~loc:loc_lident)] @ _2
    )
# 20250 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (
# 1096 "src/reason-parser/reason_parser.mly"
       (string)
# 20271 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 20284 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2598 "src/reason-parser/reason_parser.mly"
  (
    begin match _1.txt with
      | "/>>" ->
         syntax_error _1.loc
          {|JSX in a JSX-argument needs to be wrapped in braces.
      If you wrote:
        <Description term=<Text text="Age" />> child </Description>
      Try wrapping <Text /> in braces.
        <Description term={<Text text="Age" />}> child </Description>|}
      | "/>/>" ->
         syntax_error _1.loc
           {|JSX in a JSX-argument needs to be wrapped in braces.
      If you wrote:
        <Description term=<Text text="Age" />/>
      Try wrapping <Text /> in braces.
        <Description term={<Text text="Age" />} />|}
      | _ -> syntax_error _1.loc "Syntax error"
    end;
    []
  )
# 20309 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let x : (
# 1114 "src/reason-parser/reason_parser.mly"
       (string)
# 20339 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 20353 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2622 "src/reason-parser/reason_parser.mly"
    ( let name = Longident.parse _1.txt in
      (jsx_component {_1 with txt = name} _2, name)
    )
# 20361 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _3 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 20408 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2626 "src/reason-parser/reason_parser.mly"
    ( jsx_component _2 _3, _2.txt )
# 20414 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 20454 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2631 "src/reason-parser/reason_parser.mly"
    ( (jsx_component _1 _2, _1.txt) )
# 20460 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 20490 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 20504 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2633 "src/reason-parser/reason_parser.mly"
    ( let lident = Longident.Lident _1.txt in
      (jsx_component {_1 with txt = lident } _2, lident)
    )
# 20512 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2684 "src/reason-parser/reason_parser.mly"
                                                  (
    let loc = mklocation _symbolstartpos _endpos in
    let body = mktailexp_extension loc _2 None in
    makeFrag loc body
  )
# 20557 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2689 "src/reason-parser/reason_parser.mly"
                                                             (
    let (component, _) = _1 in
    let loc = mklocation _symbolstartpos _endpos in
    component [
      (Labelled "children", mktailexp_extension loc [] None);
      (Nolabel, mkexp_constructor_unit loc loc)
    ] loc
  )
# 20601 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (
# 1151 "src/reason-parser/reason_parser.mly"
       (string)
# 20640 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__4_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2697 "src/reason-parser/reason_parser.mly"
                                                                                                   (
    let (component, start) = _1 in
    let loc = mklocation _symbolstartpos _endpos in
    (* TODO: Make this tag check simply a warning *)
    let endName = Longident.parse _4 in
    let _ = ensureTagsAreEqual start endName loc in
    let siblings = if List.length _3 > 0 then _3 else [] in
    component [
      (Labelled "children", mktailexp_extension loc siblings None);
      (Nolabel, mkexp_constructor_unit loc loc)
    ] loc
  )
# 20667 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (
# 1151 "src/reason-parser/reason_parser.mly"
       (string)
# 20706 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (string) = Obj.magic _2 in
        let _1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__4_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2709 "src/reason-parser/reason_parser.mly"
                                                                                                           (
    let (component, start) = _1 in
    let loc = mklocation _symbolstartpos _endpos in
    (* TODO: Make this tag check simply a warning *)
    let endName = Longident.parse _4 in
    let _ = ensureTagsAreEqual start endName loc in
    let child = _3 in
    component [
      (Labelled "children", child);
      (Nolabel, mkexp_constructor_unit loc loc)
    ] loc
  )
# 20733 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 20754 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4523 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 20762 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 20795 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = 
# 4524 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 20805 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 20835 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3120 "src/reason-parser/reason_parser.mly"
    ( [(Nolabel, _1)] )
# 20841 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let _1 =
            let x =
              let _1 = 
# 4837 "src/reason-parser/reason_parser.mly"
                ( [] )
# 20885 "src/reason-parser/reason_parser.ml"
               in
              
# 3116 "src/reason-parser/reason_parser.mly"
                                                        ( _1 )
# 20890 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 20896 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 20902 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__1_ = _endpos__3_ in
        let _endpos = _endpos__1_ in
        let _startpos = _startpos__1_ in
        
# 3122 "src/reason-parser/reason_parser.mly"
    ( match _1 with
      | [] -> let loc = mklocation _startpos _endpos in
              [(Nolabel, mkexp_constructor_unit loc loc)]
      | xs -> xs
    )
# 20915 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined1 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let _1 =
            let x =
              let _1 = _1_inlined1 in
              let _1 =
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 20970 "src/reason-parser/reason_parser.ml"
                 in
                
# 4838 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 20975 "src/reason-parser/reason_parser.ml"
                
              in
              
# 3116 "src/reason-parser/reason_parser.mly"
                                                        ( _1 )
# 20981 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 20987 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 20993 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__1_ = _endpos__3_ in
        let _endpos = _endpos__1_ in
        let _startpos = _startpos__1_ in
        
# 3122 "src/reason-parser/reason_parser.mly"
    ( match _1 with
      | [] -> let loc = mklocation _startpos _endpos in
              [(Nolabel, mkexp_constructor_unit loc loc)]
      | xs -> xs
    )
# 21006 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 3128 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos _endpos in
      [(Nolabel, mkexp_constructor_unit ~uncurried:true loc loc)]
    )
# 21051 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3162 "src/reason-parser/reason_parser.mly"
                             ( (Nolabel, _1) )
# 21077 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21116 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3164 "src/reason-parser/reason_parser.mly"
    ( (* add(~a, ~b) -> parses ~a & ~b *)
      let lident_loc, maybe_typ = _2.txt in
      let exp = mkexp (Pexp_ident lident_loc) ~loc:lident_loc.loc in
      let labeled_exp = match maybe_typ with
      | None -> exp
      | Some typ ->
          ghexp_constraint _2.loc exp typ
      in
      (Labelled (Longident.last lident_loc.txt), labeled_exp)
    )
# 21131 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21174 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3175 "src/reason-parser/reason_parser.mly"
    ( (* foo(~a?)  -> parses ~a? *)
      let exp = mkexp (Pexp_ident _2) ~loc:_2.loc in
      (Optional (Longident.last _2.txt), exp)
    )
# 21183 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Longident.t Location.loc -> Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : (string -> Migrate_parsetree.Ast_404.Asttypes.arg_label) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 21231 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21244 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3180 "src/reason-parser/reason_parser.mly"
    ( (* foo(~bar=?Some(1)) or add(~x=1, ~y=2) -> parses ~bar=?Some(1) & ~x=1 & ~y=1 *)
      (_4 _2.txt, _5 { _2 with txt = Lident _2.txt })
    )
# 21252 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x_inlined1;
          MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let x_inlined1 : unit = Obj.magic x_inlined1 in
        let _4 : (string -> Migrate_parsetree.Ast_404.Asttypes.arg_label) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 21300 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _5 =
          let (_endpos_x_, _startpos_x_, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, x_inlined1) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21314 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21323 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3184 "src/reason-parser/reason_parser.mly"
    ( (* foo(~l =_) *)
      let loc = _5.loc in
      let exp = mkexp (Pexp_ident (mkloc (Lident "_") loc)) ~loc in
      (_4 _2.txt, exp)
    )
# 21333 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21362 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3190 "src/reason-parser/reason_parser.mly"
    ( (* foo(_) *)
      let loc = _1.loc in
      let exp = mkexp (Pexp_ident (mkloc (Lident "_") loc)) ~loc in
      (Nolabel, exp)
    )
# 21372 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t Location.loc -> Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3134 "src/reason-parser/reason_parser.mly"
                             ( fun _punned -> _1 )
# 21397 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t Location.loc -> Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__1_ in
        
# 3136 "src/reason-parser/reason_parser.mly"
    ( fun punned ->
      let exp = mkexp (Pexp_ident punned) ~loc:punned.loc in
      match _1 with
      | typ ->
        let loc = mklocation punned.loc.loc_start _endpos in
        ghexp_constraint loc exp typ
    )
# 21430 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string Location.loc -> Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _3 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 21464 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21478 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2521 "src/reason-parser/reason_parser.mly"
    ( Term (Labelled _2.txt, None, _3 _2) )
# 21484 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21493 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2530 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 21499 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (string Location.loc -> Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _3 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 21547 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21561 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2523 "src/reason-parser/reason_parser.mly"
    ( Term (Optional _2.txt, Some _5, _3 _2) )
# 21567 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21576 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2530 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 21582 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (string Location.loc -> Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _3 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 21630 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21644 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2525 "src/reason-parser/reason_parser.mly"
    ( Term (Optional _2.txt, None, _3 _2) )
# 21650 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21659 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2530 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 21665 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc) = let _1 =
          let x = 
# 2527 "src/reason-parser/reason_parser.mly"
    ( Term (Nolabel, None, _1) )
# 21691 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21699 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2530 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 21705 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 21732 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc) = let _1 =
          let x = 
# 2529 "src/reason-parser/reason_parser.mly"
    ( Type _2 )
# 21742 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21750 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2530 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 21756 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (string Location.loc -> Migrate_parsetree.Ast_404.Parsetree.pattern) = 
# 2506 "src/reason-parser/reason_parser.mly"
                                   ( fun _punned -> _2 )
# 21788 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string Location.loc -> Migrate_parsetree.Ast_404.Parsetree.pattern) = let _endpos = _endpos__1_ in
        
# 2508 "src/reason-parser/reason_parser.mly"
    ( fun punned ->
      let pat = mkpat (Ppat_var punned) ~loc:punned.loc in
      match _1 with
      | None -> pat
      | Some typ ->
        let loc = mklocation punned.loc.loc_start _endpos in
        mkpat ~loc (Ppat_constraint(pat, typ))
    )
# 21821 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (string -> Migrate_parsetree.Ast_404.Asttypes.arg_label) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 21876 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4230 "src/reason-parser/reason_parser.mly"
    ( (_6 _2, _4) )
# 21886 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21928 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3752 "src/reason-parser/reason_parser.mly"
                                          ( (_1,_3) )
# 21934 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 21962 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3753 "src/reason-parser/reason_parser.mly"
                                          ( (_1, pat_of_label _1) )
# 21968 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x_inlined1;
          MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x_inlined1 : (string) = Obj.magic x_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_inlined1_ in
        let _v : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) = let _3 =
          let (_endpos_x_, _startpos_x_, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, x_inlined1) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 22011 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 22020 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3755 "src/reason-parser/reason_parser.mly"
    ( (* punning with alias eg. {ReasonReact.state as prevState}
       *  -> {ReasonReact.state: state as prevState} *)
      (_1, mkpat(Ppat_alias(pat_of_label _1, _3)))
    )
# 22029 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic _4 in
        let _3 : ((Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) option) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__5_ in
        let _v : (Reason_parser_def.let_bindings) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 22076 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3213 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    let pat, expr = _5 in
    mklbs _3 _4 (Vb.mk ~loc ~attrs:_1 pat expr) loc )
# 22089 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic _4 in
        let _3 : ((Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) option) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Reason_parser_def.let_bindings) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 22144 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 22149 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 3213 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    let pat, expr = _5 in
    mklbs _3 _4 (Vb.mk ~loc ~attrs:_1 pat expr) loc )
# 22162 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__4_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3220 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      (_1, ghexp_constraint loc _4 _2) )
# 22213 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3223 "src/reason-parser/reason_parser.mly"
    ( (_1, _2) )
# 22246 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (string list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _7 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 22317 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__7_ = _endpos_x_ in
        let _endpos = _endpos__7_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3226 "src/reason-parser/reason_parser.mly"
    ( let typ = mktyp ~ghost:true (Ptyp_poly(_3, _5)) in
      let loc = mklocation _symbolstartpos _endpos in
      (mkpat ~ghost:true ~loc (Ppat_constraint(_1, typ)), _7)
    )
# 22329 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _7 : unit = Obj.magic _7 in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (string list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _8 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 22407 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__8_ = _endpos_x_ in
        let _endpos = _endpos__8_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3279 "src/reason-parser/reason_parser.mly"
   ( let exp, poly = wrap_type_annotation _4 _6 _8 in
     let loc = mklocation _symbolstartpos _endpos in
     (mkpat ~ghost:true ~loc (Ppat_constraint(_1, poly)), exp)
   )
# 22419 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3295 "src/reason-parser/reason_parser.mly"
    ( (_1, _3) )
# 22459 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__5_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3297 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      (mkpat ~loc (Ppat_constraint(_1, _3)), _5)
    )
# 22517 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.value_binding list) = Obj.magic _2 in
        let _1 : (Reason_parser_def.let_bindings) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Reason_parser_def.let_bindings) = 
# 3208 "src/reason-parser/reason_parser.mly"
                                           ( addlbs _1 _2 )
# 22549 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration list) = 
# 211 "<standard.mly>"
    ( [] )
# 22567 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration list) = Obj.magic xs in
        let x : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration list) = 
# 213 "<standard.mly>"
    ( x :: xs )
# 22599 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) = 
# 211 "<standard.mly>"
    ( [] )
# 22617 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) = Obj.magic xs in
        let x : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) = 
# 213 "<standard.mly>"
    ( x :: xs )
# 22649 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = 
# 211 "<standard.mly>"
    ( [] )
# 22667 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = Obj.magic xs in
        let x : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = 
# 213 "<standard.mly>"
    ( x :: xs )
# 22699 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.value_binding list) = 
# 211 "<standard.mly>"
    ( [] )
# 22717 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.value_binding list) = Obj.magic xs in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.value_binding list) = let x =
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 22758 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
          let _endpos = _endpos__3_ in
          let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
            _startpos__1_
          else
            _startpos__2_ in
          
# 3204 "src/reason-parser/reason_parser.mly"
  ( let pat, expr = _3 in
    Vb.mk ~loc:(mklocation _symbolstartpos _endpos) ~attrs:_1 pat expr )
# 22770 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 22776 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.value_binding list) = Obj.magic xs in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.value_binding list) = let x =
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 22825 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 22830 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos__3_ in
          let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
            _startpos__1_
          else
            _startpos__2_ in
          
# 3204 "src/reason-parser/reason_parser.mly"
  ( let pat, expr = _3 in
    Vb.mk ~loc:(mklocation _symbolstartpos _endpos) ~attrs:_1 pat expr )
# 22842 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 22848 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_binding list) = 
# 211 "<standard.mly>"
    ( [] )
# 22866 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.module_binding list) = Obj.magic xs in
        let x : (Migrate_parsetree.Ast_404.Parsetree.module_binding) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_binding list) = 
# 213 "<standard.mly>"
    ( x :: xs )
# 22898 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_declaration list) = 
# 211 "<standard.mly>"
    ( [] )
# 22916 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.module_declaration list) = Obj.magic xs in
        let x : (Migrate_parsetree.Ast_404.Parsetree.module_declaration) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_declaration list) = 
# 213 "<standard.mly>"
    ( x :: xs )
# 22948 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = 
# 211 "<standard.mly>"
    ( [] )
# 22966 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 23006 "src/reason-parser/reason_parser.ml"
           in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 23011 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 23016 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 23022 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 23070 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 23075 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 23081 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 23086 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 23092 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 23139 "src/reason-parser/reason_parser.ml"
           in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 23145 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 23150 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 23156 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 23162 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1_inlined1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = _1_inlined1 in
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 23218 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 23223 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 23230 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 23235 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 23241 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 23247 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = 
# 211 "<standard.mly>"
    ( [] )
# 23265 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 23305 "src/reason-parser/reason_parser.ml"
           in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 23310 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 23315 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 23321 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 23369 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 23374 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 23380 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 23385 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 23391 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 23438 "src/reason-parser/reason_parser.ml"
           in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 23444 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 23449 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 23455 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 23461 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1_inlined1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = _1_inlined1 in
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 23517 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 23522 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 23529 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 23534 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 23540 "src/reason-parser/reason_parser.ml"
          
        in
        
# 213 "<standard.mly>"
    ( x :: xs )
# 23546 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = 
# 211 "<standard.mly>"
    ( [] )
# 23564 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = Obj.magic xs in
        let x : (Migrate_parsetree.Ast_404.Parsetree.row_field) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = 
# 213 "<standard.mly>"
    ( x :: xs )
# 23596 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = 
# 211 "<standard.mly>"
    ( [] )
# 23614 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic xs in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = 
# 213 "<standard.mly>"
    ( x :: xs )
# 23646 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.case list) = 
# 4832 "src/reason-parser/reason_parser.mly"
                ( [] )
# 23664 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.case) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.case list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.case list) = 
# 4833 "src/reason-parser/reason_parser.mly"
                   ( _2 :: _1 )
# 23696 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.case list) = 
# 4832 "src/reason-parser/reason_parser.mly"
                ( [] )
# 23714 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.case) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.case list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.case list) = 
# 4833 "src/reason-parser/reason_parser.mly"
                   ( _2 :: _1 )
# 23746 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = 
# 4832 "src/reason-parser/reason_parser.mly"
                ( [] )
# 23766 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _1_inlined2 : (unit option) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = let _2 =
          let (_startpos__1_inlined1_, _1_inlined1, _1) = (_startpos__1_inlined2_, _1_inlined2, _1_inlined1) in
          let x =
            let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
            let _2 =
              let _1 =
                let _1 =
                  let _endpos = _endpos_x_ in
                  let _symbolstartpos = _startpos_x_ in
                  
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 23839 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 23845 "src/reason-parser/reason_parser.ml"
                
              in
              
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 23851 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos__2_ = _endpos__3_ in
            
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 23863 "src/reason-parser/reason_parser.ml"
            
          in
          
# 183 "<standard.mly>"
    ( x )
# 23869 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4833 "src/reason-parser/reason_parser.mly"
                   ( _2 :: _1 )
# 23875 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _1_inlined2 : (unit option) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = let _2 =
          let (_startpos__1_inlined1_, _1_inlined1, _1) = (_startpos__1_inlined2_, _1_inlined2, _1_inlined1) in
          let x =
            let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
            let _2 =
              let _1 =
                let _1 =
                  let _endpos = _endpos_x_ in
                  let _symbolstartpos = _startpos_x_ in
                  
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 23934 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 23940 "src/reason-parser/reason_parser.ml"
                
              in
              
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 23946 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos__2_ = _endpos_x_ in
            
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 23958 "src/reason-parser/reason_parser.ml"
            
          in
          
# 183 "<standard.mly>"
    ( x )
# 23964 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4833 "src/reason-parser/reason_parser.mly"
                   ( _2 :: _1 )
# 23970 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : ((Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 24010 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3159 "src/reason-parser/reason_parser.mly"
 ( _1, _2 )
# 24016 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = 
# 142 "<standard.mly>"
    ( [] )
# 24036 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined1 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let x =
          let _1 =
            let _1 =
              let x =
                let _1 = _1_inlined1 in
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 24091 "src/reason-parser/reason_parser.ml"
                 in
                
# 2322 "src/reason-parser/reason_parser.mly"
                                                             (_1)
# 24096 "src/reason-parser/reason_parser.ml"
                
              in
              
# 200 "<standard.mly>"
    ( x )
# 24102 "src/reason-parser/reason_parser.ml"
              
            in
            
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 24108 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2326 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 24114 "src/reason-parser/reason_parser.ml"
          
        in
        
# 144 "<standard.mly>"
    ( x )
# 24120 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = 
# 142 "<standard.mly>"
    ( [] )
# 24140 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = 
# 144 "<standard.mly>"
    ( x )
# 24169 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = 
# 142 "<standard.mly>"
    ( [] )
# 24187 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = let x = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 24212 "src/reason-parser/reason_parser.ml"
         in
        
# 144 "<standard.mly>"
    ( x )
# 24217 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = 
# 142 "<standard.mly>"
    ( [] )
# 24237 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = 
# 144 "<standard.mly>"
    ( x )
# 24266 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 142 "<standard.mly>"
    ( [] )
# 24284 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = let x =
          let _1 = 
# 200 "<standard.mly>"
    ( x )
# 24324 "src/reason-parser/reason_parser.ml"
           in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 24329 "src/reason-parser/reason_parser.ml"
          
        in
        
# 144 "<standard.mly>"
    ( x )
# 24335 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = 
# 142 "<standard.mly>"
    ( [] )
# 24355 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let x : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let x =
          let _1 = 
# 200 "<standard.mly>"
    ( x )
# 24399 "src/reason-parser/reason_parser.ml"
           in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 24404 "src/reason-parser/reason_parser.ml"
          
        in
        
# 144 "<standard.mly>"
    ( x )
# 24410 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (string list) = 
# 142 "<standard.mly>"
    ( [] )
# 24428 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (string list) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (string list) = let x = 
# 183 "<standard.mly>"
    ( x )
# 24460 "src/reason-parser/reason_parser.ml"
         in
        
# 144 "<standard.mly>"
    ( x )
# 24465 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = 
# 142 "<standard.mly>"
    ( [] )
# 24483 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = 
# 144 "<standard.mly>"
    ( x )
# 24508 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = 
# 142 "<standard.mly>"
    ( [] )
# 24526 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.pattern) list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = let x =
          let x =
            let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 24560 "src/reason-parser/reason_parser.ml"
             in
            
# 3713 "src/reason-parser/reason_parser.mly"
  ( let msg = "Array's `...` spread is not supported in pattern matches.
Explanation: such spread would create a subarray; out of performance concern, our pattern matching currently guarantees to never create new intermediate data.
Solution: if it's to validate the first few elements, use a `when` clause + Array size check + `get` checks on the current pattern. If it's to obtain a subarray, use `Array.sub` or `Belt.Array.slice`." in
    filter_raise_spread_syntax msg _1 )
# 24568 "src/reason-parser/reason_parser.ml"
            
          in
          
# 191 "<standard.mly>"
    ( x )
# 24574 "src/reason-parser/reason_parser.ml"
          
        in
        
# 144 "<standard.mly>"
    ( x )
# 24580 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 142 "<standard.mly>"
    ( [] )
# 24598 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 144 "<standard.mly>"
    ( x )
# 24623 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.with_constraint list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 24648 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.with_constraint list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.with_constraint list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 24687 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 24712 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 24751 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 24776 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 24815 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 24840 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 24879 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 24904 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 24943 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Reason_parser_def.labelled_parameter Location.loc) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 24968 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Reason_parser_def.labelled_parameter Location.loc) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Reason_parser_def.labelled_parameter Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Reason_parser_def.labelled_parameter Location.loc list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25007 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25032 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Longident.t) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25071 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25096 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25135 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25164 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25209 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25237 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25281 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) = let _1 = 
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 25318 "src/reason-parser/reason_parser.ml"
         in
        
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25323 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_inlined1_ in
        let _v : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) = let _3 =
          let (_endpos__2_, _startpos__1_, _2, _1) = (_endpos__2_inlined1_, _startpos__1_inlined1_, _2_inlined1, _1_inlined1) in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 25376 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25382 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = let _1 =
          let _2 =
            let _1 =
              let _1 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 25436 "src/reason-parser/reason_parser.ml"
                
              in
              
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 25442 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 25448 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos__2_ = _endpos__3_ in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 25460 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25466 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = let _1 =
          let _2 =
            let _1 =
              let _1 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 25506 "src/reason-parser/reason_parser.ml"
                
              in
              
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 25512 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 25518 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos__2_ = _endpos_x_ in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 25530 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25536 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = let _3 =
          let (_startpos__1_, _2, _1) = (_startpos__1_inlined1_, _2_inlined1, _1_inlined1) in
          let _2 =
            let _1 =
              let _1 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 25607 "src/reason-parser/reason_parser.ml"
                
              in
              
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 25613 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 25619 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos__2_ = _endpos__3_ in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 25631 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25637 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = let _3 =
          let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
          let _2 =
            let _1 =
              let _1 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 25694 "src/reason-parser/reason_parser.ml"
                
              in
              
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 25700 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 25706 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos__2_ = _endpos_x_ in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 25718 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25724 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.pattern) list) = let _1 = 
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 25761 "src/reason-parser/reason_parser.ml"
         in
        
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25766 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.pattern) list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_inlined1_ in
        let _v : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.pattern) list) = let _3 =
          let (_endpos__2_, _startpos__1_, _2, _1) = (_endpos__2_inlined1_, _startpos__1_inlined1_, _2_inlined1, _1_inlined1) in
          
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 25819 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25825 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25850 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25889 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25914 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 25953 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 25978 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26017 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 26043 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26084 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 26112 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26156 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 26184 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26228 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 26256 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26300 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) = let _1 =
          let _2 =
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 26340 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4242 "src/reason-parser/reason_parser.mly"
  ( let uncurried = match _1 with | Some _ -> true | None -> false in
    match _2.txt with
    | _ -> (_2, uncurried)
  )
# 26354 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 26360 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) = let _3 =
          let _1 = _1_inlined1 in
          let _2 =
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 26418 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4242 "src/reason-parser/reason_parser.mly"
  ( let uncurried = match _1 with | Some _ -> true | None -> false in
    match _2.txt with
    | _ -> (_2, uncurried)
  )
# 26432 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26438 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : (unit option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let _endpos = _endpos__2_ in
          let _startpos = _startpos__1_ in
          
# 3146 "src/reason-parser/reason_parser.mly"
                      (
    let uncurried = match _1 with | Some _ -> true | None -> false in
    if uncurried then
      let (lbl, argExpr) = _2 in
      let loc = mklocation _startpos _endpos in
      let up = uncurry_payload ~name:"uncurry" loc in
      (lbl, {argExpr with pexp_attributes = up::argExpr.pexp_attributes})
    else _2
  )
# 26484 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 26490 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_inlined1_ in
        let _v : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _3 =
          let (_endpos__2_, _startpos__1_, _2, _1) = (_endpos__2_inlined1_, _startpos__1_inlined1_, _2_inlined1, _1_inlined1) in
          let _endpos = _endpos__2_ in
          let _startpos = _startpos__1_ in
          
# 3146 "src/reason-parser/reason_parser.mly"
                      (
    let uncurried = match _1 with | Some _ -> true | None -> false in
    if uncurried then
      let (lbl, argExpr) = _2 in
      let loc = mklocation _startpos _endpos in
      let up = uncurry_payload ~name:"uncurry" loc in
      (lbl, {argExpr with pexp_attributes = up::argExpr.pexp_attributes})
    else _2
  )
# 26553 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26559 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 26584 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_field list list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26623 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list list) = 
# 4844 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 26648 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list list) = 
# 4845 "src/reason-parser/reason_parser.mly"
                                               ( _3 :: _1 )
# 26687 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression option) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.case) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 26743 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3317 "src/reason-parser/reason_parser.mly"
  ( let pat = {_2 with ppat_loc =
      { _2.ppat_loc with
        loc_start = _1.loc.loc_start
      }
    } in
    Exp.case pat ?guard:_3 _5 )
# 26754 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression option) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.case) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 26810 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3317 "src/reason-parser/reason_parser.mly"
  ( let pat = {_2 with ppat_loc =
      { _2.ppat_loc with
        loc_start = _1.loc.loc_start
      }
    } in
    Exp.case pat ?guard:_3 _5 )
# 26821 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 26868 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _3 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 26880 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 26888 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__5_ in
        let _startpos = _startpos__1_ in
        
# 2068 "src/reason-parser/reason_parser.mly"
    ( if _1 = Override then
        syntax_error (mklocation _startpos _endpos)
          "cannot override a virtual method";
      (_3, Cfk_virtual _5)
    )
# 26900 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 26934 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 26945 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 26953 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2074 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      (_2, Cfk_concrete (_1, mkexp ~ghost:true ~loc (Pexp_poly (_3, None))))
    )
# 26967 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 27008 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 27019 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 27027 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2080 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      (_2, Cfk_concrete (_1, mkexp ~ghost:true ~loc (Pexp_poly(_4, _3))))
    )
# 27041 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _8;
          MenhirLib.EngineTypes.startp = _startpos__8_;
          MenhirLib.EngineTypes.endp = _endpos__8_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _8 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (string list) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 27110 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__8_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 27121 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 27129 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__2_ = _startpos__1_inlined1_ in
        let _endpos = _endpos__8_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2088 "src/reason-parser/reason_parser.mly"
    (
      (* For non, methods we'd create a pattern binding:
         ((Ppat_constraint(mkpatvar ..., Ptyp_poly (typeVars, poly_type_varified))),
          exp_with_newtypes_constrained_by_non_varified)

         For methods, we create:
         Pexp_poly (Pexp_constraint (methodFunWithNewtypes, non_varified), Some (Ptyp_poly newTypes varified))
       *)
      let (exp_non_varified, poly_vars) = wrap_type_annotation _5 _7 _8 in
      let exp = Pexp_poly(exp_non_varified, Some poly_vars) in
      let loc = mklocation _symbolstartpos _endpos in
      (_2, Cfk_concrete (_1, mkexp ~ghost:true ~loc exp))
    )
# 27153 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _1_inlined2 : (Longident.t list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 27195 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = let _2 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let _1 =
            let x =
              let _1 = _1_inlined1 in
              
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 27208 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 27214 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 27220 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__2_ = _endpos__3_ in
        let _1 = 
# 4542 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 27227 "src/reason-parser/reason_parser.ml"
         in
        let _endpos = _endpos__2_ in
        let _startpos = _startpos__1_ in
        
# 4550 "src/reason-parser/reason_parser.mly"
  ( if not !Clflags.applicative_functors then (
      let loc = mklocation _startpos _endpos in
      raise_error (Applicative_path loc) loc
    );
    List.fold_left (fun p1 p2 -> Lapply (p1, p2)) _1 _2
  )
# 27239 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3_inlined1 : unit = Obj.magic _3_inlined1 in
        let _1_inlined2 : (Longident.t list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _3 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 27293 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_inlined1_ in
        let _v : (Longident.t) = let _2 =
          let (_3, _1_inlined1, _1) = (_3_inlined1, _1_inlined2, _1_inlined1) in
          let _1 =
            let x =
              let _1 = _1_inlined1 in
              
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 27308 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 27314 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 27320 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__2_ = _endpos__3_inlined1_ in
        let _1 =
          let _2 = _2_inlined1 in
          
# 4543 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 27329 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__2_ in
        let _startpos = _startpos__1_ in
        
# 4550 "src/reason-parser/reason_parser.mly"
  ( if not !Clflags.applicative_functors then (
      let loc = mklocation _startpos _endpos in
      raise_error (Applicative_path loc) loc
    );
    List.fold_left (fun p1 p2 -> Lapply (p1, p2)) _1 _2
  )
# 27342 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _1_inlined2 : (Longident.t list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = let _2 =
          let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
          let _1 =
            let x =
              let _1 = _1_inlined1 in
              
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 27393 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 27399 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 27405 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__2_ = _endpos__3_ in
        let _1 = 
# 4544 "src/reason-parser/reason_parser.mly"
                                  ( _1 )
# 27412 "src/reason-parser/reason_parser.ml"
         in
        let _endpos = _endpos__2_ in
        let _startpos = _startpos__1_ in
        
# 4550 "src/reason-parser/reason_parser.mly"
  ( if not !Clflags.applicative_functors then (
      let loc = mklocation _startpos _endpos in
      raise_error (Applicative_path loc) loc
    );
    List.fold_left (fun p1 p2 -> Lapply (p1, p2)) _1 _2
  )
# 27424 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 27445 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = let _1 = 
# 4542 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 27453 "src/reason-parser/reason_parser.ml"
         in
        
# 4539 "src/reason-parser/reason_parser.mly"
                                      ( _1 )
# 27458 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 27491 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = let _1 = 
# 4543 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 27501 "src/reason-parser/reason_parser.ml"
         in
        
# 4539 "src/reason-parser/reason_parser.mly"
                                      ( _1 )
# 27506 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = let _1 = 
# 4544 "src/reason-parser/reason_parser.mly"
                                  ( _1 )
# 27531 "src/reason-parser/reason_parser.ml"
         in
        
# 4539 "src/reason-parser/reason_parser.mly"
                                      ( _1 )
# 27536 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 27557 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4535 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 27565 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 27598 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = 
# 4536 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 27608 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = 
# 1468 "src/reason-parser/reason_parser.mly"
                          ( [_1] )
# 27633 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let x : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = let _1 =
          let _1 = 
# 200 "<standard.mly>"
    ( x )
# 27673 "src/reason-parser/reason_parser.ml"
           in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 27678 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__1_ = _endpos__3_ in
        let _endpos = _endpos__1_ in
        let _startpos = _startpos__1_ in
        
# 1470 "src/reason-parser/reason_parser.mly"
    ( match _1 with
      | [] -> [mkmod ~loc:(mklocation _startpos _endpos) (Pmod_structure [])]
      | xs -> xs
    )
# 27690 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = let _1 = 
# 4837 "src/reason-parser/reason_parser.mly"
                ( [] )
# 27715 "src/reason-parser/reason_parser.ml"
         in
        
# 1465 "src/reason-parser/reason_parser.mly"
                                                     (_1)
# 27720 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = let _1 =
          let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 27753 "src/reason-parser/reason_parser.ml"
           in
          
# 4838 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 27758 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1465 "src/reason-parser/reason_parser.mly"
                                                     (_1)
# 27764 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _2 in
        let _1 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = 
# 1671 "src/reason-parser/reason_parser.mly"
    ( mk_functor_mod _1 _2 )
# 27798 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = 
# 1673 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos__3_ _endpos__4_ in
      mk_functor_mod _1 (mkmod ~loc (Pmod_constraint(_4, _3))) )
# 27847 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1445 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 27873 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 27881 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1462 "src/reason-parser/reason_parser.mly"
    (_1)
# 27887 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1447 "src/reason-parser/reason_parser.mly"
    ( mkmod(Pmod_constraint(_1, _3)) )
# 27927 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 27935 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1462 "src/reason-parser/reason_parser.mly"
    (_1)
# 27941 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1449 "src/reason-parser/reason_parser.mly"
    ( mkmod(Pmod_unpack _2) )
# 27974 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 27982 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1462 "src/reason-parser/reason_parser.mly"
    (_1)
# 27988 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x =
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 1451 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkmod (Pmod_unpack(
           mkexp ~ghost:true ~loc (Pexp_constraint(_2, _5))))
    )
# 28048 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28057 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1462 "src/reason-parser/reason_parser.mly"
    (_1)
# 28063 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _8;
          MenhirLib.EngineTypes.startp = _startpos__8_;
          MenhirLib.EngineTypes.endp = _endpos__8_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _8 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _8 in
        let _7 : (unit option) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__8_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x =
            let _endpos = _endpos__8_ in
            let _symbolstartpos = _startpos__1_ in
            
# 1456 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkmod (Pmod_unpack(mkexp ~ghost:true ~loc (Pexp_coerce(_2, Some _5, _8)))) )
# 28142 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__8_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28151 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1462 "src/reason-parser/reason_parser.mly"
    (_1)
# 28157 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x =
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 1459 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkmod (Pmod_unpack(mkexp ~ghost:true ~loc (Pexp_coerce(_2, None, _5))))
    )
# 28216 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28225 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1462 "src/reason-parser/reason_parser.mly"
    (_1)
# 28231 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _2 in
        let _1 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = 
# 1891 "src/reason-parser/reason_parser.mly"
  ( mk_functor_mty _1 _2 )
# 28265 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 28295 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1486 "src/reason-parser/reason_parser.mly"
    ( mkmod(Pmod_ident _1) )
# 28301 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28309 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1513 "src/reason-parser/reason_parser.mly"
    (_1)
# 28315 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1487 "src/reason-parser/reason_parser.mly"
                          ( _1 )
# 28341 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28349 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1513 "src/reason-parser/reason_parser.mly"
    (_1)
# 28355 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1489 "src/reason-parser/reason_parser.mly"
    ( _2 )
# 28395 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28403 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1513 "src/reason-parser/reason_parser.mly"
    (_1)
# 28409 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1491 "src/reason-parser/reason_parser.mly"
    ( mkmod (Pmod_structure []) )
# 28442 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28450 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1513 "src/reason-parser/reason_parser.mly"
    (_1)
# 28456 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1493 "src/reason-parser/reason_parser.mly"
    ( mkmod (Pmod_extension _1) )
# 28482 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28490 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1513 "src/reason-parser/reason_parser.mly"
    (_1)
# 28496 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type option) = Obj.magic _3 in
        let _2 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = Obj.magic _2 in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x =
            let _endpos = _endpos__5_ in
            
# 1501 "src/reason-parser/reason_parser.mly"
    ( let me = match _3 with
        | None -> _5
        | Some mt ->
          let loc = mklocation _startpos__3_ _endpos in
          mkmod ~loc (Pmod_constraint(_5, mt))
      in
      mk_functor_mod _2 me
    )
# 28561 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28570 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1513 "src/reason-parser/reason_parser.mly"
    (_1)
# 28576 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1510 "src/reason-parser/reason_parser.mly"
    ( List.fold_left mkmod_app _1 _2 )
# 28609 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28617 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1513 "src/reason-parser/reason_parser.mly"
    (_1)
# 28623 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 =
          let x = 
# 1512 "src/reason-parser/reason_parser.mly"
    ( {_2 with pmod_attributes = _1 :: _2.pmod_attributes} )
# 28656 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4769 "src/reason-parser/reason_parser.mly"
  ( {x with pmod_loc = {x.pmod_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 28664 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1513 "src/reason-parser/reason_parser.mly"
    (_1)
# 28670 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _1 = 
# 183 "<standard.mly>"
    ( x )
# 28702 "src/reason-parser/reason_parser.ml"
         in
        
# 1476 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 28707 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = 
# 1476 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 28732 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 1480 "src/reason-parser/reason_parser.mly"
  ( mkmod ~loc:(mklocation _startpos _endpos) (Pmod_structure(_2)) )
# 28773 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = let _1 =
          let x =
            let _endpos = _endpos__2_ in
            let _startpos = _startpos__1_ in
            
# 1413 "src/reason-parser/reason_parser.mly"
    ( (Some (mkloc "*" (mklocation _startpos _endpos)), None) )
# 28811 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 28820 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1418 "src/reason-parser/reason_parser.mly"
  (_1)
# 28826 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 28861 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = let _1 =
          let x =
            let _1 =
              let x = 
# 1414 "src/reason-parser/reason_parser.mly"
                  (_1)
# 28874 "src/reason-parser/reason_parser.ml"
               in
              let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 28882 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1415 "src/reason-parser/reason_parser.mly"
    ( (Some _1, Some _3) )
# 28888 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 28897 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1418 "src/reason-parser/reason_parser.mly"
  (_1)
# 28903 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = let _1 =
          let x =
            let _1 =
              let x = 
# 1414 "src/reason-parser/reason_parser.mly"
                                    ("_")
# 28947 "src/reason-parser/reason_parser.ml"
               in
              let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 28955 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1415 "src/reason-parser/reason_parser.mly"
    ( (Some _1, Some _3) )
# 28961 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 28970 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1418 "src/reason-parser/reason_parser.mly"
  (_1)
# 28976 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = let _1 =
          let x = 
# 1417 "src/reason-parser/reason_parser.mly"
    ( (None, Some _1) )
# 29004 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 29012 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1418 "src/reason-parser/reason_parser.mly"
  (_1)
# 29018 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined2;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined2 : (Migrate_parsetree.Ast_404.Parsetree.with_constraint list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x =
            let _2 =
              let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
              let _2 =
                let _1 = _1_inlined1 in
                
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 29063 "src/reason-parser/reason_parser.ml"
                
              in
              
# 1734 "src/reason-parser/reason_parser.mly"
                                                      ( _2 )
# 29069 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1754 "src/reason-parser/reason_parser.mly"
    ( mkmty (Pmty_with(_1, _2)) )
# 29075 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 29084 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1807 "src/reason-parser/reason_parser.mly"
    (_1)
# 29090 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x = 
# 1756 "src/reason-parser/reason_parser.mly"
    (_1)
# 29116 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 29124 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1807 "src/reason-parser/reason_parser.mly"
    (_1)
# 29130 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x = 
# 1758 "src/reason-parser/reason_parser.mly"
    ( mkmty (Pmty_typeof _5) )
# 29191 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 29199 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1807 "src/reason-parser/reason_parser.mly"
    (_1)
# 29205 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x = 
# 1760 "src/reason-parser/reason_parser.mly"
    ( {_2 with pmty_attributes = _1 :: _2.pmty_attributes} )
# 29238 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 29246 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1807 "src/reason-parser/reason_parser.mly"
    (_1)
# 29252 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x = 
# 1806 "src/reason-parser/reason_parser.mly"
    ( mk_functor_mty _1 _3 )
# 29294 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 29302 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1807 "src/reason-parser/reason_parser.mly"
    (_1)
# 29308 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = 
# 1895 "src/reason-parser/reason_parser.mly"
                      ( _2 )
# 29340 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = 
# 1896 "src/reason-parser/reason_parser.mly"
                          ( _1 )
# 29365 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = 
# 1895 "src/reason-parser/reason_parser.mly"
                      ( _2 )
# 29397 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = 
# 1896 "src/reason-parser/reason_parser.mly"
                          ( _1 )
# 29422 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 1716 "src/reason-parser/reason_parser.mly"
  ( mkmty ~loc:(mklocation _startpos _endpos) (Pmty_signature _2) )
# 29463 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (string) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4559 "src/reason-parser/reason_parser.mly"
                                 ( Lident _1 )
# 29488 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = 
# 4560 "src/reason-parser/reason_parser.mly"
                                 ( Ldot(_1, _3) )
# 29527 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = 
# 4617 "src/reason-parser/reason_parser.mly"
                  ( Immutable )
# 29545 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = 
# 4618 "src/reason-parser/reason_parser.mly"
                  ( Mutable )
# 29570 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = 
# 4627 "src/reason-parser/reason_parser.mly"
                  ( Immutable, Concrete )
# 29589 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = 
# 4628 "src/reason-parser/reason_parser.mly"
                         ( _2, Virtual )
# 29622 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = 
# 4629 "src/reason-parser/reason_parser.mly"
                         ( Mutable, _2 )
# 29655 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4284 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 29680 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4286 "src/reason-parser/reason_parser.mly"
    ( {_2 with ptyp_attributes = _1 :: _2.ptyp_attributes} )
# 29712 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4317 "src/reason-parser/reason_parser.mly"
                                        ( _1 )
# 29737 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 29765 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4318 "src/reason-parser/reason_parser.mly"
                                       ( _1 )
# 29771 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4310 "src/reason-parser/reason_parser.mly"
    ( match _1 with
      | [one] -> one
      | many -> mktyp (Ptyp_tuple many)
    )
# 29800 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 29808 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4314 "src/reason-parser/reason_parser.mly"
    (_1)
# 29814 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = let _1 =
          let _1 =
            let x =
              let _1 = _1_inlined1 in
              let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 29864 "src/reason-parser/reason_parser.ml"
               in
              
# 3106 "src/reason-parser/reason_parser.mly"
                                                                   ( _1 )
# 29869 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 29875 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 29881 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3109 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 29887 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression list) = let _endpos = _endpos__2_ in
        let _startpos = _startpos__1_ in
        
# 3111 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos _endpos in
      [mkexp_constructor_unit loc loc] )
# 29922 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 29943 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (string list) = 
# 221 "<standard.mly>"
    ( [ x ] )
# 29951 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (string list) = Obj.magic xs in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 29979 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (string list) = 
# 223 "<standard.mly>"
    ( x :: xs )
# 29987 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 30008 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string list) = let x = 
# 3763 "src/reason-parser/reason_parser.mly"
                                            ( let (s, _, _) = _1 in s )
# 30016 "src/reason-parser/reason_parser.ml"
         in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30021 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (string list) = Obj.magic xs in
        let _1 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 30049 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (string list) = let x = 
# 3763 "src/reason-parser/reason_parser.mly"
                                            ( let (s, _, _) = _1 in s )
# 30057 "src/reason-parser/reason_parser.ml"
         in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 30062 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = let x =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 30090 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30096 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic xs in
        let x : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = let x =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 30131 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 30137 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30170 "src/reason-parser/reason_parser.ml"
           in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30175 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30180 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30186 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30227 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30232 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30238 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30243 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30249 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30289 "src/reason-parser/reason_parser.ml"
           in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30295 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30300 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30306 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30312 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1_inlined1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = _1_inlined1 in
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30361 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30366 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30373 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30378 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30384 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30390 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30430 "src/reason-parser/reason_parser.ml"
           in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30435 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30440 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 30446 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30494 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30499 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30505 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30510 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 30516 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30563 "src/reason-parser/reason_parser.ml"
           in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30569 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30574 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30580 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 30586 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1_inlined1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = _1_inlined1 in
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30642 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30647 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30654 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30659 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30665 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 30671 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30704 "src/reason-parser/reason_parser.ml"
           in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30709 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30714 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30720 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30761 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30766 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30772 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30777 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30783 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30823 "src/reason-parser/reason_parser.ml"
           in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30829 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30834 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30840 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30846 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1_inlined1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = _1_inlined1 in
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30895 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30900 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 30907 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 30912 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30918 "src/reason-parser/reason_parser.ml"
          
        in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 30924 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30964 "src/reason-parser/reason_parser.ml"
           in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 30969 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 30974 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 30980 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 31028 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 31033 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 31039 "src/reason-parser/reason_parser.ml"
           in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 31044 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 31050 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 31097 "src/reason-parser/reason_parser.ml"
           in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 31103 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 31108 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 31114 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 31120 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic xs in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _4 in
        let _1_inlined1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = let x =
          let _3 =
            let _1 = _1_inlined1 in
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 31176 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 31181 "src/reason-parser/reason_parser.ml"
            
          in
          let _1 =
            let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 31188 "src/reason-parser/reason_parser.ml"
             in
            
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 31193 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4000 "src/reason-parser/reason_parser.mly"
                                        ( {_4 with pext_attributes = List.concat [_1; _3; _4.pext_attributes]} )
# 31199 "src/reason-parser/reason_parser.ml"
          
        in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 31205 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (string list) = let x = 
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 31237 "src/reason-parser/reason_parser.ml"
         in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 31242 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : (string list) = Obj.magic xs in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (string list) = let x = 
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 31281 "src/reason-parser/reason_parser.ml"
         in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 31286 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list) = let x = 
# 183 "<standard.mly>"
    ( x )
# 31321 "src/reason-parser/reason_parser.ml"
         in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 31326 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list) = Obj.magic xs in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list) = let x = 
# 183 "<standard.mly>"
    ( x )
# 31370 "src/reason-parser/reason_parser.ml"
         in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 31375 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (string) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (string list) = let x = 
# 183 "<standard.mly>"
    ( x )
# 31407 "src/reason-parser/reason_parser.ml"
         in
        
# 221 "<standard.mly>"
    ( [ x ] )
# 31412 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : (string list) = Obj.magic xs in
        let x : (string) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_xs_ in
        let _v : (string list) = let x = 
# 183 "<standard.mly>"
    ( x )
# 31451 "src/reason-parser/reason_parser.ml"
         in
        
# 223 "<standard.mly>"
    ( x :: xs )
# 31456 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = 
# 4602 "src/reason-parser/reason_parser.mly"
                  ( Recursive )
# 31474 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = 
# 4603 "src/reason-parser/reason_parser.mly"
                  ( Nonrecursive )
# 31499 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic x in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_structure) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 31534 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1951 "src/reason-parser/reason_parser.mly"
    ( let attrs = List.map (fun x -> mkcf ~loc:x.loc (Pcf_attribute x.txt)) _1 in
      Cstr.mk _2 attrs )
# 31541 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let x : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic x in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_structure) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 31590 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1956 "src/reason-parser/reason_parser.mly"
    ( let attrs = List.map (fun x -> mkcf ~loc:x.loc (Pcf_attribute x.txt)) _1 in
      Cstr.mk _2 (attrs @ _4) )
# 31597 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_structure) = let _endpos = _endpos__1_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _endpos in
        
# 1959 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _symbolstartpos in
      Cstr.mk (mkpat ~loc (Ppat_var (mkloc "this" loc))) _1 )
# 31628 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 = 
# 4837 "src/reason-parser/reason_parser.mly"
                ( [] )
# 31653 "src/reason-parser/reason_parser.ml"
         in
        
# 1946 "src/reason-parser/reason_parser.mly"
                                             ( List.concat _1 )
# 31658 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.class_field list list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_field list) = let _1 =
          let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 31691 "src/reason-parser/reason_parser.ml"
           in
          
# 4838 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 31696 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1946 "src/reason-parser/reason_parser.mly"
                                             ( List.concat _1 )
# 31702 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 31723 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 31735 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 31741 "src/reason-parser/reason_parser.ml"
         in
        
# 4369 "src/reason-parser/reason_parser.mly"
    ( (_2.txt, _1, mkct _2) )
# 31746 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 31773 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 31786 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 31793 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 31798 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4369 "src/reason-parser/reason_parser.mly"
    ( (_2.txt, _1, mkct _2) )
# 31804 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 31839 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 31848 "src/reason-parser/reason_parser.ml"
         in
        
# 4371 "src/reason-parser/reason_parser.mly"
    ( (_2, _1, _4) )
# 31853 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 31894 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 31905 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 31910 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4371 "src/reason-parser/reason_parser.mly"
    ( (_2, _1, _4) )
# 31916 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 31952 "src/reason-parser/reason_parser.ml"
         in
        
# 4375 "src/reason-parser/reason_parser.mly"
                                                                   ( _1 )
# 31957 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4349 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      syntax_error_typ loc "an object type cannot be empty" )
# 31992 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _endpos = _endpos__4_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4352 "src/reason-parser/reason_parser.mly"
    ( (* `{. "foo": bar}` -> `Js.t({. foo: bar})` *)
      let loc = mklocation _symbolstartpos _endpos in
      mkBsObjTypeSugar ~loc ~closed:Closed _3
    )
# 32045 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _endpos = _endpos__4_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4357 "src/reason-parser/reason_parser.mly"
    ( (* `{.. "foo": bar}` -> `Js.t({.. foo: bar})` *)
      let loc = mklocation _symbolstartpos _endpos in
      mkBsObjTypeSugar ~loc ~closed:Open _3
    )
# 32098 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4362 "src/reason-parser/reason_parser.mly"
    ( mktyp (Ptyp_object (_3, Closed)) )
# 32146 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4364 "src/reason-parser/reason_parser.mly"
    ( mktyp (Ptyp_object (_3, Open)) )
# 32194 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.open_description) = let _4 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 32236 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__4_ = _endpos_x_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 32243 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1886 "src/reason-parser/reason_parser.mly"
  ( Opn.mk _4 ~override:_3 ~attrs:_1 ~loc:(mklocation _symbolstartpos _endpos) )
# 32254 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.open_description) = let _4 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 32303 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__4_ = _endpos_x_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 32311 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 32316 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1886 "src/reason-parser/reason_parser.mly"
  ( Opn.mk _4 ~override:_3 ~attrs:_1 ~loc:(mklocation _symbolstartpos _endpos) )
# 32327 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1142 "src/reason-parser/reason_parser.mly"
       (string)
# 32348 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4494 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32356 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1143 "src/reason-parser/reason_parser.mly"
       (string)
# 32377 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4495 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32385 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4496 "src/reason-parser/reason_parser.mly"
                      ( "!" )
# 32410 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1093 "src/reason-parser/reason_parser.mly"
       (string)
# 32431 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4461 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32439 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32444 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1094 "src/reason-parser/reason_parser.mly"
       (string)
# 32465 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4462 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32473 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32478 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1095 "src/reason-parser/reason_parser.mly"
       (string)
# 32499 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4463 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32507 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32512 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1096 "src/reason-parser/reason_parser.mly"
       (string)
# 32533 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4464 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32541 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32546 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4466 "src/reason-parser/reason_parser.mly"
                      ( "/>" )
# 32571 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32576 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1099 "src/reason-parser/reason_parser.mly"
       (string)
# 32597 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4467 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32605 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32610 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4468 "src/reason-parser/reason_parser.mly"
                      ( "+" )
# 32635 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32640 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4469 "src/reason-parser/reason_parser.mly"
                      ( "+." )
# 32665 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32670 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4470 "src/reason-parser/reason_parser.mly"
                      ( "-" )
# 32695 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32700 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4471 "src/reason-parser/reason_parser.mly"
                      ( "-." )
# 32725 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32730 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4472 "src/reason-parser/reason_parser.mly"
                      ( "*" )
# 32755 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32760 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4473 "src/reason-parser/reason_parser.mly"
                      ( "<" )
# 32785 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32790 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4474 "src/reason-parser/reason_parser.mly"
                      ( ">" )
# 32815 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32820 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4475 "src/reason-parser/reason_parser.mly"
                      ( "or" )
# 32845 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32850 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4476 "src/reason-parser/reason_parser.mly"
                      ( "||" )
# 32875 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32880 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4477 "src/reason-parser/reason_parser.mly"
                      ( "&" )
# 32905 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32910 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4478 "src/reason-parser/reason_parser.mly"
                      ( "&&" )
# 32935 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32940 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4479 "src/reason-parser/reason_parser.mly"
                      ( ":=" )
# 32965 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 32970 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4480 "src/reason-parser/reason_parser.mly"
                      ( "+=" )
# 32995 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 33000 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4481 "src/reason-parser/reason_parser.mly"
                      ( "%" )
# 33025 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 33030 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4488 "src/reason-parser/reason_parser.mly"
                      ( "<..>" )
# 33055 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 33060 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (string) = let _1 = 
# 4489 "src/reason-parser/reason_parser.mly"
                      ( ">>" )
# 33092 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 33097 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = let _1 = 
# 4490 "src/reason-parser/reason_parser.mly"
                     ( ">..." )
# 33122 "src/reason-parser/reason_parser.ml"
         in
        
# 4497 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 33127 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (unit) = 
# 4590 "src/reason-parser/reason_parser.mly"
                       ( () )
# 33152 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (unit) = 
# 4590 "src/reason-parser/reason_parser.mly"
                                           ( () )
# 33184 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 33217 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 33230 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1601 "src/reason-parser/reason_parser.mly"
                                      ( _3 )
# 33236 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 33269 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 33282 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1603 "src/reason-parser/reason_parser.mly"
    ( syntax_error _3.loc lowercase_module_msg; _3 )
# 33288 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 33315 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 33327 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1595 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 33333 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 33360 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (unit) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.str) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 33372 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1597 "src/reason-parser/reason_parser.mly"
    ( syntax_error _2.loc lowercase_module_msg; _2 )
# 33378 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (unit option) = 
# 114 "<standard.mly>"
    ( None )
# 33396 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (unit option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33421 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (unit option) = 
# 114 "<standard.mly>"
    ( None )
# 33439 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (unit option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33464 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (unit option) = 
# 114 "<standard.mly>"
    ( None )
# 33482 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (unit option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33507 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (unit option) = 
# 114 "<standard.mly>"
    ( None )
# 33525 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (unit option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33550 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (unit option) = 
# 114 "<standard.mly>"
    ( None )
# 33568 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (unit option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33593 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (unit option) = 
# 114 "<standard.mly>"
    ( None )
# 33611 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (unit option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33636 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (unit option) = 
# 114 "<standard.mly>"
    ( None )
# 33654 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : unit = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (unit option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33679 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments option) = 
# 114 "<standard.mly>"
    ( None )
# 33697 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33722 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : ((Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) option) = 
# 114 "<standard.mly>"
    ( None )
# 33740 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : ((Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) option) = 
# 116 "<standard.mly>"
    ( Some x )
# 33765 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (string option) = 
# 114 "<standard.mly>"
    ( None )
# 33783 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 33810 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (string option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 33819 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 33824 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type option) = 
# 114 "<standard.mly>"
    ( None )
# 33842 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.class_type) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.class_type option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 33874 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 33879 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 114 "<standard.mly>"
    ( None )
# 33897 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 33929 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 33934 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option) = 
# 114 "<standard.mly>"
    ( None )
# 33952 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 33984 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 33989 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 114 "<standard.mly>"
    ( None )
# 34007 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 34039 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 34044 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 114 "<standard.mly>"
    ( None )
# 34062 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 34094 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 34099 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type option) = 
# 114 "<standard.mly>"
    ( None )
# 34117 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 34149 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 34154 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 114 "<standard.mly>"
    ( None )
# 34172 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 34204 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 34209 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option) = 
# 114 "<standard.mly>"
    ( None )
# 34227 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option) = let x = 
# 183 "<standard.mly>"
    ( x )
# 34259 "src/reason-parser/reason_parser.ml"
         in
        
# 116 "<standard.mly>"
    ( Some x )
# 34264 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = 
# 114 "<standard.mly>"
    ( None )
# 34284 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) = 
# 116 "<standard.mly>"
    ( Some x )
# 34312 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (string -> Migrate_parsetree.Ast_404.Asttypes.arg_label) = 
# 4764 "src/reason-parser/reason_parser.mly"
    ( fun x -> Labelled x )
# 34330 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string -> Migrate_parsetree.Ast_404.Asttypes.arg_label) = 
# 4765 "src/reason-parser/reason_parser.mly"
             ( fun x -> Optional x )
# 34355 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 2724 "src/reason-parser/reason_parser.mly"
                ( fun exp -> exp )
# 34374 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 2725 "src/reason-parser/reason_parser.mly"
                         ( fun exp -> expression_extension _1 exp  )
# 34400 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = 
# 4633 "src/reason-parser/reason_parser.mly"
                  ( Fresh )
# 34418 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = 
# 4634 "src/reason-parser/reason_parser.mly"
                  ( Override )
# 34443 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _endpos = _endpos__1_ in
        let _startpos = _startpos__1_ in
        
# 4387 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    match package_type_of_module_type _1 with
    | Some result -> mktyp ~loc (Ptyp_package result)
    | None ->
       syntax_error_typ _1.pmty_loc
         "only module type identifier and 'with type' constraints are supported"
  )
# 34476 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 2881 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 34501 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 2883 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos _endpos in
      mkexp_constructor_unit ~uncurried:true loc loc )
# 34543 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__3_ in
        let _startpos = _startpos__1_ in
        
# 2886 "src/reason-parser/reason_parser.mly"
    ( may_tuple _startpos _endpos _2 )
# 34584 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (
# 1331 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.core_type)
# 34616 "src/reason-parser/reason_parser.ml"
        ) = 
# 1395 "src/reason-parser/reason_parser.mly"
  ( apply_mapper_to_type _1 reason_mapper )
# 34620 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (
# 1333 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.expression)
# 34652 "src/reason-parser/reason_parser.ml"
        ) = 
# 1400 "src/reason-parser/reason_parser.mly"
  ( apply_mapper_to_expr _1 reason_mapper )
# 34656 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (
# 1335 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.pattern)
# 34688 "src/reason-parser/reason_parser.ml"
        ) = 
# 1405 "src/reason-parser/reason_parser.mly"
  ( apply_mapper_to_pattern _1 reason_mapper )
# 34692 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = 
# 3513 "src/reason-parser/reason_parser.mly"
                       ( _1 )
# 34717 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3514 "src/reason-parser/reason_parser.mly"
                                          ( mkpat(Ppat_or(_1, _3)) )
# 34757 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 34765 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3514 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 34771 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.pattern) list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern list *
  Migrate_parsetree.Ast_404.Parsetree.pattern option) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 34804 "src/reason-parser/reason_parser.ml"
         in
        
# 3721 "src/reason-parser/reason_parser.mly"
  ( match List.rev _1 with
    (* spread syntax is only allowed at the end *)
    | ((dotdotdot, p) as hd)::ps ->
      let (ps, spreadPat) = match dotdotdot with
      | Some _ -> (ps, Some p)
      | None -> (hd::ps, None)
      in
      let msg = "List pattern matches only supports one `...` spread, at the end.
Explanation: a list spread at the tail is efficient, but a spread in the middle would create new list(s); out of performance concern, our pattern matching currently guarantees to never create new intermediate data." in
      let patList = filter_raise_spread_syntax msg ps in
      (List.rev patList, spreadPat)
    | [] -> [], None
  )
# 34821 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = 
# 3522 "src/reason-parser/reason_parser.mly"
    ( [_1] )
# 34846 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = let _1 =
          let _1 =
            let x =
              let _1 = _1_inlined1 in
              let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 34896 "src/reason-parser/reason_parser.ml"
               in
              
# 3518 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 34901 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 34907 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 34913 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3524 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 34919 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3696 "src/reason-parser/reason_parser.mly"
                            ( _1 )
# 34945 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 34953 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3708 "src/reason-parser/reason_parser.mly"
    (_1)
# 34959 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3698 "src/reason-parser/reason_parser.mly"
    ( mkpat(Ppat_constraint(_1, _3)) )
# 34999 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35007 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3708 "src/reason-parser/reason_parser.mly"
    (_1)
# 35013 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x_inlined1;
          MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let x_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 35061 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _4 =
              let (_endpos_x_, _startpos__1_, x, _1) = (_endpos_x_inlined1_, _startpos__1_inlined1_, x_inlined1, _1_inlined1) in
              let x = 
# 183 "<standard.mly>"
    ( x )
# 35074 "src/reason-parser/reason_parser.ml"
               in
              let _startpos_x_ = _startpos__1_ in
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35082 "src/reason-parser/reason_parser.ml"
              
            in
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 35091 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3707 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_constraint (mkpat (Ppat_unpack _2), _4)) )
# 35097 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos_x_inlined1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35106 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3708 "src/reason-parser/reason_parser.mly"
    (_1)
# 35112 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3545 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 35138 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35146 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35152 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 35196 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3548 "src/reason-parser/reason_parser.mly"
    ( mkpat(Ppat_alias(_1, _3)) )
# 35202 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35211 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35217 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 35254 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__2_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3566 "src/reason-parser/reason_parser.mly"
    ( match is_pattern_list_single_any _2 with
      | Some singleAnyPat ->
        mkpat (Ppat_construct(_1, Some singleAnyPat))
      | None ->
        let loc = mklocation _symbolstartpos _endpos in
        let argPattern = simple_pattern_list_to_tuple ~loc _2 in
        mkExplicitArityTuplePat (Ppat_construct(_1, Some argPattern))
    )
# 35270 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__2_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35279 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35285 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _2_inlined1 : (string) = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _1 =
              let _2 = _2_inlined1 in
              
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 35328 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3575 "src/reason-parser/reason_parser.mly"
                            ( mkpat (Ppat_variant(_1, Some _2)) )
# 35334 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35343 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35349 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _3 in
        let x : unit = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 35393 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__3_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3578 "src/reason-parser/reason_parser.mly"
    ( syntax_error _2.loc
        ":: is not supported in Reason, please use [hd, ...tl] instead";
      let loc = mklocation _symbolstartpos _endpos in
      mkpat_cons (mkpat ~ghost:true ~loc (Ppat_tuple[_1;_3])) loc
    )
# 35405 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35414 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35420 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _8;
          MenhirLib.EngineTypes.startp = _startpos__8_;
          MenhirLib.EngineTypes.endp = _endpos__8_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _8 : unit = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__8_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _endpos = _endpos__8_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3585 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkpat_cons (mkpat ~ghost:true ~loc (Ppat_tuple[_5;_7])) loc
    )
# 35500 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__8_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35509 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35515 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3590 "src/reason-parser/reason_parser.mly"
    ( mkpat(Ppat_exception _2) )
# 35548 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35556 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35562 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3592 "src/reason-parser/reason_parser.mly"
                        ( mkpat(Ppat_lazy _2) )
# 35595 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35603 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35609 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3600 "src/reason-parser/reason_parser.mly"
    ( {_2 with ppat_attributes = _1 :: _2.ppat_attributes} )
# 35642 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35650 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3602 "src/reason-parser/reason_parser.mly"
    (_1)
# 35656 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.payload) = 
# 4733 "src/reason-parser/reason_parser.mly"
                                    ( PStr _1 )
# 35681 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.payload) = 
# 4734 "src/reason-parser/reason_parser.mly"
                                    ( PSig _2 )
# 35713 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.payload) = 
# 4735 "src/reason-parser/reason_parser.mly"
                                    ( PTyp _2 )
# 35745 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.payload) = 
# 4736 "src/reason-parser/reason_parser.mly"
                                    ( PPat (_2, None) )
# 35777 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.payload) = 
# 4737 "src/reason-parser/reason_parser.mly"
                                    ( PPat (_2, Some _4) )
# 35823 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.payload) = let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4757 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let expr = Exp.fun_ ~loc Nolabel None _1 _3 in
      PStr([mkstrexp expr []])
    )
# 35867 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4069 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 35893 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35901 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4072 "src/reason-parser/reason_parser.mly"
    (_1)
# 35907 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (string list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 4071 "src/reason-parser/reason_parser.mly"
    ( mktyp(Ptyp_poly(_1, _3)) )
# 35947 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 35955 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4072 "src/reason-parser/reason_parser.mly"
    (_1)
# 35961 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (string list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string list) = 
# 3763 "src/reason-parser/reason_parser.mly"
                                                                         (_1)
# 35986 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let _1 =
            let x = 
# 183 "<standard.mly>"
    ( x )
# 36020 "src/reason-parser/reason_parser.ml"
             in
            let _startpos_x_ = _startpos__1_ in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 36028 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3497 "src/reason-parser/reason_parser.mly"
                                                     (_1)
# 36034 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4304 "src/reason-parser/reason_parser.mly"
                                       ( _1 )
# 36040 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4304 "src/reason-parser/reason_parser.mly"
                                       ( _1 )
# 36065 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = 
# 4597 "src/reason-parser/reason_parser.mly"
                  ( Nonrecursive )
# 36083 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = 
# 4598 "src/reason-parser/reason_parser.mly"
                  ( Recursive )
# 36108 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = let _2 =
          let _1 = _1_inlined1 in
          
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 36156 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3965 "src/reason-parser/reason_parser.mly"
  ( _2 )
# 36162 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined2;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _2;
                        MenhirLib.EngineTypes.startp = _startpos__2_;
                        MenhirLib.EngineTypes.endp = _endpos__2_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _menhir_s;
                          MenhirLib.EngineTypes.semv = _1;
                          MenhirLib.EngineTypes.startp = _startpos__1_;
                          MenhirLib.EngineTypes.endp = _endpos__1_;
                          MenhirLib.EngineTypes.next = _menhir_stack;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (unit option) = Obj.magic _4 in
        let _2_inlined2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2_inlined2 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _1_inlined2 : (unit option) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _3 =
          let (_startpos__1_inlined1_, _2, _1_inlined1, _1) = (_startpos__1_inlined2_, _2_inlined2, _1_inlined2, _1_inlined1) in
          let _1 =
            let _2 = _2_inlined1 in
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 36258 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 36264 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 36270 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos__3_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 36282 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 36288 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 36294 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3381 "src/reason-parser/reason_parser.mly"
    ( let exprList = filter_raise_spread_syntax record_exp_spread_msg _3
      in (Some _2, exprList)
    )
# 36302 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (unit option) = Obj.magic _4 in
        let _2_inlined1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _1_inlined2 : (unit option) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _3 =
          let (_startpos__1_inlined1_, _2, _1_inlined1, _1) = (_startpos__1_inlined2_, _2_inlined1, _1_inlined2, _1_inlined1) in
          let _1 =
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 36383 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 36389 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 36395 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos_x_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 36407 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 36413 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 36419 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3381 "src/reason-parser/reason_parser.mly"
    ( let exprList = filter_raise_spread_syntax record_exp_spread_msg _3
      in (Some _2, exprList)
    )
# 36427 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (unit option) = Obj.magic _5 in
        let _1_inlined1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _4 =
          let _1 = _1_inlined1 in
          
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 36486 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3387 "src/reason-parser/reason_parser.mly"
    ( raise_record_trailing_semi_error'
        (mklocation _startpos__3_ _endpos__3_) )
# 36493 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined2;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _2;
                        MenhirLib.EngineTypes.startp = _startpos__2_;
                        MenhirLib.EngineTypes.endp = _endpos__2_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _menhir_s;
                          MenhirLib.EngineTypes.semv = _1;
                          MenhirLib.EngineTypes.startp = _startpos__1_;
                          MenhirLib.EngineTypes.endp = _endpos__1_;
                          MenhirLib.EngineTypes.next = _menhir_stack;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _2_inlined2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2_inlined2 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _1_inlined2 : (unit option) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _3 =
          let (_startpos__1_inlined1_, _2, _1_inlined1, _1) = (_startpos__1_inlined2_, _2_inlined2, _1_inlined2, _1_inlined1) in
          let _1 =
            let _2 = _2_inlined1 in
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 36589 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 36595 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 36601 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos__3_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 36613 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 36619 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 36625 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3392 "src/reason-parser/reason_parser.mly"
    ( raise_record_trailing_semi_error'
        (mklocation _startpos__4_ _endpos__4_) )
# 36632 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _2_inlined1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _1_inlined2 : (unit option) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _3 =
          let (_startpos__1_inlined1_, _2, _1_inlined1, _1) = (_startpos__1_inlined2_, _2_inlined1, _1_inlined2, _1_inlined1) in
          let _1 =
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 36713 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 36719 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 36725 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos_x_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 36737 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 36743 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 36749 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3392 "src/reason-parser/reason_parser.mly"
    ( raise_record_trailing_semi_error'
        (mklocation _startpos__4_ _endpos__4_) )
# 36756 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let _2 = _2_inlined1 in
          let _1 =
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 36809 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 36815 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3395 "src/reason-parser/reason_parser.mly"
    ( (None, [_1]) )
# 36821 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let _2 = _2_inlined1 in
          let _1 =
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 36874 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 36880 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3397 "src/reason-parser/reason_parser.mly"
    ( raise_record_trailing_semi_error'
        (mklocation _startpos__2_ _endpos__2_) )
# 36887 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined2;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined2_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _3_inlined1;
                        MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
                        MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = _2_inlined1;
                          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _menhir_s;
                            MenhirLib.EngineTypes.semv = x;
                            MenhirLib.EngineTypes.startp = _startpos_x_;
                            MenhirLib.EngineTypes.endp = _endpos_x_;
                            MenhirLib.EngineTypes.next = _menhir_stack;
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (unit option) = Obj.magic _3 in
        let _2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2 in
        let _3_inlined2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3_inlined2 in
        let _2_inlined2 : unit = Obj.magic _2_inlined2 in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _3_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _2 =
          let (_endpos_x_, _startpos_x_, _endpos__3_, _3, _2_inlined1, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, _endpos__3_inlined2_, _3_inlined2, _2_inlined2, x_inlined1) in
          let _1 =
            let _2 = _2_inlined1 in
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 36990 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 36996 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 37002 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos__3_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 37014 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 37020 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 37026 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let (_3, _2) = (_3_inlined1, _2_inlined1) in
          let _1 =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37038 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 37044 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 37050 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3400 "src/reason-parser/reason_parser.mly"
    ( let exprList = filter_raise_spread_syntax record_exp_spread_msg _2 in
      (None, _1 :: exprList) )
# 37057 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x_inlined1;
              MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = x;
                        MenhirLib.EngineTypes.startp = _startpos_x_;
                        MenhirLib.EngineTypes.endp = _endpos_x_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (unit option) = Obj.magic _3 in
        let _2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2 in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _3_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _2 =
          let (_endpos_x_, _startpos_x_, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, x_inlined1) in
          let _1 =
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37145 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 37151 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 37157 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos_x_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 37169 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 37175 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 37181 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let (_3, _2) = (_3_inlined1, _2_inlined1) in
          let _1 =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37193 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 37199 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 37205 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3400 "src/reason-parser/reason_parser.mly"
    ( let exprList = filter_raise_spread_syntax record_exp_spread_msg _2 in
      (None, _1 :: exprList) )
# 37212 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = x;
                        MenhirLib.EngineTypes.startp = _startpos_x_;
                        MenhirLib.EngineTypes.endp = _endpos_x_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (unit option) = Obj.magic _3 in
        let _2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2 in
        let _3_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _2 =
          let (_endpos_x_, _startpos_x_, _endpos__3_, _3, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, _endpos__3_inlined1_, _3_inlined1, x_inlined1) in
          let _1 =
            let _2 = _2_inlined1 in
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37301 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 37307 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 37313 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos__3_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 37325 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 37331 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 37337 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37348 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 37354 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 37360 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3400 "src/reason-parser/reason_parser.mly"
    ( let exprList = filter_raise_spread_syntax record_exp_spread_msg _2 in
      (None, _1 :: exprList) )
# 37367 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x_inlined1;
              MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = x;
                    MenhirLib.EngineTypes.startp = _startpos_x_;
                    MenhirLib.EngineTypes.endp = _endpos_x_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : (unit option) = Obj.magic _3 in
        let _2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2 in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _2 =
          let (_endpos_x_, _startpos_x_, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, x_inlined1) in
          let _1 =
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37441 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 37447 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 37453 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos_x_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 37465 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 37471 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 37477 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37488 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 37494 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 37500 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3400 "src/reason-parser/reason_parser.mly"
    ( let exprList = filter_raise_spread_syntax record_exp_spread_msg _2 in
      (None, _1 :: exprList) )
# 37507 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined2;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined2_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined2;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined2_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _3_inlined1;
                        MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
                        MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = _2_inlined1;
                          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _menhir_s;
                            MenhirLib.EngineTypes.semv = x;
                            MenhirLib.EngineTypes.startp = _startpos_x_;
                            MenhirLib.EngineTypes.endp = _endpos_x_;
                            MenhirLib.EngineTypes.next = _menhir_stack;
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2 in
        let _3_inlined2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3_inlined2 in
        let _2_inlined2 : unit = Obj.magic _2_inlined2 in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _3_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _2 =
          let (_endpos_x_, _startpos_x_, _endpos__3_, _3, _2_inlined1, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, _endpos__3_inlined2_, _3_inlined2, _2_inlined2, x_inlined1) in
          let _1 =
            let _2 = _2_inlined1 in
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37610 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 37616 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 37622 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos__3_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 37634 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 37640 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 37646 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let (_3, _2) = (_3_inlined1, _2_inlined1) in
          let _1 =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37658 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 37664 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 37670 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3403 "src/reason-parser/reason_parser.mly"
    ( raise_record_trailing_semi_error'
        (mklocation _startpos__3_ _endpos__3_) )
# 37677 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x_inlined1;
              MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = x;
                        MenhirLib.EngineTypes.startp = _startpos_x_;
                        MenhirLib.EngineTypes.endp = _endpos_x_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2 in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _3_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _2 =
          let (_endpos_x_, _startpos_x_, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, x_inlined1) in
          let _1 =
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37765 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 37771 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 37777 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos_x_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 37789 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 37795 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 37801 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let (_3, _2) = (_3_inlined1, _2_inlined1) in
          let _1 =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37813 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 37819 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 37825 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3403 "src/reason-parser/reason_parser.mly"
    ( raise_record_trailing_semi_error'
        (mklocation _startpos__3_ _endpos__3_) )
# 37832 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__3_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__3_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _1_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = x;
                        MenhirLib.EngineTypes.startp = _startpos_x_;
                        MenhirLib.EngineTypes.endp = _endpos_x_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2 in
        let _3_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3_inlined1 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _2 =
          let (_endpos_x_, _startpos_x_, _endpos__3_, _3, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, _endpos__3_inlined1_, _3_inlined1, x_inlined1) in
          let _1 =
            let _2 = _2_inlined1 in
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37921 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3408 "src/reason-parser/reason_parser.mly"
                                       ( (_1, _3) )
# 37927 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3416 "src/reason-parser/reason_parser.mly"
                        (_1)
# 37933 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos__3_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 37945 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 37951 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 37957 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 37968 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 37974 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 37980 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3403 "src/reason-parser/reason_parser.mly"
    ( raise_record_trailing_semi_error'
        (mklocation _startpos__3_ _endpos__3_) )
# 37987 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x_inlined1;
              MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = x;
                    MenhirLib.EngineTypes.startp = _startpos_x_;
                    MenhirLib.EngineTypes.endp = _endpos_x_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) = Obj.magic _2 in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _1_inlined1 : (unit option) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _2 =
          let (_endpos_x_, _startpos_x_, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, x_inlined1) in
          let _1 =
            let x =
              let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
              let _2 =
                let _1 =
                  let _1 =
                    let _endpos = _endpos_x_ in
                    let _symbolstartpos = _startpos_x_ in
                    
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 38061 "src/reason-parser/reason_parser.ml"
                    
                  in
                  
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 38067 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 38073 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos__2_ = _endpos_x_ in
              
# 4819 "src/reason-parser/reason_parser.mly"
    ( let dotdotdot = match _1 with
      | Some _ -> Some (mklocation _startpos__1_ _endpos__2_)
      | None -> None
      in
      (dotdotdot, _2)
    )
# 38085 "src/reason-parser/reason_parser.ml"
              
            in
            
# 183 "<standard.mly>"
    ( x )
# 38091 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 38097 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 38108 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3412 "src/reason-parser/reason_parser.mly"
                            ( (_1, exp_of_label _1) )
# 38114 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3417 "src/reason-parser/reason_parser.mly"
                    (_1)
# 38120 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3403 "src/reason-parser/reason_parser.mly"
    ( raise_record_trailing_semi_error'
        (mklocation _startpos__3_ _endpos__3_) )
# 38127 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 3422 "src/reason-parser/reason_parser.mly"
    ( (Some _2, _4) )
# 38176 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 38218 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _endpos = _endpos__4_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3424 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let (s, _, _) = _1 in
      let lident_lident_loc = mkloc (Lident s) loc in
      (None, [(lident_lident_loc, _3)])
    )
# 38234 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let _1 : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 3429 "src/reason-parser/reason_parser.mly"
                                                                                  (
    (None, _1 :: _2)
  )
# 38271 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 38298 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.label_declaration) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 38310 "src/reason-parser/reason_parser.ml"
          
        in
        let (_endpos__3_, _startpos__3_) = (_endpos_x_, _startpos_x_) in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 38317 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          if _startpos__2_ != _endpos__2_ then
            _startpos__2_
          else
            _startpos__3_ in
        
# 3954 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Type.field _3 (mkct _3) ~attrs:_1 ~mut:_2 ~loc
    )
# 38333 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 38366 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.label_declaration) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 38379 "src/reason-parser/reason_parser.ml"
          
        in
        let (_endpos__3_, _startpos__3_) = (_endpos_x_, _startpos_x_) in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 38387 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 38392 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          if _startpos__2_ != _endpos__2_ then
            _startpos__2_
          else
            _startpos__3_ in
        
# 3954 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Type.field _3 (mkct _3) ~attrs:_1 ~mut:_2 ~loc
    )
# 38408 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 38449 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.label_declaration) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 38461 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__3_ = _startpos_x_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 38468 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          if _startpos__2_ != _endpos__2_ then
            _startpos__2_
          else
            _startpos__3_ in
        
# 3958 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Type.field _3 _5 ~attrs:_1 ~mut:_2 ~loc
    )
# 38484 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 38531 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.label_declaration) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 38544 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__3_ = _startpos_x_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 38552 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 38557 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          if _startpos__2_ != _endpos__2_ then
            _startpos__2_
          else
            _startpos__3_ in
        
# 3958 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Type.field _3 _5 ~attrs:_1 ~mut:_2 ~loc
    )
# 38573 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.row_field) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field) = 
# 4402 "src/reason-parser/reason_parser.mly"
                          ( _1 )
# 38598 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field) = 
# 4403 "src/reason-parser/reason_parser.mly"
                          ( Rinherit _1 )
# 38623 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.row_field) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = 
# 4397 "src/reason-parser/reason_parser.mly"
                             ( _1 :: _2 )
# 38655 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.row_field) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field list) = 
# 4398 "src/reason-parser/reason_parser.mly"
                                 ( _1 :: _2 )
# 38687 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 241 "<standard.mly>"
    ( [ x ] )
# 38712 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = xs;
          MenhirLib.EngineTypes.startp = _startpos_xs_;
          MenhirLib.EngineTypes.endp = _endpos_xs_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let xs : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic xs in
        let _2 : unit = Obj.magic _2 in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_xs_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = 
# 243 "<standard.mly>"
    ( x :: xs )
# 38751 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2432 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 38777 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 38785 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2440 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 38791 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 38828 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2434 "src/reason-parser/reason_parser.mly"
    ( expression_extension _1 _2 )
# 38834 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 38843 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2440 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 38849 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2436 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_sequence(_1, _3)) )
# 38889 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 38897 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2440 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 38903 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2438 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos__1_ _endpos__2_ in
      mkexp (Pexp_sequence(expression_extension ~loc _1 _2, _4)) )
# 38951 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 38959 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2440 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 38965 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 2410 "src/reason-parser/reason_parser.mly"
             ( _1 )
# 38997 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 2412 "src/reason-parser/reason_parser.mly"
  ( mkexp (Pexp_letmodule(_1, _2, _4)) )
# 39043 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let x : (Longident.t) = Obj.magic x in
        let _4 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__7_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _5 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 39106 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 39112 "src/reason-parser/reason_parser.ml"
         in
        
# 2414 "src/reason-parser/reason_parser.mly"
  ( let exp = mkexp (Pexp_open(_4, _5, _7)) in
    { exp with pexp_attributes = _1 }
  )
# 39119 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let x : (Longident.t) = Obj.magic x in
        let _4 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__7_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _5 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 39189 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 39196 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 39201 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2414 "src/reason-parser/reason_parser.mly"
  ( let exp = mkexp (Pexp_open(_4, _5, _7)) in
    { exp with pexp_attributes = _1 }
  )
# 39209 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 2417 "src/reason-parser/reason_parser.mly"
                                          (
   mkexp (Pexp_letexception (_1, _3)) )
# 39249 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Reason_parser_def.let_bindings) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 2420 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos__1_ _endpos__3_ in
    expr_of_let_bindings ~loc _1 _3
  )
# 39290 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : (Reason_parser_def.let_bindings) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__2_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2424 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _symbolstartpos _endpos in
    expr_of_let_bindings ~loc _1 (ghunit ~loc ())
  )
# 39326 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 39358 "src/reason-parser/reason_parser.ml"
         in
        
# 3929 "src/reason-parser/reason_parser.mly"
  ( {_3 with pext_attributes = _3.pext_attributes @ _1} )
# 39363 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 39403 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 39408 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3929 "src/reason-parser/reason_parser.mly"
  ( {_3 with pext_attributes = _3.pext_attributes @ _1} )
# 39414 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = constructors;
          MenhirLib.EngineTypes.startp = _startpos_constructors_;
          MenhirLib.EngineTypes.endp = _endpos_constructors_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = priv;
            MenhirLib.EngineTypes.startp = _startpos_priv_;
            MenhirLib.EngineTypes.endp = _endpos_priv_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = params;
                MenhirLib.EngineTypes.startp = _startpos_params_;
                MenhirLib.EngineTypes.endp = _endpos_params_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = flag;
                    MenhirLib.EngineTypes.startp = _startpos_flag_;
                    MenhirLib.EngineTypes.endp = _endpos_flag_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let constructors : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic constructors in
        let priv : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic priv in
        let _6 : unit = Obj.magic _6 in
        let params : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic params in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 39477 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic flag in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_constructors_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = let ident =
          let x = 
# 4530 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 39488 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 39496 "src/reason-parser/reason_parser.ml"
          
        in
        let attrs = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 39502 "src/reason-parser/reason_parser.ml"
         in
        
# 3993 "src/reason-parser/reason_parser.mly"
  ( if flag <> Recursive then
      not_expecting _startpos_flag_ _endpos_flag_ "nonrec flag";
    Te.mk ~params ~priv ~attrs ident constructors
  )
# 39510 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = constructors;
          MenhirLib.EngineTypes.startp = _startpos_constructors_;
          MenhirLib.EngineTypes.endp = _endpos_constructors_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = priv;
            MenhirLib.EngineTypes.startp = _startpos_priv_;
            MenhirLib.EngineTypes.endp = _endpos_priv_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = params;
                MenhirLib.EngineTypes.startp = _startpos_params_;
                MenhirLib.EngineTypes.endp = _endpos_params_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = flag;
                        MenhirLib.EngineTypes.startp = _startpos_flag_;
                        MenhirLib.EngineTypes.endp = _endpos_flag_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _menhir_s;
                          MenhirLib.EngineTypes.semv = _2;
                          MenhirLib.EngineTypes.startp = _startpos__2_;
                          MenhirLib.EngineTypes.endp = _endpos__2_;
                          MenhirLib.EngineTypes.next = _menhir_stack;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let constructors : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic constructors in
        let priv : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic priv in
        let _6 : unit = Obj.magic _6 in
        let params : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic params in
        let _3 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 39585 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic flag in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_constructors_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = let ident =
          let _2 = _2_inlined1 in
          let x = 
# 4531 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 39599 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 39607 "src/reason-parser/reason_parser.ml"
          
        in
        let attrs = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 39613 "src/reason-parser/reason_parser.ml"
         in
        
# 3993 "src/reason-parser/reason_parser.mly"
  ( if flag <> Recursive then
      not_expecting _startpos_flag_ _endpos_flag_ "nonrec flag";
    Te.mk ~params ~priv ~attrs ident constructors
  )
# 39621 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = constructors;
          MenhirLib.EngineTypes.startp = _startpos_constructors_;
          MenhirLib.EngineTypes.endp = _endpos_constructors_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = priv;
            MenhirLib.EngineTypes.startp = _startpos_priv_;
            MenhirLib.EngineTypes.endp = _endpos_priv_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = params;
                MenhirLib.EngineTypes.startp = _startpos_params_;
                MenhirLib.EngineTypes.endp = _endpos_params_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = flag;
                    MenhirLib.EngineTypes.startp = _startpos_flag_;
                    MenhirLib.EngineTypes.endp = _endpos_flag_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let constructors : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic constructors in
        let priv : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic priv in
        let _6 : unit = Obj.magic _6 in
        let params : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic params in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 39690 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic flag in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_constructors_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = let ident =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4530 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 39703 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 39711 "src/reason-parser/reason_parser.ml"
          
        in
        let attrs =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 39718 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 39723 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3993 "src/reason-parser/reason_parser.mly"
  ( if flag <> Recursive then
      not_expecting _startpos_flag_ _endpos_flag_ "nonrec flag";
    Te.mk ~params ~priv ~attrs ident constructors
  )
# 39732 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = constructors;
          MenhirLib.EngineTypes.startp = _startpos_constructors_;
          MenhirLib.EngineTypes.endp = _endpos_constructors_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = priv;
            MenhirLib.EngineTypes.startp = _startpos_priv_;
            MenhirLib.EngineTypes.endp = _endpos_priv_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = params;
                MenhirLib.EngineTypes.startp = _startpos_params_;
                MenhirLib.EngineTypes.endp = _endpos_params_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = flag;
                        MenhirLib.EngineTypes.startp = _startpos_flag_;
                        MenhirLib.EngineTypes.endp = _endpos_flag_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = _2;
                          MenhirLib.EngineTypes.startp = _startpos__2_;
                          MenhirLib.EngineTypes.endp = _endpos__2_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _menhir_s;
                            MenhirLib.EngineTypes.semv = _1;
                            MenhirLib.EngineTypes.startp = _startpos__1_;
                            MenhirLib.EngineTypes.endp = _endpos__1_;
                            MenhirLib.EngineTypes.next = _menhir_stack;
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let constructors : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic constructors in
        let priv : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic priv in
        let _6 : unit = Obj.magic _6 in
        let params : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic params in
        let _3 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 39813 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Longident.t) = Obj.magic _1_inlined1 in
        let flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic flag in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_constructors_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = let ident =
          let (_startpos__1_, _2, _1) = (_startpos__1_inlined1_, _2_inlined1, _1_inlined1) in
          let x = 
# 4531 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 39828 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 39836 "src/reason-parser/reason_parser.ml"
          
        in
        let attrs =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 39843 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 39848 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3993 "src/reason-parser/reason_parser.mly"
  ( if flag <> Recursive then
      not_expecting _startpos_flag_ _endpos_flag_ "nonrec flag";
    Te.mk ~params ~priv ~attrs ident constructors
  )
# 39857 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = 
# 1810 "src/reason-parser/reason_parser.mly"
                ( [] )
# 39875 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = 
# 1811 "src/reason-parser/reason_parser.mly"
                    ( _1 )
# 39900 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = 
# 1812 "src/reason-parser/reason_parser.mly"
                                   ( _1 @ _3 )
# 39939 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 39988 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 39994 "src/reason-parser/reason_parser.ml"
         in
        let _endpos = _endpos__5_ in
        
# 1818 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos__2_ _endpos in
      Psig_value (Val.mk _3 _5 ~attrs:_1 ~loc)
    )
# 40002 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40058 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 40065 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 40070 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__5_ in
        
# 1818 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos__2_ _endpos in
      Psig_value (Val.mk _3 _5 ~attrs:_1 ~loc)
    )
# 40079 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (string list) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__7_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40142 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 40148 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__7_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1823 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_value (Val.mk _3 _5 ~prim:_7 ~attrs:_1 ~loc)
    )
# 40161 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (string list) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__7_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40231 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 40238 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 40243 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__7_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1823 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_value (Val.mk _3 _5 ~prim:_7 ~attrs:_1 ~loc)
    )
# 40256 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40312 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 40318 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__6_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1828 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_value (Val.mk _3 _5 ~prim:[""] ~attrs:_1 ~loc)
    )
# 40331 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _3 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40394 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 40401 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 40406 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__6_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1828 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_value (Val.mk _3 _5 ~prim:[""] ~attrs:_1 ~loc)
    )
# 40419 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.rec_flag *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = 
# 1832 "src/reason-parser/reason_parser.mly"
    ( let (nonrec_flag, tyl) = _1 in Psig_type (nonrec_flag, tyl) )
# 40445 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = 
# 1834 "src/reason-parser/reason_parser.mly"
    ( Psig_typext _1 )
# 40470 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = 
# 1836 "src/reason-parser/reason_parser.mly"
    ( Psig_exception _1 )
# 40495 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 40527 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1838 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_module (Md.mk _2 _3 ~attrs:_1 ~loc)
    )
# 40540 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 40580 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 40585 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1838 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_module (Md.mk _2 _3 ~attrs:_1 ~loc)
    )
# 40598 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _4 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40640 "src/reason-parser/reason_parser.ml"
          
        in
        let (_endpos__4_, _startpos__4_) = (_endpos_x_, _startpos_x_) in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 40647 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1842 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let loc_mod = mklocation _startpos__4_ _endpos__4_ in
      Psig_module (
        Md.mk
            _2
            (Mty.alias ~loc:loc_mod _4)
            ~attrs:_1
            ~loc
            )
    )
# 40667 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _4 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40716 "src/reason-parser/reason_parser.ml"
          
        in
        let (_endpos__4_, _startpos__4_) = (_endpos_x_, _startpos_x_) in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 40724 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 40729 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1842 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let loc_mod = mklocation _startpos__4_ _endpos__4_ in
      Psig_module (
        Md.mk
            _2
            (Mty.alias ~loc:loc_mod _4)
            ~attrs:_1
            ~loc
            )
    )
# 40749 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_declaration list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 40788 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1854 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos__3_ in
      Psig_recmodule (Md.mk _2 _3 ~attrs:_1 ~loc :: _4) )
# 40799 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_declaration list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 40846 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 40851 "src/reason-parser/reason_parser.ml"
          
        in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1854 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos__3_ in
      Psig_recmodule (Md.mk _2 _3 ~attrs:_1 ~loc :: _4) )
# 40862 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (string) = Obj.magic x in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _4 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40904 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__4_ = _endpos_x_ in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 40911 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1857 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_modtype (Mtd.mk _4 ~attrs:_1 ~loc)
    )
# 40924 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (string) = Obj.magic x in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _4 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 40973 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__4_ = _endpos_x_ in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 40981 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 40986 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__4_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1857 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_modtype (Mtd.mk _4 ~attrs:_1 ~loc)
    )
# 40999 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _5 in
        let x : (string) = Obj.magic x in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _4 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 41048 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 41054 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1861 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_modtype (Mtd.mk _4 ~typ:_5 ~loc ~attrs:_1)
    )
# 41067 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _5 in
        let x : (string) = Obj.magic x in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _4 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 41123 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 41130 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 41135 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1861 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_modtype (Mtd.mk _4 ~typ:_5 ~loc ~attrs:_1)
    )
# 41148 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.open_description) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = 
# 1865 "src/reason-parser/reason_parser.mly"
    ( Psig_open _1 )
# 41173 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 41205 "src/reason-parser/reason_parser.ml"
         in
        let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1867 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_include (Incl.mk _3 ~attrs:_1 ~loc)
    )
# 41218 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 41258 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 41263 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 1867 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      Psig_include (Incl.mk _3 ~attrs:_1 ~loc)
    )
# 41276 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = 
# 1871 "src/reason-parser/reason_parser.mly"
    ( Psig_class _1 )
# 41301 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = 
# 1873 "src/reason-parser/reason_parser.mly"
    ( Psig_class_type _1 )
# 41326 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 41351 "src/reason-parser/reason_parser.ml"
         in
        
# 1875 "src/reason-parser/reason_parser.mly"
    ( Psig_extension (_2, _1) )
# 41356 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 41389 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 41394 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1875 "src/reason-parser/reason_parser.mly"
    ( Psig_extension (_2, _1) )
# 41400 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 41428 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1879 "src/reason-parser/reason_parser.mly"
                           ( [mksig ~loc:_1.loc _1.txt] )
# 41434 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) = let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 41459 "src/reason-parser/reason_parser.ml"
         in
        
# 1881 "src/reason-parser/reason_parser.mly"
    ( List.map (fun x -> mksig ~loc:x.loc (Psig_attribute x.txt)) _1 )
# 41464 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4444 "src/reason-parser/reason_parser.mly"
                 ( _1 )
# 41491 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (
# 1102 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 41518 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4445 "src/reason-parser/reason_parser.mly"
                 ( let (n, m) = _2 in ([], Pconst_integer("-" ^ n, m)) )
# 41528 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (
# 1081 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 41555 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4446 "src/reason-parser/reason_parser.mly"
                 ( let (f, m) = _2 in ([], Pconst_float("-" ^ f, m)) )
# 41565 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (
# 1102 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 41592 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4447 "src/reason-parser/reason_parser.mly"
                 ( let (n, m) = _2 in ([], Pconst_integer (n, m)) )
# 41602 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (
# 1081 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 41629 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = 
# 4448 "src/reason-parser/reason_parser.mly"
                 ( let (f, m) = _2 in ([], Pconst_float(f, m)) )
# 41639 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 41672 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2910 "src/reason-parser/reason_parser.mly"
                          ( mkexp (Pexp_ident _1) )
# 41678 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 41686 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 41692 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x = 
# 2912 "src/reason-parser/reason_parser.mly"
    ( let attrs, cst = _1 in mkexp ~attrs (Pexp_constant cst) )
# 41722 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 41730 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 41736 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x = 
# 2913 "src/reason-parser/reason_parser.mly"
                          ( _1 )
# 41765 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 41773 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 41779 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x = 
# 2914 "src/reason-parser/reason_parser.mly"
                                ( _1 )
# 41808 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 41816 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 41822 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _2 = 
# 4837 "src/reason-parser/reason_parser.mly"
                ( [] )
# 41867 "src/reason-parser/reason_parser.ml"
               in
              
# 2894 "src/reason-parser/reason_parser.mly"
  ( let msg = "Arrays can't use the `...` spread currently. Please use `concat` or other Array helpers." in
    filter_raise_spread_syntax msg _2
  )
# 41874 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2916 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_array _1) )
# 41880 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 41889 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 41895 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1_inlined1 : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _2 =
                let _1 = _1_inlined1 in
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 41949 "src/reason-parser/reason_parser.ml"
                 in
                
# 4838 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 41954 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2894 "src/reason-parser/reason_parser.mly"
  ( let msg = "Arrays can't use the `...` spread currently. Please use `concat` or other Array helpers." in
    filter_raise_spread_syntax msg _2
  )
# 41962 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2916 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_array _1) )
# 41968 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 41977 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 41983 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 42016 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2920 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_construct (_1, None)) )
# 42022 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42030 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42036 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 = 
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 42073 "src/reason-parser/reason_parser.ml"
             in
            
# 2922 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_variant (_1, None)) )
# 42078 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42087 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42093 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _endpos = _endpos__3_ in
            let _startpos = _startpos__1_ in
            
# 2924 "src/reason-parser/reason_parser.mly"
    ( may_tuple _startpos _endpos _2 )
# 42139 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42148 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42154 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (
# 1143 "src/reason-parser/reason_parser.mly"
       (string)
# 42181 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 42201 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 42210 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2926 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_apply(mkoperator _2, [Nolabel, _1])) )
# 42216 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42225 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42231 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 42292 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2928 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_open(Fresh, _1, may_tuple _startpos__3_ _endpos__5_ _4)) )
# 42298 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42307 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42313 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 42363 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 42372 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2930 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_field(_1, _3)) )
# 42378 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42387 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42393 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 42447 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__4_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2932 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let pat = mkpat (Ppat_var (mkloc "this" loc)) in
      mkexp(Pexp_open (Fresh, _1,
                       mkexp(Pexp_object(Cstr.mk pat []))))
    )
# 42460 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__4_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42469 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42475 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 42532 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__4_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2938 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "Array" "get") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp, [Nolabel,_1; Nolabel,_3]))
    )
# 42543 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42552 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42558 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 42622 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2943 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "String" "get") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp, [Nolabel,_1; Nolabel,_4]))
    )
# 42633 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42642 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42648 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined2;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (unit option) = Obj.magic _4 in
        let _1_inlined2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1_inlined2 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _2 =
              let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
              let _3 =
                let _1 = _1_inlined1 in
                
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 42720 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2899 "src/reason-parser/reason_parser.mly"
                                                                 ( _3 )
# 42726 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos__2_ = _endpos__5_ in
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 42736 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__2_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2948 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      bigarray_get ~loc _1 _2 )
# 42745 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42754 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42760 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 42823 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2951 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkexp(Pexp_open(Fresh, _1, mk_record_expr ~loc _4))
    )
# 42834 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42843 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42849 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 42912 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2955 "src/reason-parser/reason_parser.mly"
    ( let (exten, fields) = _4 in
      let loc = mklocation _symbolstartpos _endpos in
      let rec_exp = mkexp ~loc (Pexp_extension (mkloc ("bs.obj") loc,
             PStr [mkstrexp (mkexp ~loc (Pexp_record(fields, exten))) []]))
      in
      mkexp(Pexp_open(Fresh, _1, rec_exp))
    )
# 42927 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 42936 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 42942 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43003 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2963 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let rec_exp = Exp.mk ~loc ~attrs:[] (Pexp_array _4) in
      mkexp(Pexp_open(Fresh, _1, rec_exp))
    )
# 43015 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43024 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43030 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43091 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2969 "src/reason-parser/reason_parser.mly"
    ( let seq, ext_opt = [_4], None in
      let loc = mklocation _startpos__4_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc seq ext_opt) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 43102 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43111 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43117 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43171 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2976 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos__3_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc [] None) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 43181 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__4_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43190 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43196 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list *
  Migrate_parsetree.Ast_404.Parsetree.expression option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43258 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2982 "src/reason-parser/reason_parser.mly"
    ( let seq, ext_opt = _4 in
      let loc = mklocation _startpos__4_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc seq ext_opt) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 43269 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43278 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43284 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let x : (
# 1142 "src/reason-parser/reason_parser.mly"
       (string)
# 43315 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 43331 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43340 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2989 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_apply(mkoperator _1, [Nolabel, _2])) )
# 43346 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43355 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43361 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43401 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2999 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_new _2) )
# 43407 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43416 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43422 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = x;
                    MenhirLib.EngineTypes.startp = _startpos_x_;
                    MenhirLib.EngineTypes.endp = _endpos_x_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (unit option) = Obj.magic _5 in
        let _1 : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _4 =
              let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 43488 "src/reason-parser/reason_parser.ml"
               in
              
# 3489 "src/reason-parser/reason_parser.mly"
                                                                     ( _1 )
# 43493 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43502 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__6_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3001 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Exp.mk ~loc ~attrs:[] (Pexp_override _4) in
      mkexp (Pexp_open(Fresh, _1, exp))
    )
# 43514 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__6_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43523 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43529 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 43562 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _3 =
              let _1 = _1_inlined1 in
              
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 43582 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 43591 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3006 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_send(_1, _3)) )
# 43597 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43606 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43612 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let x : (
# 1155 "src/reason-parser/reason_parser.mly"
       (string)
# 43646 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43666 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 43675 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3008 "src/reason-parser/reason_parser.mly"
    ( mkinfixop _1 (mkoperator _2) _3 )
# 43681 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43690 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43696 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let x : unit = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _3 =
              let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 43750 "src/reason-parser/reason_parser.ml"
              
            in
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43759 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 43768 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3010 "src/reason-parser/reason_parser.mly"
    ( let op = { _2 with txt = "#=" } in
      mkinfixop _1 (mkoperator op) _3 )
# 43775 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43784 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43790 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let x : unit = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43840 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 43849 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3013 "src/reason-parser/reason_parser.mly"
    ( mkinfixop _1 (mkoperator {_2 with txt = "|."}) _3 )
# 43855 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43864 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43870 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _8;
          MenhirLib.EngineTypes.startp = _startpos__8_;
          MenhirLib.EngineTypes.endp = _endpos__8_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = x;
                        MenhirLib.EngineTypes.startp = _startpos_x_;
                        MenhirLib.EngineTypes.endp = _endpos_x_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _8 : unit = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__8_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 43952 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__8_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3015 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkexp (Pexp_open(Fresh, _1,
        mkexp ~loc (Pexp_constraint (mkexp ~ghost:true ~loc (Pexp_pack _5), _7))))
    )
# 43964 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__8_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 43973 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 43979 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 =
          let x = 
# 3020 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_extension _1) )
# 44008 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44016 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3055 "src/reason-parser/reason_parser.mly"
                                                         ( (_1, []) )
# 44022 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 3057 "src/reason-parser/reason_parser.mly"
    ( let (body, args) = _1 in
      (body, List.rev_append _2 args) )
# 44063 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression list *
  Migrate_parsetree.Ast_404.Parsetree.expression option) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 3060 "src/reason-parser/reason_parser.mly"
    ( let seq, ext_opt = _2 in
      let loc = mklocation _startpos__2_ _endpos__2_ in
      (make_real_exp (mktailexp_extension loc seq ext_opt), [])
    )
# 44109 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = 
# 3064 "src/reason-parser/reason_parser.mly"
                                     ( (_1, []) )
# 44137 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3079 "src/reason-parser/reason_parser.mly"
                ( _1 )
# 44162 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list *
  Migrate_parsetree.Ast_404.Parsetree.expression option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3081 "src/reason-parser/reason_parser.mly"
    ( let entireLoc = mklocation _startpos__1_ _endpos__4_ in
      let (seq, ext_opt) = _4 in
      mktailexp_extension entireLoc (_2::seq) ext_opt
    )
# 44219 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3086 "src/reason-parser/reason_parser.mly"
    ( let entireLoc = mklocation _startpos__1_ _endpos__3_ in
      mktailexp_extension entireLoc (_2::[]) None
    )
# 44260 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3090 "src/reason-parser/reason_parser.mly"
    ( let entireLoc = mklocation _startpos__1_ _endpos__4_ in
      mktailexp_extension entireLoc [_2] None
    )
# 44308 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1_inlined1 : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _2 =
          let _1 = _1_inlined1 in
          let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 44356 "src/reason-parser/reason_parser.ml"
           in
          
# 3489 "src/reason-parser/reason_parser.mly"
                                                                     ( _1 )
# 44361 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3094 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_override _2) )
# 44367 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3096 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_override []))
# 44399 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3098 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_pack _3) )
# 44445 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__6_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3100 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkexp (Pexp_constraint (mkexp ~ghost:true ~loc (Pexp_pack _3), _5))
    )
# 44509 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 44539 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2910 "src/reason-parser/reason_parser.mly"
                          ( mkexp (Pexp_ident _1) )
# 44545 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44553 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44559 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2912 "src/reason-parser/reason_parser.mly"
    ( let attrs, cst = _1 in mkexp ~attrs (Pexp_constant cst) )
# 44586 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44594 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44600 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2913 "src/reason-parser/reason_parser.mly"
                          ( _1 )
# 44626 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44634 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44640 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2914 "src/reason-parser/reason_parser.mly"
                                ( _1 )
# 44666 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44674 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44680 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _2 = 
# 4837 "src/reason-parser/reason_parser.mly"
                ( [] )
# 44722 "src/reason-parser/reason_parser.ml"
               in
              
# 2894 "src/reason-parser/reason_parser.mly"
  ( let msg = "Arrays can't use the `...` spread currently. Please use `concat` or other Array helpers." in
    filter_raise_spread_syntax msg _2
  )
# 44729 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2916 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_array _1) )
# 44735 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44744 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44750 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1_inlined1 : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _2 =
                let _1 = _1_inlined1 in
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 44801 "src/reason-parser/reason_parser.ml"
                 in
                
# 4838 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 44806 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2894 "src/reason-parser/reason_parser.mly"
  ( let msg = "Arrays can't use the `...` spread currently. Please use `concat` or other Array helpers." in
    filter_raise_spread_syntax msg _2
  )
# 44814 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2916 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_array _1) )
# 44820 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44829 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44835 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 44865 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2920 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_construct (_1, None)) )
# 44871 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44879 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44885 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 = 
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 44919 "src/reason-parser/reason_parser.ml"
             in
            
# 2922 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_variant (_1, None)) )
# 44924 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44933 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44939 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _endpos = _endpos__3_ in
            let _startpos = _startpos__1_ in
            
# 2924 "src/reason-parser/reason_parser.mly"
    ( may_tuple _startpos _endpos _2 )
# 44982 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 44991 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 44997 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (
# 1143 "src/reason-parser/reason_parser.mly"
       (string)
# 45024 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45038 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2926 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_apply(mkoperator _2, [Nolabel, _1])) )
# 45044 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45053 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45059 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45117 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2928 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_open(Fresh, _1, may_tuple _startpos__3_ _endpos__5_ _4)) )
# 45123 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45132 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45138 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45182 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2930 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_field(_1, _3)) )
# 45188 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45197 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45203 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45254 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__4_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2932 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let pat = mkpat (Ppat_var (mkloc "this" loc)) in
      mkexp(Pexp_open (Fresh, _1,
                       mkexp(Pexp_object(Cstr.mk pat []))))
    )
# 45267 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__4_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45276 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45282 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _endpos = _endpos__4_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2938 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "Array" "get") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp, [Nolabel,_1; Nolabel,_3]))
    )
# 45335 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45344 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45350 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2943 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "String" "get") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp, [Nolabel,_1; Nolabel,_4]))
    )
# 45410 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45419 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45425 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined2;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (unit option) = Obj.magic _4 in
        let _1_inlined2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1_inlined2 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
              let _3 =
                let _1 = _1_inlined1 in
                
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 45491 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2899 "src/reason-parser/reason_parser.mly"
                                                                 ( _3 )
# 45497 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos__2_ = _endpos__5_ in
            let _endpos = _endpos__2_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2948 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      bigarray_get ~loc _1 _2 )
# 45507 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45516 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45522 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45582 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2951 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkexp(Pexp_open(Fresh, _1, mk_record_expr ~loc _4))
    )
# 45593 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45602 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45608 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45668 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2955 "src/reason-parser/reason_parser.mly"
    ( let (exten, fields) = _4 in
      let loc = mklocation _symbolstartpos _endpos in
      let rec_exp = mkexp ~loc (Pexp_extension (mkloc ("bs.obj") loc,
             PStr [mkstrexp (mkexp ~loc (Pexp_record(fields, exten))) []]))
      in
      mkexp(Pexp_open(Fresh, _1, rec_exp))
    )
# 45683 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45692 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45698 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45756 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2963 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let rec_exp = Exp.mk ~loc ~attrs:[] (Pexp_array _4) in
      mkexp(Pexp_open(Fresh, _1, rec_exp))
    )
# 45768 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45777 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45783 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45841 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2969 "src/reason-parser/reason_parser.mly"
    ( let seq, ext_opt = [_4], None in
      let loc = mklocation _startpos__4_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc seq ext_opt) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 45852 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45861 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45867 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 45918 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2976 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos__3_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc [] None) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 45928 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__4_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 45937 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 45943 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list *
  Migrate_parsetree.Ast_404.Parsetree.expression option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46002 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2982 "src/reason-parser/reason_parser.mly"
    ( let seq, ext_opt = _4 in
      let loc = mklocation _startpos__4_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc seq ext_opt) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 46013 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46022 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46028 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let x : (
# 1142 "src/reason-parser/reason_parser.mly"
       (string)
# 46056 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46069 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2989 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_apply(mkoperator _1, [Nolabel, _2])) )
# 46075 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__2_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46084 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46090 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46127 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2999 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_new _2) )
# 46133 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46142 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46148 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = x;
                    MenhirLib.EngineTypes.startp = _startpos_x_;
                    MenhirLib.EngineTypes.endp = _endpos_x_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (unit option) = Obj.magic _5 in
        let _1 : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _4 =
              let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 46211 "src/reason-parser/reason_parser.ml"
               in
              
# 3489 "src/reason-parser/reason_parser.mly"
                                                                     ( _1 )
# 46216 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46225 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__6_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3001 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Exp.mk ~loc ~attrs:[] (Pexp_override _4) in
      mkexp (Pexp_open(Fresh, _1, exp))
    )
# 46237 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__6_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46246 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46252 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 46285 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _3 =
              let _1 = _1_inlined1 in
              
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 46299 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3006 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_send(_1, _3)) )
# 46305 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46314 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46320 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let x : (
# 1155 "src/reason-parser/reason_parser.mly"
       (string)
# 46354 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46368 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3008 "src/reason-parser/reason_parser.mly"
    ( mkinfixop _1 (mkoperator _2) _3 )
# 46374 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46383 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46389 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let x : unit = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _3 =
              let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 46437 "src/reason-parser/reason_parser.ml"
              
            in
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46446 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3010 "src/reason-parser/reason_parser.mly"
    ( let op = { _2 with txt = "#=" } in
      mkinfixop _1 (mkoperator op) _3 )
# 46453 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46462 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46468 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let x : unit = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46512 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3013 "src/reason-parser/reason_parser.mly"
    ( mkinfixop _1 (mkoperator {_2 with txt = "|."}) _3 )
# 46518 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46527 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46533 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _8;
          MenhirLib.EngineTypes.startp = _startpos__8_;
          MenhirLib.EngineTypes.endp = _endpos__8_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = x;
                        MenhirLib.EngineTypes.startp = _startpos_x_;
                        MenhirLib.EngineTypes.endp = _endpos_x_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _8 : unit = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__8_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46612 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__8_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3015 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkexp (Pexp_open(Fresh, _1,
        mkexp ~loc (Pexp_constraint (mkexp ~ghost:true ~loc (Pexp_pack _5), _7))))
    )
# 46624 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__8_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46633 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46639 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 3020 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_extension _1) )
# 46665 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46673 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3050 "src/reason-parser/reason_parser.mly"
                                                                 ( _1 )
# 46679 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = 
# 3051 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 46704 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 46734 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2910 "src/reason-parser/reason_parser.mly"
                          ( mkexp (Pexp_ident _1) )
# 46740 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46748 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 46754 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2912 "src/reason-parser/reason_parser.mly"
    ( let attrs, cst = _1 in mkexp ~attrs (Pexp_constant cst) )
# 46781 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46789 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 46795 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2913 "src/reason-parser/reason_parser.mly"
                          ( _1 )
# 46821 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46829 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 46835 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 2914 "src/reason-parser/reason_parser.mly"
                                ( _1 )
# 46861 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46869 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 46875 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _2 = 
# 4837 "src/reason-parser/reason_parser.mly"
                ( [] )
# 46917 "src/reason-parser/reason_parser.ml"
               in
              
# 2894 "src/reason-parser/reason_parser.mly"
  ( let msg = "Arrays can't use the `...` spread currently. Please use `concat` or other Array helpers." in
    filter_raise_spread_syntax msg _2
  )
# 46924 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2916 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_array _1) )
# 46930 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 46939 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 46945 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1_inlined1 : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _2 =
                let _1 = _1_inlined1 in
                let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 46996 "src/reason-parser/reason_parser.ml"
                 in
                
# 4838 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 47001 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2894 "src/reason-parser/reason_parser.mly"
  ( let msg = "Arrays can't use the `...` spread currently. Please use `concat` or other Array helpers." in
    filter_raise_spread_syntax msg _2
  )
# 47009 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2916 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_array _1) )
# 47015 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47024 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47030 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 47060 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2920 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_construct (_1, None)) )
# 47066 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47074 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47080 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 = 
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 47114 "src/reason-parser/reason_parser.ml"
             in
            
# 2922 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_variant (_1, None)) )
# 47119 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47128 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47134 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _endpos = _endpos__3_ in
            let _startpos = _startpos__1_ in
            
# 2924 "src/reason-parser/reason_parser.mly"
    ( may_tuple _startpos _endpos _2 )
# 47177 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47186 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47192 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (
# 1143 "src/reason-parser/reason_parser.mly"
       (string)
# 47219 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 47233 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2926 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_apply(mkoperator _2, [Nolabel, _1])) )
# 47239 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47248 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47254 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 47312 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2928 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_open(Fresh, _1, may_tuple _startpos__3_ _endpos__5_ _4)) )
# 47318 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47327 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47333 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 47377 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2930 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_field(_1, _3)) )
# 47383 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47392 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47398 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 47449 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__4_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2932 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let pat = mkpat (Ppat_var (mkloc "this" loc)) in
      mkexp(Pexp_open (Fresh, _1,
                       mkexp(Pexp_object(Cstr.mk pat []))))
    )
# 47462 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__4_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47471 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47477 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _endpos = _endpos__4_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2938 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "Array" "get") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp, [Nolabel,_1; Nolabel,_3]))
    )
# 47530 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47539 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47545 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2943 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "String" "get") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp, [Nolabel,_1; Nolabel,_4]))
    )
# 47605 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47614 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47620 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined2;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (unit option) = Obj.magic _4 in
        let _1_inlined2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1_inlined2 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let (_1_inlined1, _1) = (_1_inlined2, _1_inlined1) in
              let _3 =
                let _1 = _1_inlined1 in
                
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 47686 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2899 "src/reason-parser/reason_parser.mly"
                                                                 ( _3 )
# 47692 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos__2_ = _endpos__5_ in
            let _endpos = _endpos__2_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2948 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      bigarray_get ~loc _1 _2 )
# 47702 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47711 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47717 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 47777 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2951 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkexp(Pexp_open(Fresh, _1, mk_record_expr ~loc _4))
    )
# 47788 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47797 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47803 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 47863 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2955 "src/reason-parser/reason_parser.mly"
    ( let (exten, fields) = _4 in
      let loc = mklocation _symbolstartpos _endpos in
      let rec_exp = mkexp ~loc (Pexp_extension (mkloc ("bs.obj") loc,
             PStr [mkstrexp (mkexp ~loc (Pexp_record(fields, exten))) []]))
      in
      mkexp(Pexp_open(Fresh, _1, rec_exp))
    )
# 47878 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47887 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47893 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 47951 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = _startpos__1_ in
            
# 2963 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let rec_exp = Exp.mk ~loc ~attrs:[] (Pexp_array _4) in
      mkexp(Pexp_open(Fresh, _1, rec_exp))
    )
# 47963 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 47972 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 47978 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48036 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2969 "src/reason-parser/reason_parser.mly"
    ( let seq, ext_opt = [_4], None in
      let loc = mklocation _startpos__4_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc seq ext_opt) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 48047 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48056 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48062 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48113 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2976 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _startpos__3_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc [] None) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 48123 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__4_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48132 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48138 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression list *
  Migrate_parsetree.Ast_404.Parsetree.expression option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48197 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2982 "src/reason-parser/reason_parser.mly"
    ( let seq, ext_opt = _4 in
      let loc = mklocation _startpos__4_ _endpos__4_ in
      let list_exp = make_real_exp (mktailexp_extension loc seq ext_opt) in
      let list_exp = { list_exp with pexp_loc = loc } in
      mkexp (Pexp_open (Fresh, _1, list_exp))
    )
# 48208 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__5_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48217 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48223 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let x : (
# 1142 "src/reason-parser/reason_parser.mly"
       (string)
# 48251 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48264 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2989 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_apply(mkoperator _1, [Nolabel, _2])) )
# 48270 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__2_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48279 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48285 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48322 "src/reason-parser/reason_parser.ml"
              
            in
            
# 2999 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_new _2) )
# 48328 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48337 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48343 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = x;
                    MenhirLib.EngineTypes.startp = _startpos_x_;
                    MenhirLib.EngineTypes.endp = _endpos_x_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (unit option) = Obj.magic _5 in
        let _1 : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) = Obj.magic _1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _4 =
              let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 48406 "src/reason-parser/reason_parser.ml"
               in
              
# 3489 "src/reason-parser/reason_parser.mly"
                                                                     ( _1 )
# 48411 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48420 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__6_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3001 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Exp.mk ~loc ~attrs:[] (Pexp_override _4) in
      mkexp (Pexp_open(Fresh, _1, exp))
    )
# 48432 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__6_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48441 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48447 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 48480 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _3 =
              let _1 = _1_inlined1 in
              
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 48494 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3006 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_send(_1, _3)) )
# 48500 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48509 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48515 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let x : (
# 1155 "src/reason-parser/reason_parser.mly"
       (string)
# 48549 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48563 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3008 "src/reason-parser/reason_parser.mly"
    ( mkinfixop _1 (mkoperator _2) _3 )
# 48569 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48578 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48584 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let x : unit = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _3 =
              let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
              let _endpos = _endpos__1_ in
              let _startpos = _startpos__1_ in
              
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 48632 "src/reason-parser/reason_parser.ml"
              
            in
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48641 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3010 "src/reason-parser/reason_parser.mly"
    ( let op = { _2 with txt = "#=" } in
      mkinfixop _1 (mkoperator op) _3 )
# 48648 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48657 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48663 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let x : unit = Obj.magic x in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _2 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48707 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3013 "src/reason-parser/reason_parser.mly"
    ( mkinfixop _1 (mkoperator {_2 with txt = "|."}) _3 )
# 48713 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48722 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48728 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _8;
          MenhirLib.EngineTypes.startp = _startpos__8_;
          MenhirLib.EngineTypes.endp = _endpos__8_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = x;
                        MenhirLib.EngineTypes.startp = _startpos_x_;
                        MenhirLib.EngineTypes.endp = _endpos_x_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _8 : unit = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__8_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48807 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos__1_ = _startpos_x_ in
            let _endpos = _endpos__8_ in
            let _symbolstartpos = _startpos__1_ in
            
# 3015 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkexp (Pexp_open(Fresh, _1,
        mkexp ~loc (Pexp_constraint (mkexp ~ghost:true ~loc (Pexp_pack _5), _7))))
    )
# 48819 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos_x_ = _endpos__8_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48828 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48834 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let x = 
# 3020 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_extension _1) )
# 48860 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48868 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3026 "src/reason-parser/reason_parser.mly"
                                                                      ( _1 )
# 48874 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _2 =
          let x = 
# 3031 "src/reason-parser/reason_parser.mly"
                                    ( mkexp (Pexp_tuple(_1)) )
# 48907 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48915 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48924 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3034 "src/reason-parser/reason_parser.mly"
    ( mkExplicitArityTupleExp (Pexp_construct(_1, Some _2))
    )
# 48931 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _2 =
          let x = 
# 3032 "src/reason-parser/reason_parser.mly"
                                    ( _1 )
# 48964 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 48972 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 48981 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3034 "src/reason-parser/reason_parser.mly"
    ( mkExplicitArityTupleExp (Pexp_construct(_1, Some _2))
    )
# 48988 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1_inlined1 in
        let _2_inlined1 : (string) = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 3039 "src/reason-parser/reason_parser.mly"
        ( (* only wrap in a tuple if there are more than one arguments *)
          match _1 with
          | [x] -> x
          | l -> mkexp (Pexp_tuple(l))
        )
# 49033 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49041 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _2 = _2_inlined1 in
          
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 49049 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3046 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_variant(_1, Some _2)) )
# 49055 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1_inlined1 in
        let _2_inlined1 : (string) = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _2 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 3044 "src/reason-parser/reason_parser.mly"
                                    ( _1 )
# 49096 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49104 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _2 = _2_inlined1 in
          
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 49112 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3046 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_variant(_1, Some _2)) )
# 49118 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let x : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 200 "<standard.mly>"
    ( x )
# 49162 "src/reason-parser/reason_parser.ml"
               in
              
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 49167 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1703 "src/reason-parser/reason_parser.mly"
    ( match _1.txt with
      | (None, Some x) -> x
      | _ -> syntax_error_mty _1.loc "Expecting a simple module type"
    )
# 49176 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49185 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1712 "src/reason-parser/reason_parser.mly"
    (_1)
# 49191 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x = 
# 1707 "src/reason-parser/reason_parser.mly"
                          ( _1 )
# 49217 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49225 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1712 "src/reason-parser/reason_parser.mly"
    (_1)
# 49231 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 49261 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1709 "src/reason-parser/reason_parser.mly"
    ( mkmty (Pmty_ident _1) )
# 49267 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49275 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1712 "src/reason-parser/reason_parser.mly"
    (_1)
# 49281 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.module_type) = let _1 =
          let x = 
# 1711 "src/reason-parser/reason_parser.mly"
    ( mkmty (Pmty_extension _1) )
# 49307 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4789 "src/reason-parser/reason_parser.mly"
  ( {x with pmty_loc = {x.pmty_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49315 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1712 "src/reason-parser/reason_parser.mly"
    (_1)
# 49321 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = 
# 3620 "src/reason-parser/reason_parser.mly"
                             ( _1 )
# 49346 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = 
# 3620 "src/reason-parser/reason_parser.mly"
                             ( _1 )
# 49371 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 49401 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3538 "src/reason-parser/reason_parser.mly"
    ( mkpat(Ppat_construct(mkloc _1.txt _1.loc, None)) )
# 49407 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49415 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3540 "src/reason-parser/reason_parser.mly"
    (_1)
# 49421 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _1_inlined1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _1 =
              let _1 =
                let _2 =
                  let _1 = _1_inlined1 in
                  
# 3746 "src/reason-parser/reason_parser.mly"
  ( let (fields, closed) = _1 in
    (filter_raise_spread_syntax record_pat_spread_msg fields, closed)
  )
# 49470 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 3681 "src/reason-parser/reason_parser.mly"
    ( let (fields, closed) = _2 in mkpat (Ppat_record (fields, closed)) )
# 49476 "src/reason-parser/reason_parser.ml"
                
              in
              
# 3675 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 49482 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3539 "src/reason-parser/reason_parser.mly"
                             ( _1 )
# 49488 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49497 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3540 "src/reason-parser/reason_parser.mly"
    (_1)
# 49503 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern list *
  Migrate_parsetree.Ast_404.Parsetree.pattern option) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 3686 "src/reason-parser/reason_parser.mly"
    ( make_real_pat (mktailpat_extension (mklocation _startpos__2_ _endpos__2_) _2) )
# 49546 "src/reason-parser/reason_parser.ml"
               in
              
# 3676 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 49551 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3539 "src/reason-parser/reason_parser.mly"
                             ( _1 )
# 49557 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49566 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3540 "src/reason-parser/reason_parser.mly"
    (_1)
# 49572 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 3691 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_array _2) )
# 49614 "src/reason-parser/reason_parser.ml"
               in
              
# 3677 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 49619 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3539 "src/reason-parser/reason_parser.mly"
                             ( _1 )
# 49625 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49634 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3540 "src/reason-parser/reason_parser.mly"
    (_1)
# 49640 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (string) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 49668 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3624 "src/reason-parser/reason_parser.mly"
                    ( mkpat ~loc:_1.loc (Ppat_var _1) )
# 49674 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3630 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_any) )
# 49700 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49708 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 49714 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3632 "src/reason-parser/reason_parser.mly"
    ( let attrs, cst = _1 in mkpat ~attrs (Ppat_constant cst) )
# 49741 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49749 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 49755 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3634 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_interval (snd _1, snd _3)) )
# 49797 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49805 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 49811 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _1 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 49841 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3636 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_construct (_1, None)) )
# 49847 "src/reason-parser/reason_parser.ml"
            
          in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49855 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 49861 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _1 = 
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 49895 "src/reason-parser/reason_parser.ml"
             in
            
# 3638 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_variant (_1, None)) )
# 49900 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49909 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 49915 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.lid) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3640 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_type (_2)) )
# 49948 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 49956 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 49962 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (unit option) = Obj.magic _3 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _2 =
              let _1 = _1_inlined1 in
              
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 50012 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__4_ in
            let _startpos = _startpos__1_ in
            
# 3642 "src/reason-parser/reason_parser.mly"
    ( match _2 with
      | [] -> (* This shouldn't be possible *)
        let loc = mklocation _startpos _endpos in
        mkpat_constructor_unit loc loc
      | [hd] -> hd
      | _ :: _ -> mkpat (Ppat_tuple _2)
    )
# 50026 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 50035 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 50041 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 50081 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50096 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3650 "src/reason-parser/reason_parser.mly"
    ( mkpat(Ppat_unpack(_3)) )
# 50102 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 50111 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 50117 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3652 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 50143 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 50151 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 50157 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let x = 
# 3654 "src/reason-parser/reason_parser.mly"
    ( mkpat(Ppat_extension _1) )
# 50183 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4805 "src/reason-parser/reason_parser.mly"
   ( {x with ppat_loc = {x.ppat_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 50191 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3655 "src/reason-parser/reason_parser.mly"
    (_1)
# 50197 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _1_inlined1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let _1 =
            let _2 =
              let _1 = _1_inlined1 in
              
# 3746 "src/reason-parser/reason_parser.mly"
  ( let (fields, closed) = _1 in
    (filter_raise_spread_syntax record_pat_spread_msg fields, closed)
  )
# 50244 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3681 "src/reason-parser/reason_parser.mly"
    ( let (fields, closed) = _2 in mkpat (Ppat_record (fields, closed)) )
# 50250 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3675 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 50256 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3659 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 50262 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern list *
  Migrate_parsetree.Ast_404.Parsetree.pattern option) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let _1 = 
# 3686 "src/reason-parser/reason_parser.mly"
    ( make_real_pat (mktailpat_extension (mklocation _startpos__2_ _endpos__2_) _2) )
# 50303 "src/reason-parser/reason_parser.ml"
           in
          
# 3676 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 50308 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3659 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 50314 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let _1 = 
# 3691 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_array _2) )
# 50354 "src/reason-parser/reason_parser.ml"
           in
          
# 3677 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 50359 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3659 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 50365 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _1_inlined1 : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _3 =
          let _1 =
            let _2 =
              let _1 = _1_inlined1 in
              
# 3746 "src/reason-parser/reason_parser.mly"
  ( let (fields, closed) = _1 in
    (filter_raise_spread_syntax record_pat_spread_msg fields, closed)
  )
# 50426 "src/reason-parser/reason_parser.ml"
              
            in
            
# 3681 "src/reason-parser/reason_parser.mly"
    ( let (fields, closed) = _2 in mkpat (Ppat_record (fields, closed)) )
# 50432 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3675 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 50438 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50447 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__1_ = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3661 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkpat ~loc (Ppat_open (_1, _3))
    )
# 50458 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.pattern list *
  Migrate_parsetree.Ast_404.Parsetree.pattern option) = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _3 =
          let (_endpos__2_, _startpos__2_, _2) = (_endpos__2_inlined1_, _startpos__2_inlined1_, _2_inlined1) in
          let _1 = 
# 3686 "src/reason-parser/reason_parser.mly"
    ( make_real_pat (mktailpat_extension (mklocation _startpos__2_ _endpos__2_) _2) )
# 50514 "src/reason-parser/reason_parser.ml"
           in
          
# 3676 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 50519 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50528 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__1_ = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3661 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkpat ~loc (Ppat_open (_1, _3))
    )
# 50539 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.pattern list) = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _3 =
          let _2 = _2_inlined1 in
          let _1 = 
# 3691 "src/reason-parser/reason_parser.mly"
    ( mkpat (Ppat_array _2) )
# 50594 "src/reason-parser/reason_parser.ml"
           in
          
# 3677 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 50599 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50608 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__1_ = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3661 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkpat ~loc (Ppat_open (_1, _3))
    )
# 50619 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50675 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__1_ = _startpos_x_ in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3665 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkpat ~loc (Ppat_open (_1, _4)) )
# 50685 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _3 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          let x = 
# 3667 "src/reason-parser/reason_parser.mly"
                                                       (Lident "[]")
# 50733 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50741 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__3_ = _endpos__2_inlined1_ in
        let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50751 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__1_ = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3668 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkpat ~loc (Ppat_open(_1, mkpat ~loc:_3.loc (Ppat_construct(_3, None)))) )
# 50761 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _2 : unit = Obj.magic _2 in
        let x : (Longident.t) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.pattern) = let _3 =
          let (_endpos__2_, _2) = (_endpos__2_inlined1_, _2_inlined1) in
          let x = 
# 3670 "src/reason-parser/reason_parser.mly"
                                                   (Lident "()")
# 50809 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50817 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__3_ = _endpos__2_inlined1_ in
        let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 50827 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__1_ = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3671 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      mkpat ~loc (Ppat_open(_1, mkpat ~loc:_3.loc (Ppat_construct(_3, None)))) )
# 50837 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 50858 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4648 "src/reason-parser/reason_parser.mly"
                ( _1 )
# 50866 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 50887 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4649 "src/reason-parser/reason_parser.mly"
                ( _1 )
# 50895 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4650 "src/reason-parser/reason_parser.mly"
                ( "and" )
# 50920 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4651 "src/reason-parser/reason_parser.mly"
                ( "as" )
# 50945 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4652 "src/reason-parser/reason_parser.mly"
                ( "assert" )
# 50970 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4653 "src/reason-parser/reason_parser.mly"
                ( "begin" )
# 50995 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4654 "src/reason-parser/reason_parser.mly"
                ( "class" )
# 51020 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4655 "src/reason-parser/reason_parser.mly"
                ( "constraint" )
# 51045 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4656 "src/reason-parser/reason_parser.mly"
                ( "do" )
# 51070 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4657 "src/reason-parser/reason_parser.mly"
                ( "done" )
# 51095 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4658 "src/reason-parser/reason_parser.mly"
                ( "downto" )
# 51120 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4659 "src/reason-parser/reason_parser.mly"
                ( "else" )
# 51145 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4660 "src/reason-parser/reason_parser.mly"
                ( "end" )
# 51170 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4661 "src/reason-parser/reason_parser.mly"
                ( "exception" )
# 51195 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4662 "src/reason-parser/reason_parser.mly"
                ( "external" )
# 51220 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4663 "src/reason-parser/reason_parser.mly"
                ( "false" )
# 51245 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4664 "src/reason-parser/reason_parser.mly"
                ( "for" )
# 51270 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4665 "src/reason-parser/reason_parser.mly"
                ( "fun" )
# 51295 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4666 "src/reason-parser/reason_parser.mly"
                ( "function" )
# 51320 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4667 "src/reason-parser/reason_parser.mly"
                ( "functor" )
# 51345 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4668 "src/reason-parser/reason_parser.mly"
                ( "if" )
# 51370 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4669 "src/reason-parser/reason_parser.mly"
                ( "in" )
# 51395 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4670 "src/reason-parser/reason_parser.mly"
                ( "include" )
# 51420 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4671 "src/reason-parser/reason_parser.mly"
                ( "inherit" )
# 51445 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4672 "src/reason-parser/reason_parser.mly"
                ( "initializer" )
# 51470 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4673 "src/reason-parser/reason_parser.mly"
                ( "lazy" )
# 51495 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4674 "src/reason-parser/reason_parser.mly"
                ( "let" )
# 51520 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4675 "src/reason-parser/reason_parser.mly"
                ( "switch" )
# 51545 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4676 "src/reason-parser/reason_parser.mly"
                ( "module" )
# 51570 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4677 "src/reason-parser/reason_parser.mly"
                ( "mutable" )
# 51595 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4678 "src/reason-parser/reason_parser.mly"
                ( "new" )
# 51620 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4679 "src/reason-parser/reason_parser.mly"
                ( "nonrec" )
# 51645 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4680 "src/reason-parser/reason_parser.mly"
                ( "object" )
# 51670 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4681 "src/reason-parser/reason_parser.mly"
                ( "of" )
# 51695 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4682 "src/reason-parser/reason_parser.mly"
                ( "open" )
# 51720 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4683 "src/reason-parser/reason_parser.mly"
                ( "or" )
# 51745 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4684 "src/reason-parser/reason_parser.mly"
                ( "private" )
# 51770 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4685 "src/reason-parser/reason_parser.mly"
                ( "rec" )
# 51795 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4686 "src/reason-parser/reason_parser.mly"
                ( "sig" )
# 51820 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4687 "src/reason-parser/reason_parser.mly"
                ( "struct" )
# 51845 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4688 "src/reason-parser/reason_parser.mly"
                ( "then" )
# 51870 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4689 "src/reason-parser/reason_parser.mly"
                ( "to" )
# 51895 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4690 "src/reason-parser/reason_parser.mly"
                ( "true" )
# 51920 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4691 "src/reason-parser/reason_parser.mly"
                ( "try" )
# 51945 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4692 "src/reason-parser/reason_parser.mly"
                ( "type" )
# 51970 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4693 "src/reason-parser/reason_parser.mly"
                ( "val" )
# 51995 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4694 "src/reason-parser/reason_parser.mly"
                ( "virtual" )
# 52020 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4695 "src/reason-parser/reason_parser.mly"
                ( "when" )
# 52045 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4696 "src/reason-parser/reason_parser.mly"
                ( "while" )
# 52070 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4697 "src/reason-parser/reason_parser.mly"
                ( "with" )
# 52095 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 52127 "src/reason-parser/reason_parser.ml"
         in
        
# 3923 "src/reason-parser/reason_parser.mly"
  ( {_3 with pext_attributes = _3.pext_attributes @ _1} )
# 52132 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 52172 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 52177 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3923 "src/reason-parser/reason_parser.mly"
  ( {_3 with pext_attributes = _3.pext_attributes @ _1} )
# 52183 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = constructors;
          MenhirLib.EngineTypes.startp = _startpos_constructors_;
          MenhirLib.EngineTypes.endp = _endpos_constructors_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = priv;
            MenhirLib.EngineTypes.startp = _startpos_priv_;
            MenhirLib.EngineTypes.endp = _endpos_priv_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = params;
                MenhirLib.EngineTypes.startp = _startpos_params_;
                MenhirLib.EngineTypes.endp = _endpos_params_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = flag;
                    MenhirLib.EngineTypes.startp = _startpos_flag_;
                    MenhirLib.EngineTypes.endp = _endpos_flag_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let constructors : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic constructors in
        let priv : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic priv in
        let _6 : unit = Obj.magic _6 in
        let params : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic params in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 52246 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic flag in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_constructors_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = let ident =
          let x = 
# 4530 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 52257 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 52265 "src/reason-parser/reason_parser.ml"
          
        in
        let attrs = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 52271 "src/reason-parser/reason_parser.ml"
         in
        
# 3979 "src/reason-parser/reason_parser.mly"
  ( if flag <> Recursive then
      not_expecting _startpos_flag_ _endpos_flag_ "nonrec flag";
    Te.mk ~params ~priv ~attrs ident constructors
  )
# 52279 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = constructors;
          MenhirLib.EngineTypes.startp = _startpos_constructors_;
          MenhirLib.EngineTypes.endp = _endpos_constructors_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = priv;
            MenhirLib.EngineTypes.startp = _startpos_priv_;
            MenhirLib.EngineTypes.endp = _endpos_priv_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = params;
                MenhirLib.EngineTypes.startp = _startpos_params_;
                MenhirLib.EngineTypes.endp = _endpos_params_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = flag;
                        MenhirLib.EngineTypes.startp = _startpos_flag_;
                        MenhirLib.EngineTypes.endp = _endpos_flag_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _menhir_s;
                          MenhirLib.EngineTypes.semv = _2;
                          MenhirLib.EngineTypes.startp = _startpos__2_;
                          MenhirLib.EngineTypes.endp = _endpos__2_;
                          MenhirLib.EngineTypes.next = _menhir_stack;
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let constructors : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic constructors in
        let priv : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic priv in
        let _6 : unit = Obj.magic _6 in
        let params : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic params in
        let _3 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 52354 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic flag in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_constructors_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = let ident =
          let _2 = _2_inlined1 in
          let x = 
# 4531 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 52368 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 52376 "src/reason-parser/reason_parser.ml"
          
        in
        let attrs = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 52382 "src/reason-parser/reason_parser.ml"
         in
        
# 3979 "src/reason-parser/reason_parser.mly"
  ( if flag <> Recursive then
      not_expecting _startpos_flag_ _endpos_flag_ "nonrec flag";
    Te.mk ~params ~priv ~attrs ident constructors
  )
# 52390 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = constructors;
          MenhirLib.EngineTypes.startp = _startpos_constructors_;
          MenhirLib.EngineTypes.endp = _endpos_constructors_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = priv;
            MenhirLib.EngineTypes.startp = _startpos_priv_;
            MenhirLib.EngineTypes.endp = _endpos_priv_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = params;
                MenhirLib.EngineTypes.startp = _startpos_params_;
                MenhirLib.EngineTypes.endp = _endpos_params_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined1;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = flag;
                    MenhirLib.EngineTypes.startp = _startpos_flag_;
                    MenhirLib.EngineTypes.endp = _endpos_flag_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let constructors : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic constructors in
        let priv : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic priv in
        let _6 : unit = Obj.magic _6 in
        let params : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic params in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 52459 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic flag in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_constructors_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = let ident =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4530 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 52472 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 52480 "src/reason-parser/reason_parser.ml"
          
        in
        let attrs =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 52487 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 52492 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3979 "src/reason-parser/reason_parser.mly"
  ( if flag <> Recursive then
      not_expecting _startpos_flag_ _endpos_flag_ "nonrec flag";
    Te.mk ~params ~priv ~attrs ident constructors
  )
# 52501 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = constructors;
          MenhirLib.EngineTypes.startp = _startpos_constructors_;
          MenhirLib.EngineTypes.endp = _endpos_constructors_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = priv;
            MenhirLib.EngineTypes.startp = _startpos_priv_;
            MenhirLib.EngineTypes.endp = _endpos_priv_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = params;
                MenhirLib.EngineTypes.startp = _startpos_params_;
                MenhirLib.EngineTypes.endp = _endpos_params_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2_inlined1;
                    MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
                    MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = flag;
                        MenhirLib.EngineTypes.startp = _startpos_flag_;
                        MenhirLib.EngineTypes.endp = _endpos_flag_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = _2;
                          MenhirLib.EngineTypes.startp = _startpos__2_;
                          MenhirLib.EngineTypes.endp = _endpos__2_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _menhir_s;
                            MenhirLib.EngineTypes.semv = _1;
                            MenhirLib.EngineTypes.startp = _startpos__1_;
                            MenhirLib.EngineTypes.endp = _endpos__1_;
                            MenhirLib.EngineTypes.next = _menhir_stack;
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let constructors : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) = Obj.magic constructors in
        let priv : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic priv in
        let _6 : unit = Obj.magic _6 in
        let params : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic params in
        let _3 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 52582 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2_inlined1 : unit = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Longident.t) = Obj.magic _1_inlined1 in
        let flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic flag in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_constructors_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = let ident =
          let (_startpos__1_, _2, _1) = (_startpos__1_inlined1_, _2_inlined1, _1_inlined1) in
          let x = 
# 4531 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 52597 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 52605 "src/reason-parser/reason_parser.ml"
          
        in
        let attrs =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 52612 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 52617 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3979 "src/reason-parser/reason_parser.mly"
  ( if flag <> Recursive then
      not_expecting _startpos_flag_ _endpos_flag_ "nonrec flag";
    Te.mk ~params ~priv ~attrs ident constructors
  )
# 52626 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression option) = Obj.magic _2 in
        let _1 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 52654 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__2_ in
        let _startpos = _startpos__1_ in
        
# 3456 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (s, _, _) = _1 in
    let lident_lident_loc = mkloc (Lident s) loc in
    let exp = match _2 with
      | Some x -> x
      | None -> mkexp ~loc (Pexp_ident lident_lident_loc)
    in
    (lident_lident_loc, exp)
  )
# 52672 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 52700 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__2_ in
        let _startpos = _startpos__1_ in
        
# 3440 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (s, _, _) = _1 in
    let lident_lident_loc = mkloc (Lident s) loc in
    let exp = mkexp ~loc (Pexp_ident lident_lident_loc) in
    (lident_lident_loc, exp)
  )
# 52715 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 52757 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) = let _endpos = _endpos__4_ in
        let _startpos = _startpos__1_ in
        
# 3447 "src/reason-parser/reason_parser.mly"
  ( let loc = mklocation _startpos _endpos in
    let (s, _, _) = _1 in
    let lident_lident_loc = mkloc (Lident s) loc in
    let exp = _3 in
    (lident_lident_loc, exp)
  )
# 52772 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 52806 "src/reason-parser/reason_parser.ml"
         in
        
# 3435 "src/reason-parser/reason_parser.mly"
                                                                           ( _1 )
# 52811 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 52846 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 52855 "src/reason-parser/reason_parser.ml"
         in
        
# 4379 "src/reason-parser/reason_parser.mly"
  ( let (label, _raw, _delim) = _2 in (label, _1, _4) )
# 52860 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 52901 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 52912 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 52917 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4379 "src/reason-parser/reason_parser.mly"
  ( let (label, _raw, _delim) = _2 in (label, _1, _4) )
# 52923 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 52959 "src/reason-parser/reason_parser.ml"
         in
        
# 4383 "src/reason-parser/reason_parser.mly"
                                                               ( _1 )
# 52964 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = 
# 1589 "src/reason-parser/reason_parser.mly"
                ( [] )
# 52982 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = 
# 1590 "src/reason-parser/reason_parser.mly"
                   ( _1 )
# 53007 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = 
# 1591 "src/reason-parser/reason_parser.mly"
                                  ( _1 @ _3 )
# 53046 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 53073 "src/reason-parser/reason_parser.ml"
             in
            
# 1611 "src/reason-parser/reason_parser.mly"
      ( mkstrexp _2 _1 )
# 53078 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53087 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53093 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 53128 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 53133 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1611 "src/reason-parser/reason_parser.mly"
      ( mkstrexp _2 _1 )
# 53139 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53148 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53154 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 53188 "src/reason-parser/reason_parser.ml"
             in
            
# 1613 "src/reason-parser/reason_parser.mly"
      ( let (ext_attrs, ext_id) = _2 in
        struct_item_extension (_1@ext_attrs, ext_id) _3 )
# 53194 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53203 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53209 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 53251 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 53256 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1613 "src/reason-parser/reason_parser.mly"
      ( let (ext_attrs, ext_id) = _2 in
        struct_item_extension (_1@ext_attrs, ext_id) _3 )
# 53263 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53272 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53278 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (string list) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__7_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 53343 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 53349 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
            let _endpos = _endpos__7_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1617 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr (Pstr_primitive (Val.mk _3 _5 ~prim:_7 ~attrs:_1 ~loc)) )
# 53361 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__7_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53370 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53376 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (string list) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__7_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 53448 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 53455 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 53460 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__7_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1617 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr (Pstr_primitive (Val.mk _3 _5 ~prim:_7 ~attrs:_1 ~loc)) )
# 53472 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__7_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53481 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53487 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 53545 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 53551 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
            let _endpos = _endpos__6_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1621 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr (Pstr_primitive (Val.mk _3 _5 ~prim:[""] ~attrs:_1 ~loc)) )
# 53563 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53572 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53578 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (string) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _3 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 53643 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 53650 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 53655 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__6_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1621 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr (Pstr_primitive (Val.mk _3 _5 ~prim:[""] ~attrs:_1 ~loc)) )
# 53667 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53676 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53682 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.rec_flag *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x = 
# 1624 "src/reason-parser/reason_parser.mly"
      ( let (nonrec_flag, tyl) = _1 in mkstr(Pstr_type (nonrec_flag, tyl)) )
# 53709 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53717 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53723 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.type_extension) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x = 
# 1626 "src/reason-parser/reason_parser.mly"
      ( mkstr(Pstr_typext _1) )
# 53749 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53757 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53763 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x = 
# 1628 "src/reason-parser/reason_parser.mly"
      ( mkstr(Pstr_exception _1) )
# 53789 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53797 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53803 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 53837 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
            let _endpos = _endpos__3_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1630 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr(Pstr_module (Mb.mk _2 _3 ~attrs:_1 ~loc)) )
# 53849 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53858 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53864 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 53906 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 53911 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__3_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1630 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr(Pstr_module (Mb.mk _2 _3 ~attrs:_1 ~loc)) )
# 53923 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 53932 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 53938 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_binding list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 53979 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1634 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos__2_ in
        mkstr (Pstr_recmodule ((Mb.mk _2 _3 ~attrs:_1 ~loc) :: _4))
      )
# 53991 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54000 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54006 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.module_binding list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Ast_helper.str) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 54055 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 54060 "src/reason-parser/reason_parser.ml"
              
            in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1634 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos__2_ in
        mkstr (Pstr_recmodule ((Mb.mk _2 _3 ~attrs:_1 ~loc) :: _4))
      )
# 54072 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54081 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54087 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x : (string) = Obj.magic x in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _5 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 54138 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos__5_ = _endpos_x_ in
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 54145 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1638 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr(Pstr_modtype (Mtd.mk _5 ~attrs:_1 ~loc)) )
# 54157 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__2_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54166 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54172 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let x : (string) = Obj.magic x in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _5 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 54230 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos__5_ = _endpos_x_ in
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 54238 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 54243 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__5_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1638 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr(Pstr_modtype (Mtd.mk _5 ~attrs:_1 ~loc)) )
# 54255 "src/reason-parser/reason_parser.ml"
            
          in
          let _startpos_x_ = _startpos__1_ in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54264 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54270 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _6 in
        let x : (string) = Obj.magic x in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _5 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 54328 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 54334 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
            let _endpos = _endpos__6_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1641 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr(Pstr_modtype (Mtd.mk _5 ~typ:_6 ~attrs:_1 ~loc)) )
# 54346 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54355 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54361 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.module_type) = Obj.magic _6 in
        let x : (string) = Obj.magic x in
        let _4 : (unit option) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _5 =
              let _endpos = _endpos_x_ in
              let _symbolstartpos = _startpos_x_ in
              
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 54426 "src/reason-parser/reason_parser.ml"
              
            in
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 54433 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 54438 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__6_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1641 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr(Pstr_modtype (Mtd.mk _5 ~typ:_6 ~attrs:_1 ~loc)) )
# 54450 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54459 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54465 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.open_description) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x = 
# 1644 "src/reason-parser/reason_parser.mly"
      ( mkstr(Pstr_open _1) )
# 54491 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54499 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54505 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 54551 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1646 "src/reason-parser/reason_parser.mly"
      ( let (ident, binding, virt, params) = _3 in
        let loc = mklocation _symbolstartpos _endpos__3_ in
        let first = Ci.mk ident binding ~virt ~params ~attrs:_1 ~loc in
        mkstr (Pstr_class (first :: _4))
      )
# 54565 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54574 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54580 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 54634 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 54639 "src/reason-parser/reason_parser.ml"
              
            in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1646 "src/reason-parser/reason_parser.mly"
      ( let (ident, binding, virt, params) = _3 in
        let loc = mklocation _symbolstartpos _endpos__3_ in
        let first = Ci.mk ident binding ~virt ~params ~attrs:_1 ~loc in
        mkstr (Pstr_class (first :: _4))
      )
# 54653 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54662 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54668 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x = 
# 1653 "src/reason-parser/reason_parser.mly"
      ( mkstr(Pstr_class_type _1) )
# 54694 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54702 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54708 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 54742 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos__1_, _startpos__1_) = (_endpos__0_, _endpos__0_) in
            let _endpos = _endpos__3_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1655 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr(Pstr_include (Incl.mk _3 ~attrs:_1 ~loc))
      )
# 54755 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54764 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54770 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.module_expr) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 54812 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 54817 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos = _endpos__3_ in
            let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
              _startpos__1_
            else
              _startpos__2_ in
            
# 1655 "src/reason-parser/reason_parser.mly"
      ( let loc = mklocation _symbolstartpos _endpos in
        mkstr(Pstr_include (Incl.mk _3 ~attrs:_1 ~loc))
      )
# 54830 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54839 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54845 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 54872 "src/reason-parser/reason_parser.ml"
             in
            
# 1661 "src/reason-parser/reason_parser.mly"
      ( mkstr(Pstr_extension (_2, _1)) )
# 54877 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__2_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54886 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54892 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x =
            let _1 =
              let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 54927 "src/reason-parser/reason_parser.ml"
               in
              
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 54932 "src/reason-parser/reason_parser.ml"
              
            in
            
# 1661 "src/reason-parser/reason_parser.mly"
      ( mkstr(Pstr_extension (_2, _1)) )
# 54938 "src/reason-parser/reason_parser.ml"
            
          in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54947 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54953 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Reason_parser_def.let_bindings) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 =
          let x = 
# 1663 "src/reason-parser/reason_parser.mly"
      ( val_of_let_bindings _1 )
# 54979 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4793 "src/reason-parser/reason_parser.mly"
  ( {x with pstr_loc = {x.pstr_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 54987 "src/reason-parser/reason_parser.ml"
          
        in
        
# 1664 "src/reason-parser/reason_parser.mly"
      ( [_1] )
# 54993 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) = let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 55018 "src/reason-parser/reason_parser.ml"
         in
        
# 1666 "src/reason-parser/reason_parser.mly"
   ( List.map (fun x -> mkstr ~loc:x.loc (Pstr_attribute x.txt)) _1 )
# 55023 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4638 "src/reason-parser/reason_parser.mly"
                  ( "-"  )
# 55048 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4639 "src/reason-parser/reason_parser.mly"
                  ( "-." )
# 55073 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _4 in
        let _3 : (bool) = Obj.magic _3 in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field) = let _2 = 
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 55119 "src/reason-parser/reason_parser.ml"
         in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 55124 "src/reason-parser/reason_parser.ml"
         in
        
# 4420 "src/reason-parser/reason_parser.mly"
    ( Rtag (_2, _1, _3, _4) )
# 55129 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _4 in
        let _3 : (bool) = Obj.magic _3 in
        let _2 : (string) = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field) = let _2 =
          let _1 = _1_inlined1 in
          
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 55184 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 55191 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 55196 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4420 "src/reason-parser/reason_parser.mly"
    ( Rtag (_2, _1, _3, _4) )
# 55202 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field) = let _2 = 
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 55234 "src/reason-parser/reason_parser.ml"
         in
        let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 55239 "src/reason-parser/reason_parser.ml"
         in
        
# 4422 "src/reason-parser/reason_parser.mly"
    ( Rtag (_2, _1, true, []) )
# 55244 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.row_field) = let _2 =
          let _1 = _1_inlined1 in
          
# 4592 "src/reason-parser/reason_parser.mly"
                                  ( _2 )
# 55285 "src/reason-parser/reason_parser.ml"
          
        in
        let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 55292 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 55297 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4422 "src/reason-parser/reason_parser.mly"
    ( Rtag (_2, _1, true, []) )
# 55303 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) = Obj.magic _3 in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) = 
# 4585 "src/reason-parser/reason_parser.mly"
  ( Ptop_dir(_2, _3) )
# 55342 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (
# 1327 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase)
# 55367 "src/reason-parser/reason_parser.ml"
        ) = 
# 1377 "src/reason-parser/reason_parser.mly"
    ( apply_mapper_to_toplevel_phrase _1 reason_mapper )
# 55371 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 3503 "src/reason-parser/reason_parser.mly"
    ( (Some _2, _3) )
# 55411 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 3505 "src/reason-parser/reason_parser.mly"
    ( (None, Some _2) )
# 55444 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic x in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _2 =
          let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
          let _1 =
            let x = 
# 183 "<standard.mly>"
    ( x )
# 55487 "src/reason-parser/reason_parser.ml"
             in
            let _startpos_x_ = _startpos__1_ in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 55495 "src/reason-parser/reason_parser.ml"
            
          in
          
# 3497 "src/reason-parser/reason_parser.mly"
                                                     (_1)
# 55501 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3507 "src/reason-parser/reason_parser.mly"
    ( (Some _2, None) )
# 55507 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _3 in
        let _2 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _2 in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 55550 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Ast_helper.str *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Asttypes.variance)
   list *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
   list * Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  Lexing.position * Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 55570 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3811 "src/reason-parser/reason_parser.mly"
    ( syntax_error _1.loc
        "a type name must start with a lower-case letter or an underscore";
      let (kind, priv, manifest), constraints, endpos, and_types = _3 in
      ((_1, _2, constraints, kind, priv, manifest), endpos, and_types) )
# 55579 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _3 in
        let _2 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _2 in
        let x : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 55622 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Ast_helper.str *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Asttypes.variance)
   list *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
   list * Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  Lexing.position * Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _1 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 55642 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3816 "src/reason-parser/reason_parser.mly"
    ( let (kind, priv, manifest), constraints, endpos, and_types = _3 in
      ((_1, _2, constraints, kind, priv, manifest), endpos, and_types) )
# 55649 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _3 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _2 = 
# 4612 "src/reason-parser/reason_parser.mly"
                  ( Public )
# 55691 "src/reason-parser/reason_parser.ml"
         in
        
# 3822 "src/reason-parser/reason_parser.mly"
    ( let (cstrs, constraints, endpos, and_types) = _3 in
      ((Ptype_variant (cstrs), _2, None), constraints, endpos, and_types) )
# 55697 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _2 =
          let _1 = _1_inlined1 in
          
# 4613 "src/reason-parser/reason_parser.mly"
                  ( Private )
# 55748 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3822 "src/reason-parser/reason_parser.mly"
    ( let (cstrs, constraints, endpos, and_types) = _3 in
      ((Ptype_variant (cstrs), _2, None), constraints, endpos, and_types) )
# 55755 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _5 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _4 = 
# 4612 "src/reason-parser/reason_parser.mly"
                  ( Public )
# 55811 "src/reason-parser/reason_parser.ml"
         in
        
# 3825 "src/reason-parser/reason_parser.mly"
    ( let (cstrs, constraints, endpos, and_types) = _5 in
      ((Ptype_variant cstrs, _4, Some _2), constraints, endpos, and_types) )
# 55817 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _5 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _4 =
          let _1 = _1_inlined1 in
          
# 4613 "src/reason-parser/reason_parser.mly"
                  ( Private )
# 55882 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3825 "src/reason-parser/reason_parser.mly"
    ( let (cstrs, constraints, endpos, and_types) = _5 in
      ((Ptype_variant cstrs, _4, Some _2), constraints, endpos, and_types) )
# 55889 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _3 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _2 = 
# 3832 "src/reason-parser/reason_parser.mly"
    ( [] )
# 55929 "src/reason-parser/reason_parser.ml"
         in
        let _endpos__2_ = _endpos__1_ in
        
# 3828 "src/reason-parser/reason_parser.mly"
    ( (_1, _2, _endpos__2_, _3) )
# 55935 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _3 in
        let _1_inlined1 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _2 =
          let _1 = _1_inlined1 in
          
# 3833 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 55986 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__2_ = _endpos__1_inlined1_ in
        
# 3828 "src/reason-parser/reason_parser.mly"
    ( (_1, _2, _endpos__2_, _3) )
# 55993 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : ((Migrate_parsetree.Ast_404.Ast_helper.str *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Asttypes.variance)
   list *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
   list * Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  Lexing.position * Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__2_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.rec_flag *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _1 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 56042 "src/reason-parser/reason_parser.ml"
         in
        
# 3791 "src/reason-parser/reason_parser.mly"
  ( let (ident, params, constraints, kind, priv, manifest), endpos, and_types = _4 in
    let loc = mklocation _startpos__2_ endpos in
    let ty = Type.mk ident ~params:params ~cstrs:constraints
             ~kind ~priv ?manifest ~attrs:_1 ~loc in
    (_3, ty :: and_types)
  )
# 56052 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : ((Migrate_parsetree.Ast_404.Ast_helper.str *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Asttypes.variance)
   list *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
   list * Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  Lexing.position * Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.rec_flag *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) = let _1 =
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 56109 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 56114 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3791 "src/reason-parser/reason_parser.mly"
  ( let (ident, params, constraints, kind, priv, manifest), endpos, and_types = _4 in
    let loc = mklocation _startpos__2_ endpos in
    let ty = Type.mk ident ~params:params ~cstrs:constraints
             ~kind ~priv ?manifest ~attrs:_1 ~loc in
    (_3, ty :: and_types)
  )
# 56125 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 56146 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.lid) = let _1 =
          let x = 
# 4530 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 56155 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 56163 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4527 "src/reason-parser/reason_parser.mly"
                                        ( _1 )
# 56169 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 56202 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Ast_helper.lid) = let _1 =
          let x = 
# 4531 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 56213 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 56221 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4527 "src/reason-parser/reason_parser.mly"
                                        ( _1 )
# 56227 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 3838 "src/reason-parser/reason_parser.mly"
    ( (Ptype_abstract, Public, None) )
# 56247 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _2 = 
# 4612 "src/reason-parser/reason_parser.mly"
                  ( Public )
# 56281 "src/reason-parser/reason_parser.ml"
         in
        
# 3840 "src/reason-parser/reason_parser.mly"
    ( (Ptype_abstract, _2, Some _3) )
# 56286 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _2 =
          let _1 = _1_inlined1 in
          
# 4613 "src/reason-parser/reason_parser.mly"
                  ( Private )
# 56329 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3840 "src/reason-parser/reason_parser.mly"
    ( (Ptype_abstract, _2, Some _3) )
# 56335 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _4 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 56369 "src/reason-parser/reason_parser.ml"
         in
        let _2 = 
# 4612 "src/reason-parser/reason_parser.mly"
                  ( Public )
# 56374 "src/reason-parser/reason_parser.ml"
         in
        
# 3842 "src/reason-parser/reason_parser.mly"
    ( (Ptype_record (prepend_attrs_to_labels _3 _4), _2, None) )
# 56379 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _4 in
        let _1_inlined1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _3 =
          let _1 = _1_inlined1 in
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 56422 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 56427 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 = 
# 4612 "src/reason-parser/reason_parser.mly"
                  ( Public )
# 56433 "src/reason-parser/reason_parser.ml"
         in
        
# 3842 "src/reason-parser/reason_parser.mly"
    ( (Ptype_record (prepend_attrs_to_labels _3 _4), _2, None) )
# 56438 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _4 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _3 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 56479 "src/reason-parser/reason_parser.ml"
         in
        let _2 =
          let _1 = _1_inlined1 in
          
# 4613 "src/reason-parser/reason_parser.mly"
                  ( Private )
# 56486 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3842 "src/reason-parser/reason_parser.mly"
    ( (Ptype_record (prepend_attrs_to_labels _3 _4), _2, None) )
# 56492 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _4 in
        let _1_inlined2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _3 =
          let _1 = _1_inlined2 in
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 56542 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 56547 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _1 = _1_inlined1 in
          
# 4613 "src/reason-parser/reason_parser.mly"
                  ( Private )
# 56555 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3842 "src/reason-parser/reason_parser.mly"
    ( (Ptype_record (prepend_attrs_to_labels _3 _4), _2, None) )
# 56561 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 3844 "src/reason-parser/reason_parser.mly"
    ( (Ptype_open, Public, None) )
# 56595 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = 
# 3846 "src/reason-parser/reason_parser.mly"
    ( (Ptype_open, Public, Some _2) )
# 56643 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _6 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _5 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 56691 "src/reason-parser/reason_parser.ml"
         in
        let _4 = 
# 4612 "src/reason-parser/reason_parser.mly"
                  ( Public )
# 56696 "src/reason-parser/reason_parser.ml"
         in
        
# 3848 "src/reason-parser/reason_parser.mly"
    ( (Ptype_record (prepend_attrs_to_labels _5 _6), _4, Some _2) )
# 56701 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _6 in
        let _1_inlined1 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _5 =
          let _1 = _1_inlined1 in
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 56758 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 56763 "src/reason-parser/reason_parser.ml"
          
        in
        let _4 = 
# 4612 "src/reason-parser/reason_parser.mly"
                  ( Public )
# 56769 "src/reason-parser/reason_parser.ml"
         in
        
# 3848 "src/reason-parser/reason_parser.mly"
    ( (Ptype_record (prepend_attrs_to_labels _5 _6), _4, Some _2) )
# 56774 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _6 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _5 = 
# 4716 "src/reason-parser/reason_parser.mly"
    ( [] )
# 56829 "src/reason-parser/reason_parser.ml"
         in
        let _4 =
          let _1 = _1_inlined1 in
          
# 4613 "src/reason-parser/reason_parser.mly"
                  ( Private )
# 56836 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3848 "src/reason-parser/reason_parser.mly"
    ( (Ptype_record (prepend_attrs_to_labels _5 _6), _4, Some _2) )
# 56842 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) = Obj.magic _6 in
        let _1_inlined2 : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) = Obj.magic _1_inlined2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = let _5 =
          let _1 = _1_inlined2 in
          let _1 = 
# 4712 "src/reason-parser/reason_parser.mly"
                                               ( _1 )
# 56906 "src/reason-parser/reason_parser.ml"
           in
          
# 4717 "src/reason-parser/reason_parser.mly"
                       ( List.map (fun x -> x.txt) _1 )
# 56911 "src/reason-parser/reason_parser.ml"
          
        in
        let _4 =
          let _1 = _1_inlined1 in
          
# 4613 "src/reason-parser/reason_parser.mly"
                  ( Private )
# 56919 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3848 "src/reason-parser/reason_parser.mly"
    ( (Ptype_record (prepend_attrs_to_labels _5 _6), _4, Some _2) )
# 56925 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.variance) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = 
# 3877 "src/reason-parser/reason_parser.mly"
                                            ( (_2, _1) )
# 56958 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (unit option) = Obj.magic _2 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type list) = let _1 =
          let _1 =
            let x =
              let _1 = _1_inlined1 in
              let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 57008 "src/reason-parser/reason_parser.ml"
               in
              
# 4290 "src/reason-parser/reason_parser.mly"
                                                           (_1)
# 57013 "src/reason-parser/reason_parser.ml"
              
            in
            
# 200 "<standard.mly>"
    ( x )
# 57019 "src/reason-parser/reason_parser.ml"
            
          in
          
# 4851 "src/reason-parser/reason_parser.mly"
                                                       ( _1 )
# 57025 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4294 "src/reason-parser/reason_parser.mly"
                                             ( _1 )
# 57031 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = let _1 =
          let x = 
# 3887 "src/reason-parser/reason_parser.mly"
               ( mktyp (Ptyp_var _2) )
# 57064 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4785 "src/reason-parser/reason_parser.mly"
  ( {x with ptyp_loc = {x.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57072 "src/reason-parser/reason_parser.ml"
          
        in
        
# 3888 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 57078 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) = let _endpos = _endpos__1_ in
        let _symbolstartpos = _startpos__1_ in
        
# 3869 "src/reason-parser/reason_parser.mly"
  ( let first, second = _1 in
    let ptyp_loc =
        {first.ptyp_loc with loc_start = _symbolstartpos; loc_end = _endpos}
    in
    ({first with ptyp_loc}, second)
  )
# 57112 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = 
# 3857 "src/reason-parser/reason_parser.mly"
  ( _1 )
# 57141 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (unit option) = Obj.magic _2 in
        let _1 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = let _1 = 
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 57177 "src/reason-parser/reason_parser.ml"
         in
        
# 3852 "src/reason-parser/reason_parser.mly"
                                                                      (_1)
# 57182 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.variance) = 
# 3880 "src/reason-parser/reason_parser.mly"
                ( Invariant )
# 57200 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.variance) = 
# 3881 "src/reason-parser/reason_parser.mly"
                ( Covariant )
# 57225 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.variance) = 
# 3882 "src/reason-parser/reason_parser.mly"
                ( Contravariant )
# 57250 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4213 "src/reason-parser/reason_parser.mly"
                                 ( _1 )
# 57275 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.core_type) = 
# 4214 "src/reason-parser/reason_parser.mly"
                             ( _1 )
# 57300 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 57334 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2741 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 57340 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57349 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 57355 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 57361 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x = 
# 2743 "src/reason-parser/reason_parser.mly"
    ( _2 _3 )
# 57403 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57411 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 57417 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 57423 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Reason_parser_def.labelled_parameter Location.loc list * bool) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _endpos = _endpos__4_ in
              let _startpos = _startpos__1_ in
              
# 2745 "src/reason-parser/reason_parser.mly"
    ( let (ps, uncurried) = _2 in
      let exp = List.fold_right mkexp_fun ps _4 in
      if uncurried then
        let loc = mklocation _startpos _endpos in
        {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
      else exp
    )
# 57480 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57489 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 57495 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 57501 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Reason_parser_def.labelled_parameter Location.loc list * bool) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _endpos = _endpos__6_ in
              let _startpos = _startpos__1_ in
              
# 2753 "src/reason-parser/reason_parser.mly"
    ( let (ps, uncurried) = _2 in
    let exp = List.fold_right mkexp_fun ps
        (ghexp_constraint (mklocation _startpos__4_ _endpos) _6 (Some _4, None))  in
    if uncurried then
      let loc = mklocation _startpos _endpos in
      {exp with pexp_attributes = (uncurry_payload loc)::exp.pexp_attributes}
    else exp
    )
# 57573 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57582 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 57588 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 57594 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case list) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case) = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _3 =
                let (_2, _1) = (_2_inlined1, _1_inlined1) in
                let _1 = 
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 57646 "src/reason-parser/reason_parser.ml"
                 in
                
# 3313 "src/reason-parser/reason_parser.mly"
                                                            ( _1 )
# 57651 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2766 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_function _3)) )
# 57657 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__2_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57666 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 57672 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 57678 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case list) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case) = Obj.magic _1_inlined1 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _5 =
                let (_2, _1) = (_2_inlined1, _1_inlined1) in
                let _1 = 
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 57751 "src/reason-parser/reason_parser.ml"
                 in
                
# 3313 "src/reason-parser/reason_parser.mly"
                                                            ( _1 )
# 57756 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2769 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_match (_3, _5))) )
# 57762 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57771 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 57777 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 57783 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__2_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__2_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : unit = Obj.magic _6 in
        let _2_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case list) = Obj.magic _2_inlined1 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.case) = Obj.magic _1_inlined1 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _5 =
                let (_2, _1) = (_2_inlined1, _1_inlined1) in
                let _1 = 
# 4827 "src/reason-parser/reason_parser.mly"
                                          ( _1 :: List.rev _2 )
# 57856 "src/reason-parser/reason_parser.ml"
                 in
                
# 3313 "src/reason-parser/reason_parser.mly"
                                                            ( _1 )
# 57861 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2772 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_try (_3, _5))) )
# 57867 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57876 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 57882 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 57888 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _5 = 
# 124 "<standard.mly>"
    ( None )
# 57941 "src/reason-parser/reason_parser.ml"
               in
              let _4 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 57950 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2775 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_ifthenelse(_3, _4, _5))) )
# 57956 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 57965 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 57971 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 57977 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x;
          MenhirLib.EngineTypes.startp = _startpos_x_;
          MenhirLib.EngineTypes.endp = _endpos_x_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined2;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let x : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic x in
        let _1_inlined2 : unit = Obj.magic _1_inlined2 in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _5 =
                let _1 = _1_inlined2 in
                let x = 
# 183 "<standard.mly>"
    ( x )
# 58046 "src/reason-parser/reason_parser.ml"
                 in
                
# 126 "<standard.mly>"
    ( Some x )
# 58051 "src/reason-parser/reason_parser.ml"
                
              in
              let _4 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 58061 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2775 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_ifthenelse(_3, _4, _5))) )
# 58067 "src/reason-parser/reason_parser.ml"
              
            in
            let _startpos_x_ = _startpos__1_ in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58076 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58082 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58088 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _2;
              MenhirLib.EngineTypes.startp = _startpos__2_;
              MenhirLib.EngineTypes.endp = _endpos__2_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _4 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 58145 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2777 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_while(_3, _4))) )
# 58151 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58160 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58166 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58172 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _9;
            MenhirLib.EngineTypes.startp = _startpos__9_;
            MenhirLib.EngineTypes.endp = _endpos__9_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _8;
              MenhirLib.EngineTypes.startp = _startpos__8_;
              MenhirLib.EngineTypes.endp = _endpos__8_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _7;
                MenhirLib.EngineTypes.startp = _startpos__7_;
                MenhirLib.EngineTypes.endp = _endpos__7_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _6;
                  MenhirLib.EngineTypes.startp = _startpos__6_;
                  MenhirLib.EngineTypes.endp = _endpos__6_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _5;
                    MenhirLib.EngineTypes.startp = _startpos__5_;
                    MenhirLib.EngineTypes.endp = _endpos__5_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _4;
                      MenhirLib.EngineTypes.startp = _startpos__4_;
                      MenhirLib.EngineTypes.endp = _endpos__4_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _;
                        MenhirLib.EngineTypes.semv = _3;
                        MenhirLib.EngineTypes.startp = _startpos__3_;
                        MenhirLib.EngineTypes.endp = _endpos__3_;
                        MenhirLib.EngineTypes.next = {
                          MenhirLib.EngineTypes.state = _;
                          MenhirLib.EngineTypes.semv = _2;
                          MenhirLib.EngineTypes.startp = _startpos__2_;
                          MenhirLib.EngineTypes.endp = _endpos__2_;
                          MenhirLib.EngineTypes.next = {
                            MenhirLib.EngineTypes.state = _menhir_s;
                            MenhirLib.EngineTypes.semv = _1;
                            MenhirLib.EngineTypes.startp = _startpos__1_;
                            MenhirLib.EngineTypes.endp = _endpos__1_;
                            MenhirLib.EngineTypes.next = _menhir_stack;
                          };
                        };
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _9 : unit = Obj.magic _9 in
        let _8 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Asttypes.direction_flag) = Obj.magic _7 in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.pattern) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _10 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 58271 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2780 "src/reason-parser/reason_parser.mly"
    ( _2 (mkexp (Pexp_for(_4, _6, _8, _7, _10))) )
# 58277 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58286 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58292 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58298 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _8;
          MenhirLib.EngineTypes.startp = _startpos__8_;
          MenhirLib.EngineTypes.endp = _endpos__8_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _7;
            MenhirLib.EngineTypes.startp = _startpos__7_;
            MenhirLib.EngineTypes.endp = _endpos__7_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _6;
              MenhirLib.EngineTypes.startp = _startpos__6_;
              MenhirLib.EngineTypes.endp = _endpos__6_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _5;
                MenhirLib.EngineTypes.startp = _startpos__5_;
                MenhirLib.EngineTypes.endp = _endpos__5_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _4;
                  MenhirLib.EngineTypes.startp = _startpos__4_;
                  MenhirLib.EngineTypes.endp = _endpos__4_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _3;
                    MenhirLib.EngineTypes.startp = _startpos__3_;
                    MenhirLib.EngineTypes.endp = _endpos__3_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _2;
                      MenhirLib.EngineTypes.startp = _startpos__2_;
                      MenhirLib.EngineTypes.endp = _endpos__2_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _8 : unit = Obj.magic _8 in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__8_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _endpos = _endpos__8_ in
              let _symbolstartpos = _startpos__1_ in
              
# 2782 "src/reason-parser/reason_parser.mly"
    ( let loc_colon = mklocation _startpos__2_ _endpos__2_ in
      let loc = mklocation _symbolstartpos _endpos in
      mkexp_cons loc_colon (mkexp ~ghost:true ~loc (Pexp_tuple[_5;_7])) loc
    )
# 58380 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__8_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58389 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58395 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58401 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1093 "src/reason-parser/reason_parser.mly"
       (string)
# 58435 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4461 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 58449 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 58457 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 58467 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58476 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58482 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58488 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1094 "src/reason-parser/reason_parser.mly"
       (string)
# 58522 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4462 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 58536 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 58544 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 58554 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58563 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58569 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58575 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1095 "src/reason-parser/reason_parser.mly"
       (string)
# 58609 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4463 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 58623 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 58631 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 58641 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58650 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58656 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58662 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1096 "src/reason-parser/reason_parser.mly"
       (string)
# 58696 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4464 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 58710 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 58718 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 58728 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58737 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58743 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58749 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4466 "src/reason-parser/reason_parser.mly"
                      ( "/>" )
# 58793 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 58801 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 58811 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58820 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58826 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58832 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : (
# 1099 "src/reason-parser/reason_parser.mly"
       (string)
# 58866 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4467 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 58880 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 58888 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 58898 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58907 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58913 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 58919 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4468 "src/reason-parser/reason_parser.mly"
                      ( "+" )
# 58963 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 58971 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 58981 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 58990 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 58996 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59002 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4469 "src/reason-parser/reason_parser.mly"
                      ( "+." )
# 59046 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59054 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59064 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59073 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59079 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59085 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4470 "src/reason-parser/reason_parser.mly"
                      ( "-" )
# 59129 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59137 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59147 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59156 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59162 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59168 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4471 "src/reason-parser/reason_parser.mly"
                      ( "-." )
# 59212 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59220 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59230 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59239 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59245 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59251 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4472 "src/reason-parser/reason_parser.mly"
                      ( "*" )
# 59295 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59303 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59313 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59322 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59328 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59334 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4473 "src/reason-parser/reason_parser.mly"
                      ( "<" )
# 59378 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59386 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59396 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59405 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59411 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59417 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4474 "src/reason-parser/reason_parser.mly"
                      ( ">" )
# 59461 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59469 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59479 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59488 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59494 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59500 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4475 "src/reason-parser/reason_parser.mly"
                      ( "or" )
# 59544 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59552 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59562 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59571 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59577 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59583 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4476 "src/reason-parser/reason_parser.mly"
                      ( "||" )
# 59627 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59635 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59645 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59654 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59660 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59666 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4477 "src/reason-parser/reason_parser.mly"
                      ( "&" )
# 59710 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59718 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59728 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59737 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59743 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59749 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4478 "src/reason-parser/reason_parser.mly"
                      ( "&&" )
# 59793 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59801 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59811 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59820 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59826 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59832 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4479 "src/reason-parser/reason_parser.mly"
                      ( ":=" )
# 59876 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59884 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59894 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59903 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59909 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59915 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4480 "src/reason-parser/reason_parser.mly"
                      ( "+=" )
# 59959 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 59967 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 59977 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 59986 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 59992 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 59998 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4481 "src/reason-parser/reason_parser.mly"
                      ( "%" )
# 60042 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 60050 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 60060 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60069 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60075 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60081 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4488 "src/reason-parser/reason_parser.mly"
                      ( "<..>" )
# 60125 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 60133 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 60143 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60152 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60158 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60164 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_startpos__1_, _1) = (_startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4489 "src/reason-parser/reason_parser.mly"
                      ( ">>" )
# 60215 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 60223 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 60233 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60242 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60248 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60254 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _1_inlined1;
            MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
            MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let x = 
# 4490 "src/reason-parser/reason_parser.mly"
                     ( ">..." )
# 60298 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 60306 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2787 "src/reason-parser/reason_parser.mly"
    ( let op = match _2.txt with
      | "->" -> {_2 with txt = "|."}
      | _ -> _2
      in mkinfix _1 op _3
    )
# 60316 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60325 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60331 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60337 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let x : (string) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 60375 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2793 "src/reason-parser/reason_parser.mly"
    ( mkuminus _1 _2 )
# 60381 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos_x_ = _endpos__2_ in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60390 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60396 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60402 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = x;
            MenhirLib.EngineTypes.startp = _startpos_x_;
            MenhirLib.EngineTypes.endp = _endpos_x_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let x : (string) = Obj.magic x in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos_x_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 60440 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2795 "src/reason-parser/reason_parser.mly"
    ( mkuplus _1 _2 )
# 60446 "src/reason-parser/reason_parser.ml"
              
            in
            let _endpos_x_ = _endpos__2_ in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60455 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60461 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60467 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _2;
          MenhirLib.EngineTypes.startp = _startpos__2_;
          MenhirLib.EngineTypes.endp = _endpos__2_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _2 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__2_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let x = 
# 2796 "src/reason-parser/reason_parser.mly"
                ("!")
# 60503 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 60511 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2797 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_apply(mkoperator _1, [Nolabel,_2])) )
# 60517 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__2_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60526 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60532 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60538 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let x : (Longident.t) = Obj.magic x in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _3 =
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 60600 "src/reason-parser/reason_parser.ml"
                
              in
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 60609 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2799 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_setfield(_1, _3, _5)) )
# 60615 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60624 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60630 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60636 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 60705 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos = _endpos__6_ in
              let _symbolstartpos = _startpos__1_ in
              
# 2801 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "Array" "set") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp,
                       [Nolabel,_1; Nolabel,_3; Nolabel,_6]))
    )
# 60717 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__6_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60726 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60732 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60738 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__7_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 60814 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos = _endpos__7_ in
              let _symbolstartpos = _startpos__1_ in
              
# 2807 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let exp = Pexp_ident(array_function ~loc "String" "set") in
      mkexp(Pexp_apply(mkexp ~ghost:true ~loc exp,
                       [Nolabel,_1; Nolabel,_4; Nolabel,_7]))
    )
# 60826 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__7_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60835 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60841 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60847 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__4_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__4_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _1_inlined2;
                  MenhirLib.EngineTypes.startp = _startpos__1_inlined2_;
                  MenhirLib.EngineTypes.endp = _endpos__1_inlined2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _;
                      MenhirLib.EngineTypes.semv = _1_inlined1;
                      MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                      MenhirLib.EngineTypes.next = {
                        MenhirLib.EngineTypes.state = _menhir_s;
                        MenhirLib.EngineTypes.semv = _1;
                        MenhirLib.EngineTypes.startp = _startpos__1_;
                        MenhirLib.EngineTypes.endp = _endpos__1_;
                        MenhirLib.EngineTypes.next = _menhir_stack;
                      };
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _5 : unit = Obj.magic _5 in
        let _4_inlined1 : (unit option) = Obj.magic _4_inlined1 in
        let _1_inlined2 : (Migrate_parsetree.Ast_404.Parsetree.expression list) = Obj.magic _1_inlined2 in
        let _2 : unit = Obj.magic _2 in
        let _1_inlined1 : unit = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_4, _1_inlined1, _1) = (_4_inlined1, _1_inlined2, _1_inlined1) in
                let _3 =
                  let _1 = _1_inlined1 in
                  
# 4841 "src/reason-parser/reason_parser.mly"
                                       ( List.rev _1 )
# 60931 "src/reason-parser/reason_parser.ml"
                  
                in
                
# 2899 "src/reason-parser/reason_parser.mly"
                                                                 ( _3 )
# 60937 "src/reason-parser/reason_parser.ml"
                
              in
              let _1 =
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 60946 "src/reason-parser/reason_parser.ml"
                
              in
              let _endpos = _endpos__4_ in
              let _symbolstartpos = _startpos__1_ in
              
# 2813 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      bigarray_set ~loc _1 _2 _4
    )
# 60956 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__4_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 60965 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 60971 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 60977 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 61012 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _1 =
                let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 61024 "src/reason-parser/reason_parser.ml"
                 in
                let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
                let _endpos = _endpos_x_ in
                let _symbolstartpos = _startpos_x_ in
                
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 61032 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2817 "src/reason-parser/reason_parser.mly"
    ( mkexp(Pexp_setinstvar(_1, _3)) )
# 61038 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__3_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 61047 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 61053 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 61059 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 61101 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2819 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_assert _2) )
# 61107 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 61116 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 61122 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 61128 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _menhir_s;
            MenhirLib.EngineTypes.semv = _1;
            MenhirLib.EngineTypes.startp = _startpos__1_;
            MenhirLib.EngineTypes.endp = _endpos__1_;
            MenhirLib.EngineTypes.next = _menhir_stack;
          };
        } = _menhir_stack in
        let _1_inlined1 : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) = Obj.magic _1_inlined1 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x =
              let _2 =
                let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
                let _endpos = _endpos__1_ in
                let _startpos = _startpos__1_ in
                
# 3023 "src/reason-parser/reason_parser.mly"
                                      ( mkexp_app_rev _startpos _endpos _1 )
# 61170 "src/reason-parser/reason_parser.ml"
                
              in
              
# 2821 "src/reason-parser/reason_parser.mly"
    ( mkexp (Pexp_lazy _2) )
# 61176 "src/reason-parser/reason_parser.ml"
              
            in
            let (_endpos_x_, _startpos_x_) = (_endpos__1_inlined1_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 61185 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 61191 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 61197 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.expression) = let _1 =
          let _1 =
            let x = 
# 2847 "src/reason-parser/reason_parser.mly"
    ( (* Should use ghost expressions, but not sure how that would work with source maps *)
      (* So ? will become true and : becomes false for now*)
      let loc_question = mklocation _startpos__2_ _endpos__2_ in
      let loc_colon = mklocation _startpos__4_ _endpos__4_ in
      let fauxTruePat =
        Pat.mk ~loc:loc_question (Ppat_construct({txt = Lident "true"; loc = loc_question}, None)) in
      let fauxFalsePat =
        Pat.mk ~loc:loc_colon (Ppat_construct({txt = Lident "false"; loc = loc_colon}, None)) in
      let fauxMatchCaseTrue = Exp.case fauxTruePat _3 in
      let fauxMatchCaseFalse = Exp.case fauxFalsePat _5 in
      mkexp (Pexp_match (_1, [fauxMatchCaseTrue; fauxMatchCaseFalse]))
    )
# 61263 "src/reason-parser/reason_parser.ml"
             in
            let (_endpos_x_, _startpos_x_) = (_endpos__5_, _startpos__1_) in
            let _endpos = _endpos_x_ in
            let _symbolstartpos = _startpos_x_ in
            
# 4781 "src/reason-parser/reason_parser.mly"
  ( {x with pexp_loc = {x.pexp_loc with loc_start = _symbolstartpos; loc_end = _endpos}} )
# 61271 "src/reason-parser/reason_parser.ml"
            
          in
          
# 2859 "src/reason-parser/reason_parser.mly"
    (_1)
# 61277 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2877 "src/reason-parser/reason_parser.mly"
                                                ( _1 )
# 61283 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (
# 1329 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list)
# 61308 "src/reason-parser/reason_parser.ml"
        ) = 
# 1390 "src/reason-parser/reason_parser.mly"
                     ( apply_mapper_to_use_file _1 reason_mapper )
# 61312 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) = 
# 1386 "src/reason-parser/reason_parser.mly"
    ( _1 )
# 61337 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 61358 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (string) = 
# 4456 "src/reason-parser/reason_parser.mly"
                           ( _1 )
# 61366 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : unit = Obj.magic _3 in
        let _2 : (string) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (string) = 
# 4457 "src/reason-parser/reason_parser.mly"
                           ( _2 )
# 61405 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : (string) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Longident.t) = 
# 4510 "src/reason-parser/reason_parser.mly"
                                  ( Lident _1 )
# 61430 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _3;
          MenhirLib.EngineTypes.startp = _startpos__3_;
          MenhirLib.EngineTypes.endp = _endpos__3_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _2;
            MenhirLib.EngineTypes.startp = _startpos__2_;
            MenhirLib.EngineTypes.endp = _endpos__2_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _menhir_s;
              MenhirLib.EngineTypes.semv = _1;
              MenhirLib.EngineTypes.startp = _startpos__1_;
              MenhirLib.EngineTypes.endp = _endpos__1_;
              MenhirLib.EngineTypes.next = _menhir_stack;
            };
          };
        } = _menhir_stack in
        let _3 : (string) = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Longident.t) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__3_ in
        let _v : (Longident.t) = 
# 4511 "src/reason-parser/reason_parser.mly"
                                  ( Ldot(_1, _3) )
# 61469 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 61522 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _4 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 61536 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 61544 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__6_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2038 "src/reason-parser/reason_parser.mly"
    ( if _1 = Override then
        not_expecting _symbolstartpos _endpos
          "members marked virtual may not also be marked overridden";
      (_4, Mutable, Cfk_virtual _6)
    )
# 61559 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _7;
          MenhirLib.EngineTypes.startp = _startpos__7_;
          MenhirLib.EngineTypes.endp = _endpos__7_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = _2;
                    MenhirLib.EngineTypes.startp = _startpos__2_;
                    MenhirLib.EngineTypes.endp = _endpos__2_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _7 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _7 in
        let _6 : unit = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _5 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 61620 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let _2 : unit = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__7_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _4 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 61634 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 61642 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__7_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          _startpos__2_ in
        
# 2044 "src/reason-parser/reason_parser.mly"
    ( not_expecting _startpos__6_ _endpos__6_
        "not expecting equal - cannot specify value for virtual val";
      let loc = mklocation _symbolstartpos _endpos in
      let e = ghexp_constraint loc _7 _5 in
      (_4, Mutable, Cfk_concrete (_1, e)) )
# 61657 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 61704 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _3 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 61717 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 61725 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2050 "src/reason-parser/reason_parser.mly"
    ( (_3, _2, Cfk_virtual _5) )
# 61731 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _4 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 61786 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _3 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 61799 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 61807 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__6_ in
        let _symbolstartpos = _startpos__1_ in
        
# 2052 "src/reason-parser/reason_parser.mly"
    ( not_expecting _startpos__5_ _endpos__5_
        "not expecting equal - cannot specify value for virtual val";
      let loc = mklocation _symbolstartpos _endpos in
      let e = ghexp_constraint loc _6 _4 in
      (_3, _2, Cfk_concrete (Fresh, e)) )
# 61819 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _2;
                MenhirLib.EngineTypes.startp = _startpos__2_;
                MenhirLib.EngineTypes.endp = _endpos__2_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 61866 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _3 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 61879 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 61887 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2058 "src/reason-parser/reason_parser.mly"
    ( (_3, _2, Cfk_concrete (_1, _5)) )
# 61893 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _1_inlined1;
                MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
                MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _2;
                  MenhirLib.EngineTypes.startp = _startpos__2_;
                  MenhirLib.EngineTypes.endp = _endpos__2_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.expression) = Obj.magic _6 in
        let _5 : unit = Obj.magic _5 in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) = Obj.magic _4 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 61948 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _2 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) = Obj.magic _2 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.override_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) = let _3 =
          let (_endpos__1_, _startpos__1_, _1) = (_endpos__1_inlined1_, _startpos__1_inlined1_, _1_inlined1) in
          let x = 
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 61961 "src/reason-parser/reason_parser.ml"
           in
          let (_endpos_x_, _startpos_x_) = (_endpos__1_, _startpos__1_) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 61969 "src/reason-parser/reason_parser.ml"
          
        in
        let _startpos__3_ = _startpos__1_inlined1_ in
        let _endpos = _endpos__6_ in
        let _symbolstartpos = if _startpos__1_ != _endpos__1_ then
          _startpos__1_
        else
          if _startpos__2_ != _endpos__2_ then
            _startpos__2_
          else
            _startpos__3_ in
        
# 2060 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let e = ghexp_constraint loc _6 _4 in
      (_3, _2, Cfk_concrete (_1, e)) )
# 61986 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _4;
          MenhirLib.EngineTypes.startp = _startpos__4_;
          MenhirLib.EngineTypes.endp = _endpos__4_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _1_inlined1;
              MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
              MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let _4 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _4 in
        let _3 : unit = Obj.magic _3 in
        let _1_inlined1 : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 62027 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic _1_inlined1 in
        let _1 : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__4_ in
        let _v : (string * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type) = let _2 =
          let _1 = _1_inlined1 in
          
# 4594 "src/reason-parser/reason_parser.mly"
                      ( _1 )
# 62041 "src/reason-parser/reason_parser.ml"
          
        in
        
# 2292 "src/reason-parser/reason_parser.mly"
  ( let (mut, virt) = _1 in (_2, mut, virt, _4) )
# 62047 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let _menhir_s = _menhir_env.MenhirLib.EngineTypes.current in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _endpos = _startpos in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = 
# 4622 "src/reason-parser/reason_parser.mly"
                  ( Concrete )
# 62065 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = _1;
          MenhirLib.EngineTypes.startp = _startpos__1_;
          MenhirLib.EngineTypes.endp = _endpos__1_;
          MenhirLib.EngineTypes.next = _menhir_stack;
        } = _menhir_stack in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_ in
        let _v : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) = 
# 4623 "src/reason-parser/reason_parser.mly"
                  ( Virtual )
# 62090 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _6;
          MenhirLib.EngineTypes.startp = _startpos__6_;
          MenhirLib.EngineTypes.endp = _endpos__6_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _5;
            MenhirLib.EngineTypes.startp = _startpos__5_;
            MenhirLib.EngineTypes.endp = _endpos__5_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _4;
              MenhirLib.EngineTypes.startp = _startpos__4_;
              MenhirLib.EngineTypes.endp = _endpos__4_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _3;
                MenhirLib.EngineTypes.startp = _startpos__3_;
                MenhirLib.EngineTypes.endp = _endpos__3_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = x;
                  MenhirLib.EngineTypes.startp = _startpos_x_;
                  MenhirLib.EngineTypes.endp = _endpos_x_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _menhir_s;
                    MenhirLib.EngineTypes.semv = _1;
                    MenhirLib.EngineTypes.startp = _startpos__1_;
                    MenhirLib.EngineTypes.endp = _endpos__1_;
                    MenhirLib.EngineTypes.next = _menhir_stack;
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__6_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) = let _7 = 
# 3832 "src/reason-parser/reason_parser.mly"
    ( [] )
# 62152 "src/reason-parser/reason_parser.ml"
         in
        let _endpos__7_ = _endpos__6_ in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 62161 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__7_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4036 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let typ = Type.mk {_2 with txt=Longident.last _2.txt}
                  ~params:_3 ~cstrs:_7 ~manifest:_6 ~priv:_5 ~loc in
      Pwith_type (_2, typ)
    )
# 62173 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _1_inlined1;
          MenhirLib.EngineTypes.startp = _startpos__1_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos__1_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _6;
            MenhirLib.EngineTypes.startp = _startpos__6_;
            MenhirLib.EngineTypes.endp = _endpos__6_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _5;
              MenhirLib.EngineTypes.startp = _startpos__5_;
              MenhirLib.EngineTypes.endp = _endpos__5_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = _4;
                MenhirLib.EngineTypes.startp = _startpos__4_;
                MenhirLib.EngineTypes.endp = _endpos__4_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _;
                  MenhirLib.EngineTypes.semv = _3;
                  MenhirLib.EngineTypes.startp = _startpos__3_;
                  MenhirLib.EngineTypes.endp = _endpos__3_;
                  MenhirLib.EngineTypes.next = {
                    MenhirLib.EngineTypes.state = _;
                    MenhirLib.EngineTypes.semv = x;
                    MenhirLib.EngineTypes.startp = _startpos_x_;
                    MenhirLib.EngineTypes.endp = _endpos_x_;
                    MenhirLib.EngineTypes.next = {
                      MenhirLib.EngineTypes.state = _menhir_s;
                      MenhirLib.EngineTypes.semv = _1;
                      MenhirLib.EngineTypes.startp = _startpos__1_;
                      MenhirLib.EngineTypes.endp = _endpos__1_;
                      MenhirLib.EngineTypes.next = _menhir_stack;
                    };
                  };
                };
              };
            };
          };
        } = _menhir_stack in
        let _1_inlined1 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list) = Obj.magic _1_inlined1 in
        let _6 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _6 in
        let _5 : (Migrate_parsetree.Ast_404.Asttypes.private_flag) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__1_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) = let _7 =
          let _1 = _1_inlined1 in
          
# 3833 "src/reason-parser/reason_parser.mly"
                                     ( _1 )
# 62246 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos__7_ = _endpos__1_inlined1_ in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 62256 "src/reason-parser/reason_parser.ml"
          
        in
        let _endpos = _endpos__7_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4036 "src/reason-parser/reason_parser.mly"
    ( let loc = mklocation _symbolstartpos _endpos in
      let typ = Type.mk {_2 with txt=Longident.last _2.txt}
                  ~params:_3 ~cstrs:_7 ~manifest:_6 ~priv:_5 ~loc in
      Pwith_type (_2, typ)
    )
# 62268 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = _5;
          MenhirLib.EngineTypes.startp = _startpos__5_;
          MenhirLib.EngineTypes.endp = _endpos__5_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _4;
            MenhirLib.EngineTypes.startp = _startpos__4_;
            MenhirLib.EngineTypes.endp = _endpos__4_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = _3;
              MenhirLib.EngineTypes.startp = _startpos__3_;
              MenhirLib.EngineTypes.endp = _endpos__3_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _;
                MenhirLib.EngineTypes.semv = x;
                MenhirLib.EngineTypes.startp = _startpos_x_;
                MenhirLib.EngineTypes.endp = _endpos_x_;
                MenhirLib.EngineTypes.next = {
                  MenhirLib.EngineTypes.state = _menhir_s;
                  MenhirLib.EngineTypes.semv = _1;
                  MenhirLib.EngineTypes.startp = _startpos__1_;
                  MenhirLib.EngineTypes.endp = _endpos__1_;
                  MenhirLib.EngineTypes.next = _menhir_stack;
                };
              };
            };
          };
        } = _menhir_stack in
        let _5 : (Migrate_parsetree.Ast_404.Parsetree.core_type) = Obj.magic _5 in
        let _4 : unit = Obj.magic _4 in
        let _3 : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) = Obj.magic _3 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos__5_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) = let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 62326 "src/reason-parser/reason_parser.ml"
          
        in
        let (_endpos__2_, _startpos__2_) = (_endpos_x_, _startpos_x_) in
        let _endpos = _endpos__5_ in
        let _symbolstartpos = _startpos__1_ in
        
# 4045 "src/reason-parser/reason_parser.mly"
    ( let last = match _2.txt with
        | Lident s -> s
        | other ->
          not_expecting _startpos__2_ _endpos__2_ "Long type identifier";
          let rec fallback = function
            | Lident s -> s
            | Ldot (_, s) -> s
            | Lapply (l, _) -> fallback l
          in
          fallback other
      in
      let loc = mklocation _symbolstartpos _endpos in
      Pwith_typesubst (Type.mk {_2 with txt=last} ~params:_3 ~manifest:_5 ~loc)
    )
# 62348 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x_inlined1;
          MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let x : (Longident.t) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) = let _4 =
          let (_endpos_x_, _startpos_x_, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, x_inlined1) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 62398 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 62407 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4060 "src/reason-parser/reason_parser.mly"
      ( Pwith_module (_2, _4) )
# 62413 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
      (fun _menhir_env ->
        let _menhir_stack = _menhir_env.MenhirLib.EngineTypes.stack in
        let {
          MenhirLib.EngineTypes.state = _;
          MenhirLib.EngineTypes.semv = x_inlined1;
          MenhirLib.EngineTypes.startp = _startpos_x_inlined1_;
          MenhirLib.EngineTypes.endp = _endpos_x_inlined1_;
          MenhirLib.EngineTypes.next = {
            MenhirLib.EngineTypes.state = _;
            MenhirLib.EngineTypes.semv = _3;
            MenhirLib.EngineTypes.startp = _startpos__3_;
            MenhirLib.EngineTypes.endp = _endpos__3_;
            MenhirLib.EngineTypes.next = {
              MenhirLib.EngineTypes.state = _;
              MenhirLib.EngineTypes.semv = x;
              MenhirLib.EngineTypes.startp = _startpos_x_;
              MenhirLib.EngineTypes.endp = _endpos_x_;
              MenhirLib.EngineTypes.next = {
                MenhirLib.EngineTypes.state = _menhir_s;
                MenhirLib.EngineTypes.semv = _1;
                MenhirLib.EngineTypes.startp = _startpos__1_;
                MenhirLib.EngineTypes.endp = _endpos__1_;
                MenhirLib.EngineTypes.next = _menhir_stack;
              };
            };
          };
        } = _menhir_stack in
        let x_inlined1 : (Longident.t) = Obj.magic x_inlined1 in
        let _3 : unit = Obj.magic _3 in
        let x : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 62454 "src/reason-parser/reason_parser.ml"
        ) = Obj.magic x in
        let _1 : unit = Obj.magic _1 in
        let _endpos__0_ = _menhir_stack.MenhirLib.EngineTypes.endp in
        let _startpos = _startpos__1_ in
        let _endpos = _endpos_x_inlined1_ in
        let _v : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) = let _4 =
          let (_endpos_x_, _startpos_x_, x) = (_endpos_x_inlined1_, _startpos_x_inlined1_, x_inlined1) in
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 62467 "src/reason-parser/reason_parser.ml"
          
        in
        let _2 =
          let _endpos = _endpos_x_ in
          let _symbolstartpos = _startpos_x_ in
          
# 4809 "src/reason-parser/reason_parser.mly"
  ( mkloc x (mklocation _symbolstartpos _endpos) )
# 62476 "src/reason-parser/reason_parser.ml"
          
        in
        
# 4062 "src/reason-parser/reason_parser.mly"
      ( Pwith_modsubst (_2, _4) )
# 62482 "src/reason-parser/reason_parser.ml"
         in
        {
          MenhirLib.EngineTypes.state = _menhir_s;
          MenhirLib.EngineTypes.semv = Obj.repr _v;
          MenhirLib.EngineTypes.startp = _startpos;
          MenhirLib.EngineTypes.endp = _endpos;
          MenhirLib.EngineTypes.next = _menhir_stack;
        });
    |]
  
  and trace =
    None
  
end

module MenhirInterpreter = struct
  
  module ET = MenhirLib.TableInterpreter.MakeEngineTable (Tables)
  
  module TI = MenhirLib.Engine.Make (ET)
  
  include TI
  
  module Symbols = struct
    
    type _ terminal = 
      | T_error : unit terminal
      | T_WITH : unit terminal
      | T_WHILE : unit terminal
      | T_WHEN : unit terminal
      | T_VIRTUAL : unit terminal
      | T_VAL : unit terminal
      | T_UNDERSCORE : unit terminal
      | T_UIDENT : (
# 1168 "src/reason-parser/reason_parser.mly"
       (string)
# 62519 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_TYPE : unit terminal
      | T_TRY : unit terminal
      | T_TRUE : unit terminal
      | T_TO : unit terminal
      | T_TILDE : unit terminal
      | T_THEN : unit terminal
      | T_SWITCH : unit terminal
      | T_STRUCT : unit terminal
      | T_STRING : (
# 1159 "src/reason-parser/reason_parser.mly"
       (string * string option * string option)
# 62532 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_STAR : unit terminal
      | T_SLASHGREATER : unit terminal
      | T_SIG : unit terminal
      | T_SHARPOP : (
# 1155 "src/reason-parser/reason_parser.mly"
       (string)
# 62540 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_SHARPEQUAL : unit terminal
      | T_SHARP : unit terminal
      | T_SEMISEMI : unit terminal
      | T_SEMI : unit terminal
      | T_RPAREN : unit terminal
      | T_REC : unit terminal
      | T_RBRACKET : unit terminal
      | T_RBRACE : unit terminal
      | T_QUOTE : unit terminal
      | T_QUESTION : unit terminal
      | T_PUB : unit terminal
      | T_PRI : unit terminal
      | T_PREFIXOP : (
# 1142 "src/reason-parser/reason_parser.mly"
       (string)
# 62557 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_POSTFIXOP : (
# 1143 "src/reason-parser/reason_parser.mly"
       (string)
# 62562 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_PLUSEQ : unit terminal
      | T_PLUSDOT : unit terminal
      | T_PLUS : unit terminal
      | T_PERCENT : unit terminal
      | T_OR : unit terminal
      | T_OPEN : unit terminal
      | T_OF : unit terminal
      | T_OBJECT : unit terminal
      | T_NONREC : unit terminal
      | T_NEW : unit terminal
      | T_NATIVEINT : (
# 1131 "src/reason-parser/reason_parser.mly"
       (nativeint)
# 62577 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_MUTABLE : unit terminal
      | T_MODULE : unit terminal
      | T_MINUSGREATER : unit terminal
      | T_MINUSDOT : unit terminal
      | T_MINUS : unit terminal
      | T_LPAREN : unit terminal
      | T_LIDENT : (
# 1120 "src/reason-parser/reason_parser.mly"
       (string)
# 62588 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_LET : unit terminal
      | T_LESSSLASHIDENTGREATER : (
# 1151 "src/reason-parser/reason_parser.mly"
       (string)
# 62594 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_LESSSLASHGREATER : unit terminal
      | T_LESSIDENT : (
# 1114 "src/reason-parser/reason_parser.mly"
       (string)
# 62600 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_LESSGREATER : unit terminal
      | T_LESSDOTDOTGREATER : unit terminal
      | T_LESS : unit terminal
      | T_LBRACKETPERCENTPERCENT : unit terminal
      | T_LBRACKETPERCENT : unit terminal
      | T_LBRACKETLESS : unit terminal
      | T_LBRACKETGREATER : unit terminal
      | T_LBRACKETBAR : unit terminal
      | T_LBRACKETAT : unit terminal
      | T_LBRACKET : unit terminal
      | T_LBRACELESS : unit terminal
      | T_LBRACE : unit terminal
      | T_LAZY : unit terminal
      | T_INT : (
# 1102 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 62618 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_INITIALIZER : unit terminal
      | T_INHERIT : unit terminal
      | T_INFIXOP4 : (
# 1099 "src/reason-parser/reason_parser.mly"
       (string)
# 62625 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_INFIXOP3 : (
# 1096 "src/reason-parser/reason_parser.mly"
       (string)
# 62630 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_INFIXOP2 : (
# 1095 "src/reason-parser/reason_parser.mly"
       (string)
# 62635 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_INFIXOP1 : (
# 1094 "src/reason-parser/reason_parser.mly"
       (string)
# 62640 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_INFIXOP0 : (
# 1093 "src/reason-parser/reason_parser.mly"
       (string)
# 62645 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_INCLUDE : unit terminal
      | T_IN : unit terminal
      | T_IF : unit terminal
      | T_GREATERRBRACE : unit terminal
      | T_GREATERDOTDOTDOT : unit terminal
      | T_GREATER : unit terminal
      | T_FUNCTOR : unit terminal
      | T_FUNCTION : unit terminal
      | T_FUN : unit terminal
      | T_FOR : unit terminal
      | T_FLOAT : (
# 1081 "src/reason-parser/reason_parser.mly"
       (string * char option)
# 62660 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_FALSE : unit terminal
      | T_EXTERNAL : unit terminal
      | T_EXCEPTION : unit terminal
      | T_ES6_FUN : unit terminal
      | T_EQUALGREATER : unit terminal
      | T_EQUAL : unit terminal
      | T_EOL : unit terminal
      | T_EOF : unit terminal
      | T_END : unit terminal
      | T_ELSE : unit terminal
      | T_DOWNTO : unit terminal
      | T_DOTDOTDOT : unit terminal
      | T_DOTDOT : unit terminal
      | T_DOT : unit terminal
      | T_DONE : unit terminal
      | T_DOCSTRING : (
# 1176 "src/reason-parser/reason_parser.mly"
       (string)
# 62680 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_DO : unit terminal
      | T_CONSTRAINT : unit terminal
      | T_COMMENT : (
# 1175 "src/reason-parser/reason_parser.mly"
       (string * Location.t)
# 62687 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_COMMA : unit terminal
      | T_COLONGREATER : unit terminal
      | T_COLONEQUAL : unit terminal
      | T_COLONCOLON : unit terminal
      | T_COLON : unit terminal
      | T_CLASS : unit terminal
      | T_CHAR : (
# 1060 "src/reason-parser/reason_parser.mly"
       (char)
# 62698 "src/reason-parser/reason_parser.ml"
    ) terminal
      | T_BEGIN : unit terminal
      | T_BARRBRACKET : unit terminal
      | T_BARBAR : unit terminal
      | T_BAR : unit terminal
      | T_BANG : unit terminal
      | T_BACKQUOTE : unit terminal
      | T_ASSERT : unit terminal
      | T_AS : unit terminal
      | T_AND : unit terminal
      | T_AMPERSAND : unit terminal
      | T_AMPERAMPER : unit terminal
    
    type _ nonterminal = 
      | N_with_constraint : (Migrate_parsetree.Ast_404.Parsetree.with_constraint) nonterminal
      | N_virtual_flag : (Migrate_parsetree.Ast_404.Asttypes.virtual_flag) nonterminal
      | N_value_type : (string * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_value : (string Location.loc * Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Parsetree.class_field_kind) nonterminal
      | N_val_longident : (Longident.t) nonterminal
      | N_val_ident : (string) nonterminal
      | N_use_file_no_mapper : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) nonterminal
      | N_use_file : (
# 1329 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list)
# 62726 "src/reason-parser/reason_parser.ml"
    ) nonterminal
      | N_unattributed_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_unattributed_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_type_variance : (Migrate_parsetree.Ast_404.Asttypes.variance) nonterminal
      | N_type_variables_with_variance_comma_list : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_type_variables_with_variance : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_type_variable_with_variance : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) nonterminal
      | N_type_variable : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_type_parameters : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
      | N_type_parameter : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) nonterminal
      | N_type_other_kind : (Migrate_parsetree.Ast_404.Parsetree.type_kind *
  Migrate_parsetree.Ast_404.Asttypes.private_flag *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
      | N_type_longident : (Migrate_parsetree.Ast_404.Ast_helper.lid) nonterminal
      | N_type_declarations : (Migrate_parsetree.Ast_404.Asttypes.rec_flag *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
      | N_type_declaration_kind : ((Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
      | N_type_declaration_details : ((Migrate_parsetree.Ast_404.Ast_helper.str *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Asttypes.variance)
   list *
   (Migrate_parsetree.Ast_404.Parsetree.core_type *
    Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
   list * Migrate_parsetree.Ast_404.Parsetree.type_kind *
   Migrate_parsetree.Ast_404.Asttypes.private_flag *
   Migrate_parsetree.Ast_404.Parsetree.core_type option) *
  Lexing.position * Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
      | N_type_constraint : (Migrate_parsetree.Ast_404.Parsetree.core_type option *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
      | N_toplevel_phrase : (
# 1327 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase)
# 62771 "src/reason-parser/reason_parser.ml"
    ) nonterminal
      | N_toplevel_directive : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) nonterminal
      | N_tag_field : (Migrate_parsetree.Ast_404.Parsetree.row_field) nonterminal
      | N_subtractive : (string) nonterminal
      | N_structure_item : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) nonterminal
      | N_structure : (Migrate_parsetree.OCaml_404.Ast.Parsetree.structure) nonterminal
      | N_string_literal_labels : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
      | N_string_literal_label : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_string_literal_exprs_maybe_punned : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
      | N_string_literal_expr_maybe_punned_with_comma : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_string_literal_expr_maybe_punned : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_str_type_extension : (Migrate_parsetree.Ast_404.Parsetree.type_extension) nonterminal
      | N_str_exception_declaration : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
      | N_single_attr_id : (string) nonterminal
      | N_simple_pattern_not_ident_ : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_simple_pattern_not_ident : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_simple_pattern_ident : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_simple_pattern_direct_argument : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_simple_pattern : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_simple_module_type : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
      | N_simple_expr_template_constructor : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_simple_expr_no_constructor : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_simple_expr_no_call : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_simple_expr_direct_argument : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_simple_expr_call : (Migrate_parsetree.Ast_404.Parsetree.expression *
  (Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
      | N_signed_constant : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) nonterminal
      | N_signature_items : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) nonterminal
      | N_signature_item : (Migrate_parsetree.Ast_404.Parsetree.signature_item_desc) nonterminal
      | N_signature : (Migrate_parsetree.OCaml_404.Ast.Parsetree.signature) nonterminal
      | N_sig_type_extension : (Migrate_parsetree.Ast_404.Parsetree.type_extension) nonterminal
      | N_sig_exception_declaration : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
      | N_seq_expr_no_seq : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_seq_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_separated_nonempty_list_AMPERSAND_non_arrowed_simple_core_types_ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
      | N_row_field_list : (Migrate_parsetree.Ast_404.Parsetree.row_field list) nonterminal
      | N_row_field : (Migrate_parsetree.Ast_404.Parsetree.row_field) nonterminal
      | N_record_label_declaration : (Migrate_parsetree.Ast_404.Parsetree.label_declaration) nonterminal
      | N_record_expr_with_string_keys : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
      | N_record_expr : (Migrate_parsetree.Ast_404.Parsetree.expression option *
  (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
      | N_record_declaration : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) nonterminal
      | N_rec_flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) nonterminal
      | N_protected_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_primitive_declaration : (string list) nonterminal
      | N_poly_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_payload : (Migrate_parsetree.Ast_404.Parsetree.payload) nonterminal
      | N_pattern_without_or : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_pattern_optional_constraint : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_pattern_constructor_argument : (Migrate_parsetree.Ast_404.Parsetree.pattern list) nonterminal
      | N_pattern_comma_list_extension : (Migrate_parsetree.Ast_404.Parsetree.pattern list *
  Migrate_parsetree.Ast_404.Parsetree.pattern option) nonterminal
      | N_pattern : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_parse_pattern : (
# 1335 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.pattern)
# 62838 "src/reason-parser/reason_parser.ml"
    ) nonterminal
      | N_parse_expression : (
# 1333 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.expression)
# 62843 "src/reason-parser/reason_parser.ml"
    ) nonterminal
      | N_parse_core_type : (
# 1331 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.core_type)
# 62848 "src/reason-parser/reason_parser.ml"
    ) nonterminal
      | N_parenthesized_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_package_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_override_flag : (Migrate_parsetree.Ast_404.Asttypes.override_flag) nonterminal
      | N_optional_expr_extension : (Migrate_parsetree.Ast_404.Parsetree.expression ->
  Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_optional : (string -> Migrate_parsetree.Ast_404.Asttypes.arg_label) nonterminal
      | N_option_type_constraint_ : ((Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) nonterminal
      | N_option_preceded_WHEN_expr__ : (Migrate_parsetree.Ast_404.Parsetree.expression option) nonterminal
      | N_option_preceded_COLONGREATER_core_type__ : (Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
      | N_option_preceded_COLON_simple_module_type__ : (Migrate_parsetree.Ast_404.Parsetree.module_type option) nonterminal
      | N_option_preceded_COLON_poly_type__ : (Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
      | N_option_preceded_COLON_non_arrowed_core_type__ : (Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
      | N_option_preceded_COLON_expr__ : (Migrate_parsetree.Ast_404.Parsetree.expression option) nonterminal
      | N_option_preceded_COLON_core_type__ : (Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
      | N_option_preceded_COLON_class_constructor_type__ : (Migrate_parsetree.Ast_404.Parsetree.class_type option) nonterminal
      | N_option_preceded_AS_LIDENT__ : (string option) nonterminal
      | N_option_item_extension_sugar_ : ((Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) option) nonterminal
      | N_option_constructor_arguments_ : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments option) nonterminal
      | N_option_SEMI_ : (unit option) nonterminal
      | N_option_OF_ : (unit option) nonterminal
      | N_option_MODULE_ : (unit option) nonterminal
      | N_option_LET_ : (unit option) nonterminal
      | N_option_DOTDOTDOT_ : (unit option) nonterminal
      | N_option_DOT_ : (unit option) nonterminal
      | N_option_COMMA_ : (unit option) nonterminal
      | N_opt_LET_MODULE_ident : (Migrate_parsetree.Ast_404.Ast_helper.str) nonterminal
      | N_opt_LET_MODULE_REC_ident : (Migrate_parsetree.Ast_404.Ast_helper.str) nonterminal
      | N_opt_LET_MODULE : (unit) nonterminal
      | N_operator : (string) nonterminal
      | N_open_statement : (Migrate_parsetree.Ast_404.Parsetree.open_description) nonterminal
      | N_object_record_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_object_label_declarations : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
      | N_object_label_declaration : (string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_object_body_class_fields : (Migrate_parsetree.Ast_404.Parsetree.class_field list) nonterminal
      | N_object_body : (Migrate_parsetree.Ast_404.Parsetree.class_structure) nonterminal
      | N_nonrec_flag : (Migrate_parsetree.Ast_404.Asttypes.rec_flag) nonterminal
      | N_nonempty_list_preceded_QUOTE_ident__ : (string list) nonterminal
      | N_nonempty_list_preceded_CONSTRAINT_constrain__ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list) nonterminal
      | N_nonempty_list_name_tag_ : (string list) nonterminal
      | N_nonempty_list_attributed_ext_constructor_extension_constructor_declaration__ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
      | N_nonempty_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
      | N_nonempty_list_as_loc_attribute__ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) nonterminal
      | N_nonempty_list___anonymous_32_ : (string list) nonterminal
      | N_nonempty_list_LIDENT_ : (string list) nonterminal
      | N_non_labeled_argument_list : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
      | N_non_arrowed_simple_core_types : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_non_arrowed_simple_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_non_arrowed_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_mutable_or_virtual_flags : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag) nonterminal
      | N_mutable_flag : (Migrate_parsetree.Ast_404.Asttypes.mutable_flag) nonterminal
      | N_mty_longident : (Longident.t) nonterminal
      | N_module_type_signature : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
      | N_module_type_body_EQUAL_ : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
      | N_module_type_body_COLON_ : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
      | N_module_type : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
      | N_module_parameter : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc) nonterminal
      | N_module_expr_structure : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
      | N_module_expr_body : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
      | N_module_expr : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
      | N_module_declaration : (Migrate_parsetree.Ast_404.Parsetree.module_type) nonterminal
      | N_module_complex_expr : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
      | N_module_binding_body : (Migrate_parsetree.Ast_404.Parsetree.module_expr) nonterminal
      | N_module_arguments_comma_list : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) nonterminal
      | N_module_arguments : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) nonterminal
      | N_mod_longident : (Longident.t) nonterminal
      | N_mod_ext_longident : (Longident.t) nonterminal
      | N_mod_ext_apply : (Longident.t) nonterminal
      | N_method_ : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.class_field_kind) nonterminal
      | N_match_case_seq_expr_ : (Migrate_parsetree.Ast_404.Parsetree.case) nonterminal
      | N_match_case_expr_ : (Migrate_parsetree.Ast_404.Parsetree.case) nonterminal
      | N_lseparated_nonempty_list_aux_SEMI_class_sig_field_ : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list list) nonterminal
      | N_lseparated_nonempty_list_aux_SEMI_class_field_ : (Migrate_parsetree.Ast_404.Parsetree.class_field list list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_uncurried_labeled_expr_ : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_uncurried_arrow_type_parameter_ : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_type_variable_with_variance_ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_type_parameter_ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_string_literal_label_ : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_string_literal_expr_maybe_punned_ : ((Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_record_label_declaration_ : (Migrate_parsetree.Ast_404.Parsetree.label_declaration list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_protected_type_ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_pattern_optional_constraint_ : (Migrate_parsetree.Ast_404.Parsetree.pattern list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_opt_spread_pattern__ : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.pattern) list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_opt_spread_lbl_expr__ : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_opt_spread_expr_optional_constraint__ : ((Location.t option * Migrate_parsetree.Ast_404.Parsetree.expression) list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_object_label_declaration_ : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_module_parameter_ : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_module_complex_expr_ : (Migrate_parsetree.Ast_404.Parsetree.module_expr list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_mod_ext_longident_ : (Longident.t list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_labeled_pattern_ : (Reason_parser_def.labelled_parameter Location.loc list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_field_expr_ : ((string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_expr_optional_constraint_ : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_expr_ : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
      | N_lseparated_nonempty_list_aux_COMMA_core_type_ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
      | N_lseparated_nonempty_list_aux_AND_with_constraint_ : (Migrate_parsetree.Ast_404.Parsetree.with_constraint list) nonterminal
      | N_loption_type_parameters_ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
      | N_loption_terminated_pattern_comma_list_option_COMMA___ : (Migrate_parsetree.Ast_404.Parsetree.pattern list) nonterminal
      | N_loption_row_field_list_ : (Migrate_parsetree.Ast_404.Parsetree.row_field list) nonterminal
      | N_loption_preceded_GREATER_nonempty_list_name_tag___ : (string list) nonterminal
      | N_loption_parenthesized_type_variables_with_variance_comma_list__ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_loption_parenthesized_class_type_arguments_comma_list__ : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
      | N_loption_object_label_declarations_ : ((string * Migrate_parsetree.OCaml_404.Ast.Parsetree.attributes *
   Migrate_parsetree.Ast_404.Parsetree.core_type)
  list) nonterminal
      | N_loption_located_attributes_ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute Location.loc list) nonterminal
      | N_loption_functor_parameters_ : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) nonterminal
      | N_loption_class_type_parameters_ : ((Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_longident_type_constraint : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) nonterminal
      | N_llist_aux_preceded_COMMA_opt_spread_lbl_expr___ : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression))
  list) nonterminal
      | N_llist_aux_match_case_seq_expr__ : (Migrate_parsetree.Ast_404.Parsetree.case list) nonterminal
      | N_llist_aux_match_case_expr__ : (Migrate_parsetree.Ast_404.Parsetree.case list) nonterminal
      | N_list_simple_expr_no_call_ : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
      | N_list_bar_row_field_ : (Migrate_parsetree.Ast_404.Parsetree.row_field list) nonterminal
      | N_list_attributed_ext_constructor_extension_constructor_declaration__ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
      | N_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
      | N_list_and_module_rec_declaration_ : (Migrate_parsetree.Ast_404.Parsetree.module_declaration list) nonterminal
      | N_list_and_module_bindings_ : (Migrate_parsetree.Ast_404.Parsetree.module_binding list) nonterminal
      | N_list_and_let_binding_ : (Migrate_parsetree.Ast_404.Parsetree.value_binding list) nonterminal
      | N_list_and_class_type_declaration_ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) nonterminal
      | N_list_and_class_description_ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) nonterminal
      | N_list_and_class_declaration_ : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration list) nonterminal
      | N_let_bindings : (Reason_parser_def.let_bindings) nonterminal
      | N_let_binding_body : (Migrate_parsetree.Ast_404.Parsetree.pattern *
  Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_let_binding : (Reason_parser_def.let_bindings) nonterminal
      | N_lbl_pattern : (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_labelled_arrow_type_parameter_optional : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_labeled_pattern_constraint : (string Location.loc -> Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_labeled_pattern : (Reason_parser_def.labelled_parameter Location.loc) nonterminal
      | N_labeled_expr_constraint : (Longident.t Location.loc -> Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_labeled_expr : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_labeled_arguments : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
      | N_label_longident : (Longident.t) nonterminal
      | N_jsx_without_leading_less : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_jsx_start_tag_and_args_without_leading_less : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) nonterminal
      | N_jsx_start_tag_and_args : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.expression)
   list -> Location.t -> Migrate_parsetree.Ast_404.Parsetree.expression) *
  Longident.t) nonterminal
      | N_jsx_arguments : ((Migrate_parsetree.Ast_404.Asttypes.arg_label *
   Migrate_parsetree.Ast_404.Parsetree.expression)
  list) nonterminal
      | N_jsx : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_item_extension_sugar : (Migrate_parsetree.Ast_404.Ast_helper.attrs * string Location.loc) nonterminal
      | N_item_extension : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) nonterminal
      | N_interface : (
# 1325 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.signature)
# 63043 "src/reason-parser/reason_parser.ml"
    ) nonterminal
      | N_implementation : (
# 1323 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.structure)
# 63048 "src/reason-parser/reason_parser.ml"
    ) nonterminal
      | N_ident : (string) nonterminal
      | N_greater_spread : (string) nonterminal
      | N_generalized_constructor_arguments : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments *
  Migrate_parsetree.Ast_404.Parsetree.core_type option) nonterminal
      | N_functor_parameters : ((string Location.loc option *
   Migrate_parsetree.Ast_404.Parsetree.module_type option)
  Location.loc list) nonterminal
      | N_fun_def_EQUALGREATER_non_arrowed_core_type_ : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_fun_def_EQUAL_core_type_ : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_field_expr : (string Location.loc * Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_extension_constructor_rebind : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
      | N_extension_constructor_declaration : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
      | N_extension : (Migrate_parsetree.OCaml_404.Ast.Parsetree.extension) nonterminal
      | N_expr_optional_constraint : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_expr_list : (Migrate_parsetree.Ast_404.Parsetree.expression list) nonterminal
      | N_expr_comma_seq_extension : (Migrate_parsetree.Ast_404.Parsetree.expression list *
  Migrate_parsetree.Ast_404.Parsetree.expression option) nonterminal
      | N_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_es6_parameters : (Reason_parser_def.labelled_parameter Location.loc list * bool) nonterminal
      | N_embedded_private_flag_ : (Migrate_parsetree.Ast_404.Asttypes.private_flag) nonterminal
      | N_embedded___anonymous_39_ : (Migrate_parsetree.Ast_404.Parsetree.directive_argument) nonterminal
      | N_embedded___anonymous_33_ : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Asttypes.variance) nonterminal
      | N_embedded___anonymous_1_ : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list) nonterminal
      | N_embedded___anonymous_0_ : (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase) nonterminal
      | N_either_preceded_EQUALGREATER_expr__braced_expr_ : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_either_preceded_EQUAL_expr__braced_expr_ : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_either_preceded_EQUAL_class_instance_type__class_type_body_ : (Migrate_parsetree.Ast_404.Parsetree.class_type) nonterminal
      | N_either_preceded_EQUAL_class_expr__class_body_expr_ : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
      | N_either_parenthesized_longident_type_constraint__longident_type_constraint_ : (Longident.t Location.loc *
  (Migrate_parsetree.Ast_404.Parsetree.core_type option *
   Migrate_parsetree.Ast_404.Parsetree.core_type option)
  option) nonterminal
      | N_either_extension_constructor_declaration_extension_constructor_rebind_ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor) nonterminal
      | N_either_constructor_declaration_bar_constructor_declaration_ : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) nonterminal
      | N_either___anonymous_12___anonymous_13_ : (Migrate_parsetree.Ast_404.Asttypes.private_flag) nonterminal
      | N_either_ES6_FUN_FUN_ : (unit) nonterminal
      | N_direction_flag : (Migrate_parsetree.Ast_404.Asttypes.direction_flag) nonterminal
      | N_core_type2 : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_constructor_declarations_aux : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
      | N_constructor_declarations : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration list *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t)
  list * Lexing.position *
  Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
      | N_constructor_declaration : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) nonterminal
      | N_constructor_arguments_comma_list : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
      | N_constructor_arguments : (Migrate_parsetree.Ast_404.Parsetree.constructor_arguments) nonterminal
      | N_constrain_field : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_constrain : (Migrate_parsetree.Ast_404.Parsetree.core_type *
  Migrate_parsetree.Ast_404.Parsetree.core_type * Location.t) nonterminal
      | N_constr_longident : (Longident.t) nonterminal
      | N_constant : (Migrate_parsetree.Ast_404.Ast_helper.attrs *
  Migrate_parsetree.Ast_404.Parsetree.constant) nonterminal
      | N_clty_longident : (Longident.t) nonterminal
      | N_class_type_declarations : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration list) nonterminal
      | N_class_type_declaration_details : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_class_type_body : (Migrate_parsetree.Ast_404.Parsetree.class_type) nonterminal
      | N_class_type_arguments_comma_list : (Migrate_parsetree.Ast_404.Parsetree.core_type list) nonterminal
      | N_class_simple_expr : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
      | N_class_sig_field : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) nonterminal
      | N_class_sig_body_fields : (Migrate_parsetree.Ast_404.Parsetree.class_type_field list) nonterminal
      | N_class_sig_body : (Migrate_parsetree.Ast_404.Parsetree.class_signature) nonterminal
      | N_class_self_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_class_self_expr : (Migrate_parsetree.Ast_404.Parsetree.pattern) nonterminal
      | N_class_longident : (Longident.t) nonterminal
      | N_class_instance_type : (Migrate_parsetree.Ast_404.Parsetree.class_type) nonterminal
      | N_class_field : (Migrate_parsetree.Ast_404.Parsetree.class_field list) nonterminal
      | N_class_expr_lets_and_rest : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
      | N_class_expr : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
      | N_class_descriptions : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description list) nonterminal
      | N_class_description_details : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_type *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_class_declaration_details : (Migrate_parsetree.Ast_404.Ast_helper.str *
  Migrate_parsetree.Ast_404.Parsetree.class_expr *
  Migrate_parsetree.Ast_404.Asttypes.virtual_flag *
  (Migrate_parsetree.Ast_404.Parsetree.core_type *
   Migrate_parsetree.Ast_404.Asttypes.variance)
  list) nonterminal
      | N_class_declaration_body : (Migrate_parsetree.Ast_404.Parsetree.class_expr) nonterminal
      | N_class_constructor_type : (Migrate_parsetree.Ast_404.Parsetree.class_type) nonterminal
      | N_braced_expr : (Migrate_parsetree.Ast_404.Parsetree.expression) nonterminal
      | N_boption_AMPERSAND_ : (bool) nonterminal
      | N_basic_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_bar_row_field : (Migrate_parsetree.Ast_404.Parsetree.row_field) nonterminal
      | N_bar_constructor_declaration : (Migrate_parsetree.Ast_404.Parsetree.constructor_declaration) nonterminal
      | N_attributed_ext_constructors_extension_constructor_declaration_ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
      | N_attributed_ext_constructors_either_extension_constructor_declaration_extension_constructor_rebind__ : (Migrate_parsetree.Ast_404.Parsetree.extension_constructor list) nonterminal
      | N_attribute : (Migrate_parsetree.OCaml_404.Ast.Parsetree.attribute) nonterminal
      | N_attr_id : (string Location.loc) nonterminal
      | N_arrowed_simple_core_type : (Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_arrow_type_parameters : (((Migrate_parsetree.Ast_404.Asttypes.arg_label *
    Migrate_parsetree.Ast_404.Parsetree.core_type)
   Location.loc * bool)
  list) nonterminal
      | N_arrow_type_parameter : (Migrate_parsetree.Ast_404.Asttypes.arg_label *
  Migrate_parsetree.Ast_404.Parsetree.core_type) nonterminal
      | N_and_type_declaration : (Migrate_parsetree.Ast_404.Parsetree.type_declaration list) nonterminal
      | N_and_module_rec_declaration : (Migrate_parsetree.Ast_404.Parsetree.module_declaration) nonterminal
      | N_and_module_bindings : (Migrate_parsetree.Ast_404.Parsetree.module_binding) nonterminal
      | N_and_class_type_declaration : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_type_declaration) nonterminal
      | N_and_class_description : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_description) nonterminal
      | N_and_class_declaration : (Migrate_parsetree.OCaml_404.Ast.Parsetree.class_declaration) nonterminal
      | N_additive : (string) nonterminal
      | N__lbl_pattern_list : ((Location.t option *
   (Longident.t Location.loc * Migrate_parsetree.Ast_404.Parsetree.pattern))
  list * Migrate_parsetree.Ast_404.Asttypes.closed_flag) nonterminal
    
  end
  
  include Symbols
  
  include MenhirLib.InspectionTableInterpreter.Make (Tables) (struct
    
    include TI
    
    include Symbols
    
    include MenhirLib.InspectionTableInterpreter.Symbols (Symbols)
    
    let terminal =
      fun t ->
        match t with
        | 0 ->
            X (T T_error)
        | 1 ->
            X (T T_WITH)
        | 2 ->
            X (T T_WHILE)
        | 3 ->
            X (T T_WHEN)
        | 4 ->
            X (T T_VIRTUAL)
        | 5 ->
            X (T T_VAL)
        | 6 ->
            X (T T_UNDERSCORE)
        | 7 ->
            X (T T_UIDENT)
        | 8 ->
            X (T T_TYPE)
        | 9 ->
            X (T T_TRY)
        | 10 ->
            X (T T_TRUE)
        | 11 ->
            X (T T_TO)
        | 12 ->
            X (T T_TILDE)
        | 13 ->
            X (T T_THEN)
        | 14 ->
            X (T T_SWITCH)
        | 15 ->
            X (T T_STRUCT)
        | 16 ->
            X (T T_STRING)
        | 17 ->
            X (T T_STAR)
        | 18 ->
            X (T T_SLASHGREATER)
        | 19 ->
            X (T T_SIG)
        | 20 ->
            X (T T_SHARPOP)
        | 21 ->
            X (T T_SHARPEQUAL)
        | 22 ->
            X (T T_SHARP)
        | 23 ->
            X (T T_SEMISEMI)
        | 24 ->
            X (T T_SEMI)
        | 25 ->
            X (T T_RPAREN)
        | 26 ->
            X (T T_REC)
        | 27 ->
            X (T T_RBRACKET)
        | 28 ->
            X (T T_RBRACE)
        | 29 ->
            X (T T_QUOTE)
        | 30 ->
            X (T T_QUESTION)
        | 31 ->
            X (T T_PUB)
        | 32 ->
            X (T T_PRI)
        | 33 ->
            X (T T_PREFIXOP)
        | 34 ->
            X (T T_POSTFIXOP)
        | 35 ->
            X (T T_PLUSEQ)
        | 36 ->
            X (T T_PLUSDOT)
        | 37 ->
            X (T T_PLUS)
        | 38 ->
            X (T T_PERCENT)
        | 39 ->
            X (T T_OR)
        | 40 ->
            X (T T_OPEN)
        | 41 ->
            X (T T_OF)
        | 42 ->
            X (T T_OBJECT)
        | 43 ->
            X (T T_NONREC)
        | 44 ->
            X (T T_NEW)
        | 45 ->
            X (T T_NATIVEINT)
        | 46 ->
            X (T T_MUTABLE)
        | 47 ->
            X (T T_MODULE)
        | 48 ->
            X (T T_MINUSGREATER)
        | 49 ->
            X (T T_MINUSDOT)
        | 50 ->
            X (T T_MINUS)
        | 51 ->
            X (T T_LPAREN)
        | 52 ->
            X (T T_LIDENT)
        | 53 ->
            X (T T_LET)
        | 54 ->
            X (T T_LESSSLASHIDENTGREATER)
        | 55 ->
            X (T T_LESSSLASHGREATER)
        | 56 ->
            X (T T_LESSIDENT)
        | 57 ->
            X (T T_LESSGREATER)
        | 58 ->
            X (T T_LESSDOTDOTGREATER)
        | 59 ->
            X (T T_LESS)
        | 60 ->
            X (T T_LBRACKETPERCENTPERCENT)
        | 61 ->
            X (T T_LBRACKETPERCENT)
        | 62 ->
            X (T T_LBRACKETLESS)
        | 63 ->
            X (T T_LBRACKETGREATER)
        | 64 ->
            X (T T_LBRACKETBAR)
        | 65 ->
            X (T T_LBRACKETAT)
        | 66 ->
            X (T T_LBRACKET)
        | 67 ->
            X (T T_LBRACELESS)
        | 68 ->
            X (T T_LBRACE)
        | 69 ->
            X (T T_LAZY)
        | 70 ->
            X (T T_INT)
        | 71 ->
            X (T T_INITIALIZER)
        | 72 ->
            X (T T_INHERIT)
        | 73 ->
            X (T T_INFIXOP4)
        | 74 ->
            X (T T_INFIXOP3)
        | 75 ->
            X (T T_INFIXOP2)
        | 76 ->
            X (T T_INFIXOP1)
        | 77 ->
            X (T T_INFIXOP0)
        | 78 ->
            X (T T_INCLUDE)
        | 79 ->
            X (T T_IN)
        | 80 ->
            X (T T_IF)
        | 81 ->
            X (T T_GREATERRBRACE)
        | 82 ->
            X (T T_GREATERDOTDOTDOT)
        | 83 ->
            X (T T_GREATER)
        | 84 ->
            X (T T_FUNCTOR)
        | 85 ->
            X (T T_FUNCTION)
        | 86 ->
            X (T T_FUN)
        | 87 ->
            X (T T_FOR)
        | 88 ->
            X (T T_FLOAT)
        | 89 ->
            X (T T_FALSE)
        | 90 ->
            X (T T_EXTERNAL)
        | 91 ->
            X (T T_EXCEPTION)
        | 92 ->
            X (T T_ES6_FUN)
        | 93 ->
            X (T T_EQUALGREATER)
        | 94 ->
            X (T T_EQUAL)
        | 95 ->
            X (T T_EOL)
        | 96 ->
            X (T T_EOF)
        | 97 ->
            X (T T_END)
        | 98 ->
            X (T T_ELSE)
        | 99 ->
            X (T T_DOWNTO)
        | 100 ->
            X (T T_DOTDOTDOT)
        | 101 ->
            X (T T_DOTDOT)
        | 102 ->
            X (T T_DOT)
        | 103 ->
            X (T T_DONE)
        | 104 ->
            X (T T_DOCSTRING)
        | 105 ->
            X (T T_DO)
        | 106 ->
            X (T T_CONSTRAINT)
        | 107 ->
            X (T T_COMMENT)
        | 108 ->
            X (T T_COMMA)
        | 109 ->
            X (T T_COLONGREATER)
        | 110 ->
            X (T T_COLONEQUAL)
        | 111 ->
            X (T T_COLONCOLON)
        | 112 ->
            X (T T_COLON)
        | 113 ->
            X (T T_CLASS)
        | 114 ->
            X (T T_CHAR)
        | 115 ->
            X (T T_BEGIN)
        | 116 ->
            X (T T_BARRBRACKET)
        | 117 ->
            X (T T_BARBAR)
        | 118 ->
            X (T T_BAR)
        | 119 ->
            X (T T_BANG)
        | 120 ->
            X (T T_BACKQUOTE)
        | 121 ->
            X (T T_ASSERT)
        | 122 ->
            X (T T_AS)
        | 123 ->
            X (T T_AND)
        | 124 ->
            X (T T_AMPERSAND)
        | 125 ->
            X (T T_AMPERAMPER)
        | _ ->
            assert false
    
    and nonterminal =
      fun nt ->
        match nt with
        | 301 ->
            X (N N__lbl_pattern_list)
        | 300 ->
            X (N N_additive)
        | 299 ->
            X (N N_and_class_declaration)
        | 298 ->
            X (N N_and_class_description)
        | 297 ->
            X (N N_and_class_type_declaration)
        | 296 ->
            X (N N_and_module_bindings)
        | 295 ->
            X (N N_and_module_rec_declaration)
        | 294 ->
            X (N N_and_type_declaration)
        | 293 ->
            X (N N_arrow_type_parameter)
        | 292 ->
            X (N N_arrow_type_parameters)
        | 291 ->
            X (N N_arrowed_simple_core_type)
        | 290 ->
            X (N N_attr_id)
        | 289 ->
            X (N N_attribute)
        | 288 ->
            X (N N_attributed_ext_constructors_either_extension_constructor_declaration_extension_constructor_rebind__)
        | 287 ->
            X (N N_attributed_ext_constructors_extension_constructor_declaration_)
        | 286 ->
            X (N N_bar_constructor_declaration)
        | 285 ->
            X (N N_bar_row_field)
        | 284 ->
            X (N N_basic_core_type)
        | 283 ->
            X (N N_boption_AMPERSAND_)
        | 282 ->
            X (N N_braced_expr)
        | 281 ->
            X (N N_class_constructor_type)
        | 280 ->
            X (N N_class_declaration_body)
        | 279 ->
            X (N N_class_declaration_details)
        | 278 ->
            X (N N_class_description_details)
        | 277 ->
            X (N N_class_descriptions)
        | 276 ->
            X (N N_class_expr)
        | 275 ->
            X (N N_class_expr_lets_and_rest)
        | 274 ->
            X (N N_class_field)
        | 273 ->
            X (N N_class_instance_type)
        | 272 ->
            X (N N_class_longident)
        | 271 ->
            X (N N_class_self_expr)
        | 270 ->
            X (N N_class_self_type)
        | 269 ->
            X (N N_class_sig_body)
        | 268 ->
            X (N N_class_sig_body_fields)
        | 267 ->
            X (N N_class_sig_field)
        | 266 ->
            X (N N_class_simple_expr)
        | 265 ->
            X (N N_class_type_arguments_comma_list)
        | 264 ->
            X (N N_class_type_body)
        | 263 ->
            X (N N_class_type_declaration_details)
        | 262 ->
            X (N N_class_type_declarations)
        | 261 ->
            X (N N_clty_longident)
        | 260 ->
            X (N N_constant)
        | 259 ->
            X (N N_constr_longident)
        | 258 ->
            X (N N_constrain)
        | 257 ->
            X (N N_constrain_field)
        | 256 ->
            X (N N_constructor_arguments)
        | 255 ->
            X (N N_constructor_arguments_comma_list)
        | 254 ->
            X (N N_constructor_declaration)
        | 253 ->
            X (N N_constructor_declarations)
        | 252 ->
            X (N N_constructor_declarations_aux)
        | 251 ->
            X (N N_core_type)
        | 250 ->
            X (N N_core_type2)
        | 249 ->
            X (N N_direction_flag)
        | 248 ->
            X (N N_either_ES6_FUN_FUN_)
        | 247 ->
            X (N N_either___anonymous_12___anonymous_13_)
        | 246 ->
            X (N N_either_constructor_declaration_bar_constructor_declaration_)
        | 245 ->
            X (N N_either_extension_constructor_declaration_extension_constructor_rebind_)
        | 244 ->
            X (N N_either_parenthesized_longident_type_constraint__longident_type_constraint_)
        | 243 ->
            X (N N_either_preceded_EQUAL_class_expr__class_body_expr_)
        | 242 ->
            X (N N_either_preceded_EQUAL_class_instance_type__class_type_body_)
        | 241 ->
            X (N N_either_preceded_EQUAL_expr__braced_expr_)
        | 240 ->
            X (N N_either_preceded_EQUALGREATER_expr__braced_expr_)
        | 239 ->
            X (N N_embedded___anonymous_0_)
        | 238 ->
            X (N N_embedded___anonymous_1_)
        | 237 ->
            X (N N_embedded___anonymous_33_)
        | 236 ->
            X (N N_embedded___anonymous_39_)
        | 235 ->
            X (N N_embedded_private_flag_)
        | 234 ->
            X (N N_es6_parameters)
        | 233 ->
            X (N N_expr)
        | 232 ->
            X (N N_expr_comma_seq_extension)
        | 231 ->
            X (N N_expr_list)
        | 230 ->
            X (N N_expr_optional_constraint)
        | 229 ->
            X (N N_extension)
        | 228 ->
            X (N N_extension_constructor_declaration)
        | 227 ->
            X (N N_extension_constructor_rebind)
        | 226 ->
            X (N N_field_expr)
        | 225 ->
            X (N N_fun_def_EQUAL_core_type_)
        | 224 ->
            X (N N_fun_def_EQUALGREATER_non_arrowed_core_type_)
        | 223 ->
            X (N N_functor_parameters)
        | 222 ->
            X (N N_generalized_constructor_arguments)
        | 221 ->
            X (N N_greater_spread)
        | 220 ->
            X (N N_ident)
        | 219 ->
            X (N N_implementation)
        | 218 ->
            X (N N_interface)
        | 217 ->
            X (N N_item_extension)
        | 216 ->
            X (N N_item_extension_sugar)
        | 215 ->
            X (N N_jsx)
        | 214 ->
            X (N N_jsx_arguments)
        | 213 ->
            X (N N_jsx_start_tag_and_args)
        | 212 ->
            X (N N_jsx_start_tag_and_args_without_leading_less)
        | 211 ->
            X (N N_jsx_without_leading_less)
        | 210 ->
            X (N N_label_longident)
        | 209 ->
            X (N N_labeled_arguments)
        | 208 ->
            X (N N_labeled_expr)
        | 207 ->
            X (N N_labeled_expr_constraint)
        | 206 ->
            X (N N_labeled_pattern)
        | 205 ->
            X (N N_labeled_pattern_constraint)
        | 204 ->
            X (N N_labelled_arrow_type_parameter_optional)
        | 203 ->
            X (N N_lbl_pattern)
        | 202 ->
            X (N N_let_binding)
        | 201 ->
            X (N N_let_binding_body)
        | 200 ->
            X (N N_let_bindings)
        | 199 ->
            X (N N_list_and_class_declaration_)
        | 198 ->
            X (N N_list_and_class_description_)
        | 197 ->
            X (N N_list_and_class_type_declaration_)
        | 196 ->
            X (N N_list_and_let_binding_)
        | 195 ->
            X (N N_list_and_module_bindings_)
        | 194 ->
            X (N N_list_and_module_rec_declaration_)
        | 193 ->
            X (N N_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___)
        | 192 ->
            X (N N_list_attributed_ext_constructor_extension_constructor_declaration__)
        | 191 ->
            X (N N_list_bar_row_field_)
        | 190 ->
            X (N N_list_simple_expr_no_call_)
        | 189 ->
            X (N N_llist_aux_match_case_expr__)
        | 188 ->
            X (N N_llist_aux_match_case_seq_expr__)
        | 187 ->
            X (N N_llist_aux_preceded_COMMA_opt_spread_lbl_expr___)
        | 186 ->
            X (N N_longident_type_constraint)
        | 185 ->
            X (N N_loption_class_type_parameters_)
        | 184 ->
            X (N N_loption_functor_parameters_)
        | 183 ->
            X (N N_loption_located_attributes_)
        | 182 ->
            X (N N_loption_object_label_declarations_)
        | 181 ->
            X (N N_loption_parenthesized_class_type_arguments_comma_list__)
        | 180 ->
            X (N N_loption_parenthesized_type_variables_with_variance_comma_list__)
        | 179 ->
            X (N N_loption_preceded_GREATER_nonempty_list_name_tag___)
        | 178 ->
            X (N N_loption_row_field_list_)
        | 177 ->
            X (N N_loption_terminated_pattern_comma_list_option_COMMA___)
        | 176 ->
            X (N N_loption_type_parameters_)
        | 175 ->
            X (N N_lseparated_nonempty_list_aux_AND_with_constraint_)
        | 174 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_core_type_)
        | 173 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_expr_)
        | 172 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_expr_optional_constraint_)
        | 171 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_field_expr_)
        | 170 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_labeled_pattern_)
        | 169 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_mod_ext_longident_)
        | 168 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_module_complex_expr_)
        | 167 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_module_parameter_)
        | 166 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_object_label_declaration_)
        | 165 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_opt_spread_expr_optional_constraint__)
        | 164 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_opt_spread_lbl_expr__)
        | 163 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_opt_spread_pattern__)
        | 162 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_pattern_optional_constraint_)
        | 161 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_protected_type_)
        | 160 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_record_label_declaration_)
        | 159 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_string_literal_expr_maybe_punned_)
        | 158 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_string_literal_label_)
        | 157 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_type_parameter_)
        | 156 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_type_variable_with_variance_)
        | 155 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_uncurried_arrow_type_parameter_)
        | 154 ->
            X (N N_lseparated_nonempty_list_aux_COMMA_uncurried_labeled_expr_)
        | 153 ->
            X (N N_lseparated_nonempty_list_aux_SEMI_class_field_)
        | 152 ->
            X (N N_lseparated_nonempty_list_aux_SEMI_class_sig_field_)
        | 151 ->
            X (N N_match_case_expr_)
        | 150 ->
            X (N N_match_case_seq_expr_)
        | 149 ->
            X (N N_method_)
        | 148 ->
            X (N N_mod_ext_apply)
        | 147 ->
            X (N N_mod_ext_longident)
        | 146 ->
            X (N N_mod_longident)
        | 145 ->
            X (N N_module_arguments)
        | 144 ->
            X (N N_module_arguments_comma_list)
        | 143 ->
            X (N N_module_binding_body)
        | 142 ->
            X (N N_module_complex_expr)
        | 141 ->
            X (N N_module_declaration)
        | 140 ->
            X (N N_module_expr)
        | 139 ->
            X (N N_module_expr_body)
        | 138 ->
            X (N N_module_expr_structure)
        | 137 ->
            X (N N_module_parameter)
        | 136 ->
            X (N N_module_type)
        | 135 ->
            X (N N_module_type_body_COLON_)
        | 134 ->
            X (N N_module_type_body_EQUAL_)
        | 133 ->
            X (N N_module_type_signature)
        | 132 ->
            X (N N_mty_longident)
        | 131 ->
            X (N N_mutable_flag)
        | 130 ->
            X (N N_mutable_or_virtual_flags)
        | 129 ->
            X (N N_non_arrowed_core_type)
        | 128 ->
            X (N N_non_arrowed_simple_core_type)
        | 127 ->
            X (N N_non_arrowed_simple_core_types)
        | 126 ->
            X (N N_non_labeled_argument_list)
        | 125 ->
            X (N N_nonempty_list_LIDENT_)
        | 124 ->
            X (N N_nonempty_list___anonymous_32_)
        | 123 ->
            X (N N_nonempty_list_as_loc_attribute__)
        | 122 ->
            X (N N_nonempty_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___)
        | 121 ->
            X (N N_nonempty_list_attributed_ext_constructor_extension_constructor_declaration__)
        | 120 ->
            X (N N_nonempty_list_name_tag_)
        | 119 ->
            X (N N_nonempty_list_preceded_CONSTRAINT_constrain__)
        | 118 ->
            X (N N_nonempty_list_preceded_QUOTE_ident__)
        | 117 ->
            X (N N_nonrec_flag)
        | 116 ->
            X (N N_object_body)
        | 115 ->
            X (N N_object_body_class_fields)
        | 114 ->
            X (N N_object_label_declaration)
        | 113 ->
            X (N N_object_label_declarations)
        | 112 ->
            X (N N_object_record_type)
        | 111 ->
            X (N N_open_statement)
        | 110 ->
            X (N N_operator)
        | 109 ->
            X (N N_opt_LET_MODULE)
        | 108 ->
            X (N N_opt_LET_MODULE_REC_ident)
        | 107 ->
            X (N N_opt_LET_MODULE_ident)
        | 106 ->
            X (N N_option_COMMA_)
        | 105 ->
            X (N N_option_DOT_)
        | 104 ->
            X (N N_option_DOTDOTDOT_)
        | 103 ->
            X (N N_option_LET_)
        | 102 ->
            X (N N_option_MODULE_)
        | 101 ->
            X (N N_option_OF_)
        | 100 ->
            X (N N_option_SEMI_)
        | 99 ->
            X (N N_option_constructor_arguments_)
        | 98 ->
            X (N N_option_item_extension_sugar_)
        | 97 ->
            X (N N_option_preceded_AS_LIDENT__)
        | 96 ->
            X (N N_option_preceded_COLON_class_constructor_type__)
        | 95 ->
            X (N N_option_preceded_COLON_core_type__)
        | 94 ->
            X (N N_option_preceded_COLON_expr__)
        | 93 ->
            X (N N_option_preceded_COLON_non_arrowed_core_type__)
        | 92 ->
            X (N N_option_preceded_COLON_poly_type__)
        | 91 ->
            X (N N_option_preceded_COLON_simple_module_type__)
        | 90 ->
            X (N N_option_preceded_COLONGREATER_core_type__)
        | 89 ->
            X (N N_option_preceded_WHEN_expr__)
        | 88 ->
            X (N N_option_type_constraint_)
        | 87 ->
            X (N N_optional)
        | 86 ->
            X (N N_optional_expr_extension)
        | 85 ->
            X (N N_override_flag)
        | 84 ->
            X (N N_package_type)
        | 83 ->
            X (N N_parenthesized_expr)
        | 82 ->
            X (N N_parse_core_type)
        | 81 ->
            X (N N_parse_expression)
        | 80 ->
            X (N N_parse_pattern)
        | 79 ->
            X (N N_pattern)
        | 78 ->
            X (N N_pattern_comma_list_extension)
        | 77 ->
            X (N N_pattern_constructor_argument)
        | 76 ->
            X (N N_pattern_optional_constraint)
        | 75 ->
            X (N N_pattern_without_or)
        | 74 ->
            X (N N_payload)
        | 73 ->
            X (N N_poly_type)
        | 72 ->
            X (N N_primitive_declaration)
        | 71 ->
            X (N N_protected_type)
        | 70 ->
            X (N N_rec_flag)
        | 69 ->
            X (N N_record_declaration)
        | 68 ->
            X (N N_record_expr)
        | 67 ->
            X (N N_record_expr_with_string_keys)
        | 66 ->
            X (N N_record_label_declaration)
        | 65 ->
            X (N N_row_field)
        | 64 ->
            X (N N_row_field_list)
        | 63 ->
            X (N N_separated_nonempty_list_AMPERSAND_non_arrowed_simple_core_types_)
        | 62 ->
            X (N N_seq_expr)
        | 61 ->
            X (N N_seq_expr_no_seq)
        | 60 ->
            X (N N_sig_exception_declaration)
        | 59 ->
            X (N N_sig_type_extension)
        | 58 ->
            X (N N_signature)
        | 57 ->
            X (N N_signature_item)
        | 56 ->
            X (N N_signature_items)
        | 55 ->
            X (N N_signed_constant)
        | 54 ->
            X (N N_simple_expr_call)
        | 53 ->
            X (N N_simple_expr_direct_argument)
        | 52 ->
            X (N N_simple_expr_no_call)
        | 51 ->
            X (N N_simple_expr_no_constructor)
        | 50 ->
            X (N N_simple_expr_template_constructor)
        | 49 ->
            X (N N_simple_module_type)
        | 48 ->
            X (N N_simple_pattern)
        | 47 ->
            X (N N_simple_pattern_direct_argument)
        | 46 ->
            X (N N_simple_pattern_ident)
        | 45 ->
            X (N N_simple_pattern_not_ident)
        | 44 ->
            X (N N_simple_pattern_not_ident_)
        | 43 ->
            X (N N_single_attr_id)
        | 42 ->
            X (N N_str_exception_declaration)
        | 41 ->
            X (N N_str_type_extension)
        | 40 ->
            X (N N_string_literal_expr_maybe_punned)
        | 39 ->
            X (N N_string_literal_expr_maybe_punned_with_comma)
        | 38 ->
            X (N N_string_literal_exprs_maybe_punned)
        | 37 ->
            X (N N_string_literal_label)
        | 36 ->
            X (N N_string_literal_labels)
        | 35 ->
            X (N N_structure)
        | 34 ->
            X (N N_structure_item)
        | 33 ->
            X (N N_subtractive)
        | 32 ->
            X (N N_tag_field)
        | 31 ->
            X (N N_toplevel_directive)
        | 30 ->
            X (N N_toplevel_phrase)
        | 29 ->
            X (N N_type_constraint)
        | 28 ->
            X (N N_type_declaration_details)
        | 27 ->
            X (N N_type_declaration_kind)
        | 26 ->
            X (N N_type_declarations)
        | 25 ->
            X (N N_type_longident)
        | 24 ->
            X (N N_type_other_kind)
        | 23 ->
            X (N N_type_parameter)
        | 22 ->
            X (N N_type_parameters)
        | 21 ->
            X (N N_type_variable)
        | 20 ->
            X (N N_type_variable_with_variance)
        | 19 ->
            X (N N_type_variables_with_variance)
        | 18 ->
            X (N N_type_variables_with_variance_comma_list)
        | 17 ->
            X (N N_type_variance)
        | 16 ->
            X (N N_unattributed_core_type)
        | 15 ->
            X (N N_unattributed_expr)
        | 14 ->
            X (N N_use_file)
        | 13 ->
            X (N N_use_file_no_mapper)
        | 12 ->
            X (N N_val_ident)
        | 11 ->
            X (N N_val_longident)
        | 10 ->
            X (N N_value)
        | 9 ->
            X (N N_value_type)
        | 8 ->
            X (N N_virtual_flag)
        | 7 ->
            X (N N_with_constraint)
        | _ ->
            assert false
    
    and lr0_incoming =
      (16, "\000\000\000\006\000N\000\004\000\006\000\b\000\n\000\012\000\016\000\018\000\020\000\022\000\024\000\028\000\030\000 \000(\0006\000B\000P\000R\000T\000V\000X\000Z\000^\000`\000j\000l\000\140\000\144\000\146\000\158\000\160\000\162\000\170\000\172\000\174\000\176\000\180\000\182\000\184\000\196\000\198\000\200\000\208\000\212\000\214\000\228\000\232\000\244\000\246\000\248\000W\000\206\002E\002E\000\173\000h\000\006\000\173\000\138\000\012\000\n\000^\001\007\000j\000\220\000\014\000\016\000h\001'\000\206\000\016\000h\001)\000h\001S\0004\000\218\001'\001S\0004\001S\0004\000\026\000j\000\226\000.\000\016\000j\001%\000\206\000\016\000j\002!\000h\000<\000\016\000j\001\185\000`\000\016\000h\000\014\000\226\000|\002E\000\018\000X\000\235\000\016\000h\000\014\000<\001\185\000L\000\014\000<\001\185\000f\000\014\000<\001\185\000%\0004\000)\0019\000\218\000)\001\219\000\213\000'\000\190\000\016\000h\000j\000~\000\128\000\132\002E\000\020\000\173\000\022\000\"\000D\000Z\002!\000h\000\020\000\173\000j\000r\000>\000j\000j\000\150\000\190\000>\000D\000Z\002!\000h\000\030\000\173\000t\000D\000Z\002!\000h\000$\000&\0004\000D\000x\001'\001\173\000~\000j\001\173\000\168\000\130\000\202\000\218\000\209\000J\000L\000d\000f\000h\000F\000H\000J\000L\000N\000P\000`\000h\000\012\000j\000\190\000\130\000\213\000\234\001K\000\218\000\209\000\134\0008\001K\000\213\001\209\0008\000\136\000j\000\226\000\140\000\142\000\178\000\180\000\230\000\242\001\185\000h\0004\000\162\000\173\000\167\000\023\000\025\000e\000k\000m\000*\000\134\000\242\001\185\000k\000\253\0025\000\023\000e\000i\000*\000i\000,\000m\000,\000m\000.\000j\000F\000b\000i\000.\000j\000F\000b\000i\000\134\000\174\000\173\000h\000\014\000\018\000j\000\026\000j\000\226\000\134\000\138\000:\000\204\000\"\000\226\000<\001\185\000<\001\185\000\237\000\186\000h\000\206\000\211\000\026\000j\000\226\000\210\000!\000-\0003\000-\000\143\000\190\000>\000\175\000\225\000\247\000!\000\255\001\001\001'\000\206\000j\001\153\000\188\001\203\001\245\0029\000\188\001\245\002C\000\247\002G\001\245\000\246\000<\001\185\001\247\000\143\001\153\002K\0017\000\218\000\211\002K\000\213\0004\002I\000\188\001\245\000\147\000\237\000\206\001\247\001\247\000j\000\226\000\147\000I\000:\000K\000\227\000\229\000\247\000\"\000\226\000\147\000j\000\226\000\147\001=\000\218\000K\000\247\000\213\001M\000\218\000\229\000\247\000\213\001m\000:\000\206\000I\000:\001m\000:\000\238\000\242\001\185\000\250\0027\000\127\000\255\000\250\000\127\000A\000\131\000\247\000\242\001\185\0027\000\127\001\001\001\003\0029\002C\001\003\000\129\0008\000\131\000\247\000\238\000\131\001\127\002;\001\127\000\247\002;\001\127\001\247\000\246\000.\0003\000L\000\142\000\178\000`\000\016\000\226\000`\000\205\000\138\000\018\000\235\000j\000h\000'\000H\000B\001\215\000\016\000h\000\138\000\133\000\247\001\007\000j\000\226\000\147\001\007\000j\000\226\000\147\001A\000\218\000\133\000\213\000:\000\139\0004\001]\000\218\001\247\000\213\001\247\001\255\0004\000\139\000\199\000\191\000\225\001\189\002\001\000\022\001\189\000h\0004\001\189\000\134\0008\001\189\000\180\001\189\000\224\001\189\000\238\000\247\001\201\000\243\000\247\000\238\000\247\001\201\000\243\001\201\000\243\001\201\000\243\000\243\001\201\000\238\000\247\001\201\000\247\000\238\000\247\001\201\001\129\001\201\001\129\001\129\001\201\001\129\001\129\002?\0001\000\214\001\247\000\190\001\247\002\005\000\239\000\248\000\016\001i\000j\000'\0007\0009\000\239\000\247\000\248\0009\002M\002M\0009\001'\000\206\000j\000'\000H\001\215\002?\000R\000\240\000\171\001%\000\206\000`\000\018\001\185\000\190\000c\001\t\001\011\001\017\000\004\000\018\000j\001%\000\206\000j\001\165\000'\000\190\001\215\001\247\000\239\000\222\001\247\000`\000\016\000\222\001'\001%\000\190\001'\000\015\001_\000\248\000\015\001'\000\206\000\016\001\185\001\185\001\191\000\188\001\017\001\203\002C\001\017\001\011\001\r\000l\000`\000h\000D\000J\000L\000d\000f\000v\000x\000\148\000\150\000\152\000\154\000\156\000\166\000\168\000\168\000\222\000\236\000\240\000\250\000\252\000\221\0004\000\025\000\226\001\247\000z\002E\000\030\000\173\000\130\000\213\000\234\001K\000\213\000\234\000\242\001\185\000\023\000g\000*\000i\000\206\000\134\000\176\000\173\000h\000f\000\142\000\178\000h\000L\000`\000\016\0004\000f\000\130\000\209\000\134\000\157\0008\001G\000\218\000\209\000\138\000\209\001\151\000\218\000\014\000\213\002[\001\165\000\226\000\140\000h\000\184\000\242\001\185\000\242\001\185\000\025\000Y\000[\000]\000a\000o\000\204\000o\002\t\001%\000\206\000h\0004\000a\000\151\000\224\000\151\000\246\000\025\001\203\002\007\000h\000\153\000\159\000\226\001\247\000\238\000\159\002C\000\151\001E\000\218\000\153\000\213\0004\000\130\001G\000\213\001c\000\234\000\134\000\157\0008\000\138\002[\000:\000_\000\155\001%\002\007\000\159\0004\000\130\001c\000\234\000\134\0008\000\157\0008\000\138\002[\000:\002\007\000\151\001E\000\213\0004\000a\000\159\000\246\000\025\002[\000:\000\159\000\213\000\159\001c\000\234\000\224\0004\000h\000\151\000\218\000\151\0004\000\159\000\160\000\186\000\014\000h\0004\000\206\0004\000\153\001U\000\218\001\157\000\213\0004\001\157\001U\000\213\0004\000]\001\213\000\188\000\240\000\244\000m\000h\000\206\0004\000\211\000\014\000\026\000h\000\023\000\226\000`\000\169\001\017\001\247\000\220\001\247\000\181\000;\000\177\001%\000\206\000\025\001u\0004\000j\000\190\000\175\000\014\000;\000C\000m\000\134\001%\000\206\000h\000`\000\138\000`\000\018\000T\000\203\001\185\001\r\000h\000d\000f\000x\000\224\0004\000h\001\171\000&\000\166\000\168\000\202\000i\000\134\001\175\001\203\001\211\000$\001\211\000&\001\211\000>\001\211\000H\001\211\000J\001\211\000L\001\211\000N\001\211\000P\001\211\000d\001\211\000f\001\211\000v\001\211\000x\001\211\000\148\001\211\000\150\001\211\000\152\001\211\000\154\001\211\000\156\001\211\000\166\001\211\000\168\000\168\001\211\000\222\001\211\000\236\001\211\000\250\001\211\000\252\001\211\002\007\000k\000\253\002\t\002C\001\211\002Y\001\211\001\211\000\226\001\211\0008\000k\001%\000\206\000h\000`\000\174\000\186\001\021\001\025\000h\000\213\001\025\000\226\001\017\001\021\001#\001\029\001!\0004\001%\001Q\000\218\001\029\001\203\001\241\000h\000\016\000\226\001\017\0004\000h\0004\000`\000\018\000T\001\025\0004\002C\001\025\001\017\001\019\0004\000\218\0004\001\019\001O\000\218\001\019\000\213\0004\001\019\0004\001\191\000\226\000h\001\019\0004\000c\000\183\000\188\001\025\000\213\000\226\000\169\0004\000\240\001\211\001Y\000\218\001\205\001\211\000;\000\213\001\205\001\207\0004\000~\001'\001\173\001\167\0008\001\169\000&\000\168\001}\000n\001\175\001\203\002\007\002\t\001\187\000i\000n\000\130\001\207\000\234\000\134\0008\001\209\0008\000\136\001W\000\218\001\197\000\213\000\164\001\197\000\138\000\"\000\218\000\226\001\211\000\218\000\213\000:\000\202\001\205\0002\000\209\001\165\000\226\001\211\001I\000\218\000\209\001\165\000\226\001\211\000\213\000\218\000\"\000\226\001\211\000\189\000M\000Q\000\209\001\165\000\226\001\211\001w\0002\000\218\000\209\001\165\000\226\001\211\000\213\001w\0002\000\213\001?\000\218\000Q\000\213\000O\000M\000\135\000:\000\137\000:\001\165\000\218\000\209\001\165\000\226\001\211\001w\0002\000\213\001w\0002\000\213\000\226\001\211\0002\000\218\000\209\001\165\000\226\001\211\001w\0002\000\213\001w\0002\000\213\000\213\001}\001}\000n\001\187\000i\000n\001\211\000\218\001\211\0004\001\207\0004\000j\000\190\001\211\000l\000\197\0006\000\141\000[\000\226\001\247\000\190\001\211\000]\000h\0004\000\191\000\190\001\211\001\227\0025\000\206\0004\000\191\001\227\001U\000\213\0004\000\191\001\227\001U\000\213\0004\000\191\001\227\000\226\000\018\000j\000\251\000\251\000\206\001\247\000\190\001\211\000\237\000\206\001\247\000\190\001\211\000;\000\190\001\211\001\195\000\159\000\190\001\211\001\147\001\177\000\140\000m\000\134\001\211\0008\000\206\000\134\001\211\0008\000\138\001[\000\218\001\211\000\213\000:\001\211\001\165\000k\001\163\000\158\001\025\000\162\000\173\000\167\000m\000\198\001\211\0025\001\177\000\174\000\173\000\238\000\159\000\b\001\211\000\179\000\188\001\211\001/\001{\001/\001\193\000\176\000\173\000h\000\159\000\160\001\211\000\024\000\200\001\243\001\211\0004\000m\000\182\000\025\000\226\001\247\0002\000\190\000\"\000\249\000\145\000\249\000\184\000\016\000\190\000h\002\007\000\022\000\190\002\007\000h\0004\000\190\002\007\000\134\0008\000\190\002\007\000\180\000\190\002\007\000\224\000\190\002\007\001\199\001\201\001\235\000\186\001\213\000\188\001\211\000\226\001\003\000\188\001\211\002C\000\228\000\n\000\018\000\017\000j\000h\000L\000f\000#\000<\001\185\000+\000/\001;\000\218\000/\000\213\0004\001s\000\138\000\012\000\n\001\007\000^\000\017\000\019\001\005\000j\000\226\001\247\0002\000@\000\017\000j\000\226\000\147\000B\000\017\000j\000\226\000\147\000\146\000j\001'\000\206\000j\001\203\002\011\000h\001]\000\213\002\019\0004\001k\002\017\002#\002C\002#\000\206\000\214\001\247\000\190\001\247\002\003\000\246\001\247\000\201\000\247\000\012\000\019\000@\000\017\000j\000\226\000\147\000B\000\017\000j\000\226\000\147\000\146\002#\000\214\002\003\001\179\0011\0002\001\179\002\023\000\201\002\023\002\025\002\027\000:\002\029\0002\002\025\002\027\000:\000\190\002#\001\229\002\017\002\015\000\248\002\015\000\247\000\248\002\015\001\139\002S\001\139\000\017\000j\000h\0004\000\226\002#\0023\002I\000\188\0023\000\193\000\138\000@\000B\000h\000\138\000l\000\144\000m\000\146\000\171\000\228\002!\000-\001a\001\203\001\241\000h\0004\000\188\002\021\001\163\002!\002)\002C\002)\000\206\0004\000\188\002)\001U\000\213\0004\000\188\002)\001U\000\213\0004\000\188\002)\002)\000\246\000j\000\195\000\214\002\003\000\201\000\231\000\233\000\247\000\012\000\021\000\171\000^\000\n\000j\000\226\001\247\000;\000\190\001\211\001\007\000j\000\190\001\211\000;\000\190\001\211\000l\000\197\000\141\001\147\000\144\000m\000\146\000\171\002)\000\195\000\214\002\003\001\179\001\239\000\171\000\n\000j\000\226\000\147\000j\000\226\000\018\000\251\000\206\001\247\001\227\000\147\000\185\001\227\001\195\001+\0013\0002\000\247\001\179\001\239\001+\002%\000\201\001o\000\246\000\159\002\031\0002\000\231\002%\001\145\0002\001\149\000\248\001\147\000\247\000\248\001\147\001\137\001\137\001\137\002'\002)\002C\002'\000:\002)\0004\000\226\0023\0004\002'\000:\000\190\002)\001\231\0021\000L\000f\000\206\0004\0021\001U\000\213\0004\0021\001;\000\213\0004\000h\0004\0021\000\206\0004\0021\001U\000\213\0004\0021\001U\000\213\0004\0021\0021\001U\000\213\0004\0021\0021\002/\000\248\002/\000\247\000\248\002/\001\143\002W\001\143\000\240\001\211\000\244\000m\000\031\000$\001\211\000&\001\211\000>\001\211\000\226\001\211\000H\001\211\000J\001\211\000L\001\211\000N\001\211\000P\001\211\000d\001\211\000f\001\211\000v\001\211\000x\001\211\000\148\001\211\000\150\001\211\000\152\001\211\000\154\001\211\000\156\001\211\000\166\001\211\000\168\000\168\001\211\001\211\000\222\001\211\000\236\001\211\000\250\001\211\000\252\001\211\0005\000C\001\211\000E\0002\000G\000S\000U\000m\000\134\001\211\0008\000\190\001\211\000\206\000\134\001\211\0008\000\190\001\211\000\138\001[\000\213\000:\000\190\001\211\001\165\000\190\001\211\000\215\001\031\001q\000\190\001\025\000\226\001\017\001\021\001\023\001\023\001\191\000\217\001\031\000\248\000\016\001\031\000\247\000\248\000\016\001\031\001\135\002Q\001\135\000\219\000\016\0006\000\016\000j\000j\000\223\000\247\000\018\000\235\000j\000'\000H\001\215\000\238\000\247\001\235\000\245\000\247\000\238\000\247\001\235\000\245\001\235\000\245\001\235\000\245\000\245\001\235\000\238\000\247\001\235\000\247\000\238\000\247\001\235\001\131\001\235\001\131\001\131\001\235\001\131\001\131\002A\0009\001'\000\206\000j\000'\000H\001\215\002A\000R\000\171\001%\000`\000\018\000\203\001\185\001\r\000l\000\158\001\025\000\182\000\025\000\226\001\247\0002\000\190\000\145\000\184\001\235\000\228\000\018\002\015\001\139\002/\001\143\000\031\000\215\001\031\000\217\001\031\001\135\001\177\000E\001\145\001\177\000E\001\179\002\r\002Y\001\211\001\179\000G\000:\001\025\000\226\000\169\0004\001\207\0004\000~\001\167\0008\000\130\001\207\000\234\000\134\0008\001\209\0008\000\136\001W\000\213\000\164\000\138\000:\000\135\000:\000\137\000:\001\211\0008\000\190\001\211\000\206\000\134\001\211\0008\000\190\001\211\000\138\001[\000\213\000:\000\190\001\211\001\165\000\190\001\211\001\211\001\159\001\205\000\023\000>\001u\001\233\001\161\001\205\000\213\0004\0015\000\218\000\211\001\161\000\213\0004\001\211\000\226\001\003\000\188\001\211\001\211\001\243\001\211\0004\000m\001\211\0008\000\138\001[\000\213\000:\001\165\000,\000m\000.\000j\000F\000b\000i\000\134\001\211\0008\000\138\000\238\000\159\000\179\000\188\000`\000l\000U\0002\000{\000}\000\207\000R\000\171\001%\0002\000}\000\215\001\031\0002\000}\000\219\000\247\000l\000\207\000R\000\171\001%\0002\000}\001\145\0002\000}\001\177\000{\001\211\0002\000}\001\211\0002\000}\002C\000\201\000\201\000}\001-\001y\000:\001-\000\206\000\134\001\211\0008\000\138\001[\000\213\000:\001\165\000k\001%\000\206\000h\000`\001\025\000\226\000\169\0004\001\207\0004\000~\001\167\0008\000\130\001\207\000\234\000\134\0008\001\209\0008\000\136\001W\000\213\000\164\000\138\000:\000\135\000:\000\137\000:\001\175\001\203\002\007\002\t\000>\000\159\000\b\001\211\000\226\000\158\001\017\000\182\000\025\000\226\001\247\0002\000\190\000\145\000\184\001\201\000\228\000\017\000j\001s\000\226\0023\002-\000\248\002-\000\247\000\248\002-\001\141\002U\001\141\0005\000q\0002\000s\000u\000w\000y\000\215\000\190\001%\001\027\001q\000\226\001\017\001\011\001\015\000\217\001\015\000\248\000\016\001\015\000\247\000\248\000\016\001\015\001\133\002O\001\133\000\223\000\247\000\018\000\235\000j\000'\000H\001\215\002?\001'\000\206\000j\000'\000H\001\215\002?\000`\000\018\001\185\001\r\000l\000\025\000\226\001\247\000\158\001\017\000\182\000\025\000\226\001\247\0002\000\190\000\145\000\184\001\201\000\228\002-\001\141\000\215\000\190\001%\001\027\000\217\001\015\001\133\001\179\001\179\002\r\002+\000u\000\247\001\247\000\025\000G\000]\000\188\001\211\000\149\0008\000u\000:\000\169\000\153\000\191\001\155\000\190\000>\001\211\0004\000\226\001\003\000\187\000\188\001\211\001\225\0025\000\206\0004\000\187\001\225\001U\000\213\0004\000\187\001\225\001U\000\213\0004\000\187\001\225\001/\001{\001\193\000\198\001\211\001Y\000\213\0004\000m\001\211\000\164\001W\000\213\000\164\001\205\000\213\000\234\001\211\001\211\000\220\000\205\000\169\000\226\000\205\000\169\000\220\000\205\000\169\0004\001\029\0004\001\025\0004\000\226\000\169\0004\000\224\0004\000h\001\211\000\218\001\211\0004\001\205\000\213\000\234\001K\000\213\000\234\001}\000p\001\167\0008\000\218\0008\001\209\0008\000m\001\207\0004\000i\001}\000p\000g\000\138\001-\001y\000:\000m\001\173\000m\001\173\001\173\001\173\001\173\000g\000\138\001-\001y\000:\001\207\0004\000g\000g\000\138\001-\001y\000:\000\149\0008\000\129\001e\0008\000\129\000\168\000\242\001\185\000\241\000\241\001g\0008\001'\001\189\000\022\001\189\000B\000h\0004\001\189\000\143\001C\000\218\000\143\000\213\0004\000\134\0008\001\189\000\180\001\189\000\224\001\189\000\238\000\016\000h\000\134\000\247\000\016\001\189\000\022\001\189\000h\0004\001\189\000\134\0008\001\189\000\180\001\189\000\224\001\189\001\253\000\139\000\247\000\016\000h\000\134\000\238\001\253\000\139\001\237\000\239\002M\000\247\001\249\002=\001\249\002M\001\247\001\251\001\253\002=\000\204\000\139\000\247\000\139\001\247\000\190\000B\000\138\000\139\000\247\000\139\001\251\000\204\000\139\000\247\000\139\001\251\001\251\0007\000j\000'\000H\001\215\002A\001'\000\206\000j\000'\000H\001\215\002A\000\149\0008\001\017\000\169\000-\000\143\001\247\000\226\001\247\000;\000\190\001\211\000\021\000\"\000j\000\202\001\205\0002\000:\000\218\000\213\000:\000}\000:\000\135\000:\000\137\000:\000\233\000:\000\247\001%\000\206\000j\000\167\000m\000\206\0004\001\207\0004\000\167\000m\000G\000\194\001\183\000\000\000u\000\194\001\181\000\000\000\165\001\247\000\194\000\000\000\163\001\211\000\194\000\000\000\159\000\194\000\161\000\000\000.\001\185\000\022\000\"\000\142\000\180\000\023\001%\001\217\000\194\000=\000?\0002\000E\0002\001\223\000\000\000\194\000\027\000\029\000?\0002\000\027\000E\0002\000\027\001\221\000\194\000\194")
    
    and rhs =
      ((16, "\001\183\001\181\000\165\000\163\000\161\000=\000\029\000\209\001\151\000\209\001\151\000\218\000\209\001\151\000\218\000\014\000\213\000\209\001\151\000\218\002[\000L\000J\000\248\002/\000\247\000\248\002/\000\248\002-\000\247\000\248\002-\000\248\002\015\000\247\000\248\002\015\000\248\000\016\001\031\000\247\000\248\000\016\001\031\000\248\000\016\001\015\000\247\000\248\000\016\001\015\000\248\0009\000\247\000\248\0009\000\143\000\026\000j\000\226\000\143\001\153\000h\0017\000\213\0004\000\186\002I\000\188\001\245\001\153\000\188\001\245\0029\000\188\001\245\000W\000W\000\206\002E\000\132\002E\000\149\0008\000\210\001\235\001\131\000\245\001\201\001\129\000\243\000\238\001\253\000\247\000\238\001\253\000\238\000\131\000\247\000\238\000\131\0003\000-\000.\002!\000-\000<\001\185\000.\002!\000\014\0003\000\225\000\134\000\129\0008\000\128\001e\0008\000~\000\129\001g\0008\001\203\000\250\000\138\000}\000:\000\138\000\202\001\205\000\213\000:\000\138\000\202\001\205\0002\000:\000\138\000\137\000:\000\138\000\135\000:\000\138\000\233\000:\002#\002I\000\188\0023\000\193\001\231\000\017\000j\0021\000\017\000j\000h\0004\0021\000\017\000j\000h\001U\000\213\0004\0021\000\017\000j\000h\000\206\0004\0021\000\017\000j\000h\000\206\001U\000\213\0004\0021\000\017\000j\000h\001;\000\213\0004\0021\000\017\000j\000h\001;\000\213\0004\000h\0004\0021\000\017\000j\000h\001;\000\213\0004\000h\001U\000\213\0004\0021\000\017\000j\000h\001;\000\213\0004\000h\000\206\0004\0021\000\017\000j\000h\001;\000\213\0004\000h\000\206\001U\000\213\0004\0021\000\017\000j\001s\000\226\0023\000\228\002-\001\141\000\247\000\228\002-\001\141\002\021\001\241\000h\0004\000\188\002)\001\241\000h\001U\000\213\0004\000\188\002)\001\241\000h\000\206\0004\000\188\002)\001\241\000h\000\206\001U\000\213\0004\000\188\002)\002\021\001\163\002C\002)\000\228\002!\001a\001\203\002)\001\145\0002\002'\000\233\000\146\000\171\002)\000\195\000\247\000\146\000\171\002)\000\195\000\012\000\021\000\247\000\012\000\021\001\239\001+\000\247\001\239\001+\000\214\002\003\000\247\000\214\002\003\000\144\000m\000\247\000\144\000m\001\179\000\247\001\179\000\247\002\011\001k\002C\002#\002\017\001\203\000j\001%\000\206\000j\000\246\000\159\000\246\001\247\002\029\002\029\0002\002\025\002\025\000\201\0011\000\201\000\146\002#\000\247\000\146\002#\000\012\000\019\000\247\000\012\000\019\000B\000\017\000j\000\226\000\147\000\247\000B\000\017\000j\000\226\000\147\000@\000\017\000j\000\226\000\147\000\247\000@\000\017\000j\000\226\000\147\000\214\002\003\000\247\000\214\002\003\001\179\000\247\001\179\000\247\002!\000\138\002'\000:\000h\002)\000\226\0023\0004\000h\002)\0004\001]\000\213\000\138\002\027\000:\000\138\000\206\002\027\000:\000\017\000j\001s\001\229\000\228\000\018\002\015\001\139\000\247\000\228\000\018\002\015\001\139\000j\001'\000\206\000j\000\142\000\230\000\178\000\"\001%\000\134\0008\000h\0004\000\180\000\022\001\247\000\190\001\247\001\247\000\190\001\247\000\225\000\139\000h\000\139\0004\000h\001\255\0004\001]\000\213\000\016\001\189\000\134\0008\001\189\000h\0004\001\189\000\224\001\189\000\180\001\189\000\022\001\189\000\247\000\016\001\189\000\247\000\134\0008\001\189\000\247\000h\0004\001\189\000\247\000\224\001\189\000\247\000\180\001\189\000\247\000\022\001\189\001\237\001\249\002=\001\249\002M\000\239\002M\001\245\001\245\000\246\000<\001\185\000!\000\247\000!\000\024\000\200\000\186\000\174\000@\000B\001\253\002=\001\201\001\199\000h\001u\0004\001u\000\190\002)\000\138\002'\000:\000\190\002#\002\017\000\190\001\211\0025\000\188\001\211\0025\000\194\000E\0002\000?\0002\000\194\000E\0002\000\027\000?\0002\000\027\000E\000\194\000?\000\194\000<\001\185\000\014\000L\000<\001\185\000L\000\014\000f\000<\001\185\000f\000\014\000\"\000\142\000\023\001%\000\180\000\022\000B\000h\0004\000h\001U\000\213\0004\000h\000\206\0004\000h\000\206\001U\000\213\0004\000\014\000]\000m\000\174\000\173\001\193\000\186\001\213\000\188\001\211\000\186\001\213\000\226\001\003\000\188\001\211\000\174\000\173\001/\001{\000\030\000\173\000g\000\138\001-\001y\000:\000\020\000\173\000g\000\138\001-\001y\000:\000\162\000\173\000\167\000m\000\162\000\173\000\167\000m\000\198\001\211\000\006\000\173\000\167\000m\000\176\000\173\000h\000\159\000\160\001\211\001\243\001\211\0004\000m\000h\000\224\0004\000h\001\211\000\218\001\211\0004\001\211\000\156\001\211\001\211\000\154\001\211\001\211\000\152\001\211\001\211\000\150\001\211\001\211\000&\001\211\001\211\000\148\001\211\001\211\000L\001\211\001\211\000J\001\211\001\211\000f\001\211\001\211\000d\001\211\001\211\000$\001\211\001\211\000x\001\211\001\211\000\168\001\211\001\211\000P\001\211\001\211\000\236\001\211\001\211\000\250\001\211\001\211\000\252\001\211\001\211\000\222\001\211\001\211\000H\001\211\001\211\000N\001\211\001\211\000v\001\211\001\211\000\168\000\168\001\211\001\211\000\166\001\211\000C\001\211\002Y\001\211\000\240\001\211\000m\000\206\001\165\000\190\001\211\000m\000\134\001\211\0008\000\190\001\211\000m\000\206\000\134\001\211\0008\000\190\001\211\000m\000\206\000\138\001[\000\213\000:\000\190\001\211\000j\000\190\001\211\000\244\000m\000\140\000m\001\211\000>\001\211\000\226\001\211\002C\001\211\001K\000\213\001Y\000\213\001\211\001\211\000;\000|\002E\000\149\0008\000\016\001\189\000\134\0008\001\189\000h\0004\001\189\000\224\001\189\000\180\001\189\000\022\001\189\000\016\000\190\002\007\000\134\0008\000\190\002\007\000h\0004\000\190\002\007\000\224\000\190\002\007\000\180\000\190\002\007\000\022\000\190\002\007\000j\000\226\001\211\000j\000h\0004\000\191\001\227\000h\001U\000\213\0004\000\191\001\227\000h\000\206\0004\000\191\001\227\000h\000\206\001U\000\213\0004\000\191\001\227\000h\0004\000\187\001\225\000h\001U\000\213\0004\000\187\001\225\000h\000\206\0004\000\187\001\225\000h\000\206\001U\000\213\0004\000\187\001\225\000h\0004\000h\001\019\0004\000h\001\019\000\218\0004\000h\001\019\000\218\001O\000\213\0004\000\199\000\191\000\166\000\168\000\202\000\016\000j\000G\000\194\000u\000\194\000z\002E\000\149\0008\000N\002E\000t\001}\000p\001\171\000&\001\171\000\168\001}\000n\001\171\001\187\000i\000n\000j\000\190\000>\000m\001\173\000>\000j\001\173\000j\000\190\000m\001\173\000j\001\173\000\150\000r\001\173\000x\001'\001\173\001'\001\173\000j\001\173\000\168\001}\000p\001\169\000&\001\169\000\168\001}\000n\001\169\001\187\000i\000n\000j\001%\000\206\000j\000k\000h\000\213\0004\000h\0015\000\213\0004\000h\000\206\0004\001\205\000\026\001\233\000\026\000\023\000>\000\026\000j\000\190\000\175\001\159\000\026\000j\000\190\000\175\000\014\000\014\001\205\000;\000\026\000j\001\155\000\026\000j\001\155\000\190\001\211\000\026\000j\001\155\000\190\000>\000\153\000\018\000j\000\246\000\153\000\191\000\026\000j\000\226\000\143\000\190\000\175\001\165\000\226\000\159\001\165\001\165\000\246\000\025\000l\000\197\000\141\001\147\000\247\000l\000\197\000\141\001\147\000]\000;\000\190\001\211\000]\001\195\000]\000\226\000\237\000\206\001\247\000\190\001\211\000]\000\226\000\018\000\251\000\206\001\247\000\190\001\211\000\159\000\190\001\211\000[\000\226\001\247\000\190\001\211\001\149\001\137\002W\001\143\002U\001\141\002S\001\139\000\248\001\147\001\137\000\247\000\248\001\147\001\137\002Q\001\135\002O\001\133\000\238\001\235\001\131\000\238\000\247\001\235\001\131\000\247\000\238\001\235\001\131\000\247\000\238\000\247\001\235\001\131\000\238\001\201\001\129\000\238\000\247\001\201\001\129\000\247\000\238\001\201\001\129\000\247\000\238\000\247\001\201\001\129\002;\001\127\000i\001}\001{\001/\001y\001-\001w\000\218\000\209\001\165\000\226\001\211\001w\000\218\000\209\001\165\000\023\000\177\000h\001;\000\213\0004\001\191\000\247\000\227\000h\002\019\0004\000h\000%\0004\000\168\000\241\000\129\001G\000\213\000-\000\015\001_\000\248\000\015\001\247\001]\000\218\001\247\001\211\001[\000\218\001\211\001\205\001Y\000\218\001\205\001\197\001W\000\218\001\197\001\157\001U\000\218\001\157\001'\001S\000\218\001'\001\029\001Q\000\218\001\029\001\019\001O\000\218\001\019\000\229\001M\000\218\000\229\000\209\001\205\001K\000\218\000\209\001\205\000\209\001\165\000\226\001\211\000\209\001\165\001I\000\218\000\209\001\165\000\226\001\211\001I\000\218\000\209\001\165\000\209\000\159\001G\000\218\000\209\000\159\000\153\001E\000\218\000\153\000\143\001C\000\218\000\143\000\133\001A\000\218\000\133\000Q\001?\000\218\000Q\000K\001=\000\218\000K\000/\001;\000\218\000/\000)\0019\000\218\000)\000\211\002K\0017\000\218\000\211\002K\000\211\001\161\0015\000\218\000\211\001\161\002%\0013\0002\002%\002\023\0011\0002\002\023\000\238\000\159\000\179\000\188\001\211\000\238\000\159\000\179\000\188\000}\000\171\000\n\000j\000\226\000\147\000\171\000j\001\195\000\171\000j\000\185\001\227\000\171\000j\000\226\000\018\000\251\000\206\001\247\001\227\000\016\000h\001S\0004\001'\000\206\000\016\000h\001S\0004\001)\000h\001S\0004\000\016\001'\000\206\000\016\001)\000\016\001%\000\206\000\016\001\021\000h\001!\0004\000\213\001Q\000\213\001q\001\023\001q\000\226\001\017\001\023\001\025\001\025\000\226\001\017\000\012\001\211\000\012\001\211\000\226\000\205\000\169\000\012\001\211\000\226\000\205\000\169\000\220\000\205\000\169\000\012\001\211\000\220\000\205\000\169\001q\001\015\001%\001\021\000h\001\029\0004\000h\0004\001\203\001\241\001\191\000\183\000\188\001\025\001\025\001#\002C\001\025\000\190\001\025\001\021\000\138\000G\000:\000h\0004\000\016\000\226\001\017\000\014\000\226\001\017\001\017\001\017\000\004\001_\000c\000h\000`\000\018\000T\001\025\0004\002C\001\017\001\191\000\188\001\017\000\226\001\017\001\011\000\190\001\017\001\011\000\138\000u\000:\001\185\001'\000\206\001\185\000^\000\n\001\007\000^\000\017\001\001\002C\001\003\000\255\0029\000-\000h\001Y\000\213\0004\000h\0004\000j\000j\000\251\000\"\000\"\000\249\002C\002C\000\247\000\238\001\235\000\238\000\247\001\235\000\247\000\238\001\235\000\247\000\238\000\247\001\235\000\238\001\235\000\245\000\238\000\247\001\235\000\245\000\247\000\238\001\235\000\245\000\247\000\238\000\247\001\235\000\245\000\238\001\201\000\238\000\247\001\201\000\247\000\238\001\201\000\247\000\238\000\247\001\201\000\238\001\201\000\243\000\238\000\247\001\201\000\243\000\247\000\238\001\201\000\243\000\247\000\238\000\247\001\201\000\243\000\242\001\185\000\242\001\185\000\241\000\214\002\005\000\214\002\005\000\239\000<\001\185\000<\001\185\000\237\000X\001o\002\031\001o\002\031\0002\000\231\000\231\000\201\0013\000\201\000j\000\247\000j\000j\000\226\000\147\000\247\000j\000\226\000\147\001M\000\213\000\138\000:\000\138\000\206\000I\000:\000\138\000\204\000I\000:\000\138\000\206\001m\000:\000\138\000\204\001m\000:\000R\000\171\001%\000\247\000R\000\171\001%\000D\000F\000\240\000\156\000\154\000\152\000\150\000&\000\148\000L\000J\000f\000d\000$\000x\000\168\000P\000\236\000\250\000\252\000\222\000H\000N\000v\000\168\000\168\000\166\000`\000l\000`\000\219\0006\000\016\000\219\0006\000j\000\219\000\016\000\219\000j\000\218\000\206\000\202\000l\000`\000T\0002\002\001\001\177\000\246\000j\000\226\0023\000\226\001\247\000\226\001\211\000\226\001\003\000\226\000\147\000\226\000c\000\220\001\247\000\b\001\211\000;\000>\001\177\000\240\001\017\0025\000h\000\206\0004\000h\001\207\0004\001\247\000\194\001\211\000\194\000\159\000\194\000\151\000\159\000\238\000\159\001G\000\213\000_\000h\001E\000\213\0004\000\159\000\159\000\226\001\247\000`\000\016\000\226\000\205\000\169\000a\000\151\000\246\000\025\002\007\000\155\000\242\001\185\000a\000\151\000\224\000\151\000h\000\224\0004\000h\000\151\000\218\000\151\0004\000\184\000\151\000\140\000a\002C\000\151\000G\000\226\000u\000\226\001\247\000>\000\159\000>\000\159\000\b\001\211\000]\000\188\001\211\001\247\000\237\000\206\001\247\000\249\000`\000\169\001\247\0006\000\138\001A\000\213\000:\000\202\001\205\000\218\000\209\001\165\000\226\001\211\001w\000\213\000\202\001\205\000\218\000\209\001\165\001w\000\213\000\202\001\205\0002\001I\000\213\000\202\001\205\000\218\000\209\001\165\000\226\001\211\001w\0002\000\202\001\205\000\218\000\209\001\165\001w\0002\001\165\000\226\001\211\000\213\001\165\000\226\001\211\0002\001\165\000\226\001\211\000\218\000\209\001\165\000\226\001\211\001w\000\213\001\165\000\226\001\211\000\218\000\209\001\165\001w\000\213\001\165\000\218\000\209\001\165\000\226\001\211\001w\000\213\001\165\000\218\000\209\001\165\001w\000\213\001\165\000\226\001\211\000\218\000\209\001\165\000\226\001\211\001w\0002\001\165\000\226\001\211\000\218\000\209\001\165\001w\0002\001\165\000\218\000\209\001\165\000\226\001\211\001w\0002\001\165\000\218\000\209\001\165\001w\0002\000\202\001\205\000\218\000M\000\"\000\226\001\211\000\213\000O\000M\001\007\000j\000\247\001\007\000j\001\007\000j\000\226\000\147\000\247\001\007\000j\000\226\000\147\000A\001\003\000\131\001\127\002;\001\127\000\255\000\255\000\250\000\127\000{\001\177\000{\001\211\0002\000}\001\177\001\211\0002\000}\001\211\000\201\000\215\001\031\0002\000}\000\207\000R\000\171\001%\0002\000}\000\247\000\207\000R\000\171\001%\0002\000}\000U\0002\000}\001\145\0002\000}\001\145\000\201\000\184\001\201\000\247\000\184\001\201\000\018\000\235\000j\000'\000H\001\215\002?\000\018\000\235\001'\000\206\000j\000'\000H\001\215\002?\000\247\000\018\000\235\000j\000'\000H\001\215\002?\000\247\000\018\000\235\001'\000\206\000j\000'\000H\001\215\002?\000q\000q\0002\000u\000l\000\025\000\226\001\247\000\247\000l\000\025\000\226\001\247\000\182\000\025\000\226\001\247\000\190\000\145\000\247\000\182\000\025\000\226\001\247\000\190\000\145\000\182\000\025\000\226\001\247\0002\000\247\000\182\000\025\000\226\001\247\0002\0005\000w\000y\000\215\001\027\000\247\000\215\001\027\000\215\000\190\001%\000\247\000\215\000\190\001%\000\217\001\015\001\133\000\247\000\217\001\015\001\133\000`\000\018\001\185\000\247\000`\000\018\001\185\000`\000\018\001\185\001\r\000\247\000`\000\018\001\185\001\r\000\223\000\158\001\017\000\247\000\158\001\017\002+\002\r\001\179\000\247\001\179\000s\000\247\002\t\000f\000\142\000f\000\178\000L\000\142\000L\000\178\000\023\002\t\001\175\000k\000\130\000\213\000\234\000\130\001K\000\213\000\234\002\007\000\242\001\185\000h\001\207\0004\000m\000F\001%\000\206\000h\001\207\0004\000m\000\206\001\165\001%\000\206\000\138\000:\000m\000\134\001\211\0008\000m\000\206\000\134\001\211\0008\000m\000\206\000\138\001[\000\213\000:\001%\000\206\000\138\000\137\000:\001%\000\206\000\138\000\135\000:\001%\000\206\000\130\001\207\000\234\001%\000\206\000~\001\167\0008\001%\000\206\000\134\0008\001%\000\206\000\134\001\209\0008\000D\000m\000Z\002!\001%\000\206\000\136\001W\000\213\000\164\000m\000.\000j\000m\000*\000i\000m\000,\000m\000m\000b\000i\001%\000\206\000h\000`\001\025\000\226\000\169\0004\001\203\000m\001\163\000\134\001\209\0008\000e\0025\000~\001\167\000\218\001\209\0008\000~\001\167\0008\000~\001\167\000\218\0008\000\136\001W\000\213\000\164\000\136\000\164\000h\000`\001\025\0004\000h\000`\001\025\000\226\000\169\0004\000\023\002\t\001\175\000k\000\130\000\213\000\234\000\130\001K\000\213\000\234\002\007\000\242\001\185\000h\001\207\0004\000i\000F\001%\000\206\000h\001\207\0004\000i\000\206\001\165\001%\000\206\000\138\000:\000i\000\134\001\211\0008\000i\000\206\000\134\001\211\0008\000i\000\206\000\138\001[\000\213\000:\001%\000\206\000\138\000\137\000:\001%\000\206\000\138\000\135\000:\001%\000\206\000\130\001\207\000\234\001%\000\206\000~\001\167\0008\001%\000\206\000\134\0008\001%\000\206\000\134\001\209\0008\000D\000i\000Z\002!\001%\000\206\000\136\001W\000\213\000\164\000i\000.\000j\000i\000*\000i\000i\000,\000m\000i\000b\000i\001%\000\206\000h\000`\001\025\000\226\000\169\0004\001\203\000e\000\023\002\t\001\175\000k\000\130\000\213\000\234\000\130\001K\000\213\000\234\002\007\000\242\001\185\000h\001\207\0004\000g\000F\001%\000\206\000h\001\207\0004\000g\000\206\001\165\001%\000\206\000\138\000:\000g\000\134\001\211\0008\000g\000\206\000\134\001\211\0008\000g\000\206\000\138\001[\000\213\000:\001%\000\206\000\138\000\137\000:\001%\000\206\000\138\000\135\000:\001%\000\206\000\130\001\207\000\234\001%\000\206\000~\001\167\0008\001%\000\206\000\134\0008\001%\000\206\000\134\001\209\0008\000D\000g\000Z\002!\001%\000\206\000\136\001W\000\213\000\164\000g\000.\000j\000g\000*\000i\000g\000,\000m\000g\000b\000i\001%\000\206\000h\000`\001\025\000\226\000\169\0004\001\203\002\007\000\253\002\007\000k\000\242\001\185\000\253\000\242\001\185\000k\000h\001\019\0004\001\011\001\t\001\203\000]\000[\002\007\000\138\002[\000:\000\134\000\157\0008\000\130\001c\000\234\000\025\000\014\000o\000o\000\204\000o\002\007\000\242\001\185\000.\0003\000h\001E\000\213\0004\000h\000`\000\016\0004\000Y\001\203\000\138\002[\000:\000\134\000\157\0008\000\130\001c\000\234\001%\000\206\000\138\002[\000:\001%\000\206\000\134\000\157\0008\001%\000\206\000\130\001c\000\234\001%\000\206\000h\000\159\0004\001%\000\206\000\134\0008\001%\000\206\000h\0004\000j\000\016\000\248\000\246\000\244\000\232\000\228\000\214\000\212\000\208\000\200\000\198\000\196\000\184\000\182\000\180\000\176\000\174\000\172\000\170\000\162\000\160\000\158\000\146\000\144\000\140\000l\000\030\000`\000^\000Z\000X\000V\000T\000R\000P\000B\0006\000(\000 \000\028\000\024\000\022\000\020\000\018\000\012\000\n\000\b\000\006\000\004\000\184\001\235\000\247\000\184\001\235\000\018\000\235\000j\000'\000H\001\215\002A\000\018\000\235\001'\000\206\000j\000'\000H\001\215\002A\000\247\000\018\000\235\000j\000'\000H\001\215\002A\000\247\000\018\000\235\001'\000\206\000j\000'\000H\001\215\002A\000\"\000\189\000\"\000\218\000\"\000\226\001\211\000\218\001?\000\213\000\"\000\226\000\147\000\247\000\"\000\226\000\147\001=\000\213\000E\000E\0002\000G\000\031\000\247\000\031\001\177\000E\000\247\001\177\000E\000\182\000\025\000\226\001\247\000\190\000\145\000\247\000\182\000\025\000\226\001\247\000\190\000\145\000\182\000\025\000\226\001\247\0002\000\247\000\182\000\025\000\226\001\247\0002\0005\000S\000U\000\215\001\031\000\247\000\215\001\031\000\217\001\031\001\135\000\247\000\217\001\031\001\135\000`\000\018\000\203\001\185\000\247\000`\000\018\000\203\001\185\000`\000\018\000\203\001\185\001\r\000\247\000`\000\018\000\203\001\185\001\r\000\223\000\228\002/\001\143\000\247\000\228\002/\001\143\002\r\000\158\001\025\000\247\000\158\001\025\001\179\000\247\001\179\001\145\000\247\000f\000d\000\242\001\185\0027\000\127\000\247\000\242\001\185\0027\000\127\000\242\001\185\000\247\000\242\001\185\000.\001\185\001\217\001\223\000\226\001\247\000\181\000\220\001\247\000\226\000`\000\169\000\016\000'\0007\000j\000'\0007\000\190\001\251\000\190\000B\001\251\000\190\001\247\000\190\001\251\000\190\001\247\000\190\000B\001\251\0001\002M\0001\000\239\002M\000\018\000\235\0009\000\247\000\018\000\235\0009\000j\001'\000\206\000j\000\190\001\247\000\190\000B\001\247\000\190\000\139\000\190\000\247\000\139\000\190\000B\000\139\000\190\000B\000\247\000\139\000\190\000\204\000\190\001\247\000\190\000\204\000\190\001\247\000\190\000\139\000\190\001\247\000\190\000\247\000\139\000\190\001\247\000\190\000B\000\139\000\190\001\247\000\190\000B\000\247\000\139\000#\000+\000h\001C\000\213\0004\000<\001\185\001\219\001i\0019\000\213\000L\000f\001\001\002G\000m\000\174\000\173\001\193\000\186\001\213\000\188\001\211\000\186\001\213\000\226\001\003\000\188\001\211\000\174\000\173\001/\001{\000\030\000\173\000g\000\138\001-\001y\000:\000\020\000\173\000g\000\138\001-\001y\000:\000\162\000\173\000\167\000m\000\162\000\173\000\167\000m\000\198\001\211\000\006\000\173\000\167\000m\000\176\000\173\000h\000\159\000\160\001\211\001\243\001\211\0004\000m\000h\000\224\0004\000h\001\211\000\218\001\211\0004\000\031\000\156\001\211\000\031\000\154\001\211\000\031\000\152\001\211\000\031\000\150\001\211\000\031\000&\001\211\000\031\000\148\001\211\000\031\000L\001\211\000\031\000J\001\211\000\031\000f\001\211\000\031\000d\001\211\000\031\000$\001\211\000\031\000x\001\211\000\031\000\168\001\211\000\031\000P\001\211\000\031\000\236\001\211\000\031\000\250\001\211\000\031\000\252\001\211\000\031\000\222\001\211\000\031\000H\001\211\000\031\000N\001\211\000\031\000v\001\211\000\031\000\168\000\168\001\211\000\031\000\166\001\211\000C\001\211\002Y\001\211\000\240\001\211\000m\000\206\001\165\000\190\001\211\000m\000\134\001\211\0008\000\190\001\211\000m\000\206\000\134\001\211\0008\000\190\001\211\000m\000\206\000\138\001[\000\213\000:\000\190\001\211\000j\000\190\001\211\000\244\000m\000\140\000m\000\031\000>\001\211\000\226\001\211\000\027\001\221\000j\000h\000\221\0004\000\025\001%\000\206\000\025\000\171\000^\000\n\000j\000\226\001\247\000\171\000^\000\n\000j\000;\000\190\001\211\000\n\001\007\000j\000\226\001\247\000\n\001\007\000j\000;\000\190\001\211\000\171\001\007\000j\000\190\001\211\000\171\001\007\000j\000;\000\190\001\211\001\005\000j\000\226\001\247\000\n\000\018\001\165\000'\000\190\001\215\001\247\000\018\001\165\000'\000\190\001\215\001\247\000\239\000\018\001\165\000'\000\222\001\247\000`\001%\000\190\001'\000`\000\016\000\222\001'"), (16, "\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\t\000\012\000\017\000\021\000\022\000\023\000\025\000\028\000\030\000!\000#\000&\000)\000-\0000\0004\0004\0006\0009\000:\000>\000?\000C\000G\000J\000M\000N\000Q\000U\000V\000X\000Y\000[\000\\\000^\000a\000c\000f\000h\000k\000m\000o\000p\000q\000r\000u\000x\000|\000}\000}\000~\000\129\000\134\000\139\000\142\000\145\000\148\000\149\000\152\000\154\000\157\000\162\000\169\000\175\000\183\000\190\000\199\000\210\000\220\000\232\000\237\000\240\000\244\000\245\000\250\001\001\001\007\001\015\001\017\001\019\001\022\001\023\001\024\001\027\001\028\001 \001%\001'\001*\001,\001/\0011\0014\0016\0019\001:\001<\001=\001?\001A\001B\001C\001D\001G\001I\001K\001L\001O\001P\001Q\001S\001U\001X\001Z\001]\001b\001h\001m\001s\001u\001x\001y\001{\001|\001}\001\128\001\133\001\136\001\138\001\141\001\145\001\149\001\153\001\158\001\159\001\162\001\163\001\164\001\165\001\166\001\167\001\169\001\171\001\172\001\173\001\176\001\179\001\180\001\181\001\184\001\187\001\189\001\191\001\194\001\197\001\199\001\201\001\203\001\206\001\210\001\214\001\217\001\220\001\223\001\225\001\227\001\228\001\230\001\231\001\235\001\236\001\238\001\239\001\240\001\241\001\242\001\243\001\244\001\245\001\246\001\247\001\248\001\251\001\252\001\254\002\001\002\003\002\004\002\006\002\007\002\t\002\n\002\011\002\r\002\015\002\016\002\019\002\022\002\024\002\026\002\028\002\029\002 \002\"\002%\002'\002'\002(\002)\002*\002+\002,\002-\002-\002.\0020\0024\0027\002<\002=\002>\002?\002B\002F\002L\002P\002W\002^\002b\002h\002l\002v\002~\002\129\002\132\002\135\002\138\002\141\002\144\002\147\002\150\002\153\002\156\002\159\002\162\002\165\002\168\002\171\002\174\002\177\002\180\002\183\002\186\002\189\002\193\002\196\002\198\002\200\002\202\002\207\002\213\002\220\002\228\002\231\002\233\002\235\002\240\002\242\002\244\002\246\002\247\002\249\002\253\002\255\003\002\003\005\003\007\003\t\003\011\003\014\003\018\003\022\003\025\003\028\003\031\003\"\003#\003'\003-\0032\0039\003=\003C\003H\003O\003Q\003T\003X\003^\003`\003a\003c\003d\003e\003g\003i\003m\003o\003r\003t\003x\003|\003|\003\129\003\132\003\136\003\138\003\139\003\141\003\144\003\146\003\148\003\151\003\153\003\157\003\161\003\162\003\165\003\166\003\169\003\173\003\176\003\177\003\179\003\182\003\187\003\192\003\193\003\194\003\195\003\198\003\203\003\208\003\209\003\211\003\213\003\214\003\220\003\223\003\224\003\227\003\231\003\236\003\240\003\242\003\249\004\001\004\004\004\t\004\011\004\011\004\r\004\r\004\015\004\015\004\017\004\017\004\020\004\024\004\024\004\026\004\026\004\028\004\028\004\031\004#\004'\004,\004,\004/\0043\0047\004<\004<\004>\004>\004@\004@\004B\004B\004D\004D\004J\004N\004P\004P\004T\004T\004U\004U\004V\004V\004W\004W\004Z\004Z\004]\004]\004_\004_\004`\004`\004b\004b\004c\004d\004g\004h\004k\004l\004o\004p\004s\004t\004w\004x\004{\004|\004\127\004\128\004\131\004\132\004\135\004\136\004\139\004\141\004\145\004\149\004\151\004\157\004\161\004\163\004\167\004\168\004\171\004\172\004\175\004\176\004\179\004\180\004\183\004\184\004\187\004\188\004\191\004\192\004\195\004\197\004\201\004\203\004\207\004\208\004\211\004\212\004\215\004\220\004\225\004\230\004\233\004\237\004\245\004\249\004\255\005\003\005\004\005\007\005\b\005\t\005\012\005\r\005\016\005\017\005\019\005\021\005\025\005\026\005\029\005\031\005$\005,\0051\0053\0054\0055\0058\005:\005;\005@\005B\005D\005F\005G\005J\005L\005O\005R\005S\005V\005W\005]\005_\005b\005d\005e\005g\005h\005k\005l\005o\005o\005p\005p\005r\005t\005u\005w\005x\005y\005z\005~\005\128\005\129\005\131\005\132\005\134\005\135\005\137\005\139\005\142\005\145\005\149\005\152\005\156\005\160\005\165\005\167\005\170\005\173\005\177\005\180\005\184\005\188\005\193\005\195\005\198\005\200\005\203\005\205\005\208\005\208\005\209\005\211\005\215\005\216\005\217\005\219\005\220\005\222\005\225\005\229\005\231\005\233\005\237\005\241\005\245\005\249\005\252\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\b\006\t\006\n\006\011\006\012\006\r\006\014\006\015\006\016\006\017\006\018\006\019\006\020\006\021\006\022\006\023\006\024\006\026\006\027\006\028\006\030\006!\006$\006&\006(\006(\006)\006)\006*\006*\006+\006+\006,\006,\006-\006-\006.\006.\006/\006/\0060\0060\0061\0061\0063\0063\0065\0065\0067\0067\0069\0069\006;\006;\006=\006=\006?\006?\006A\006A\006C\006C\006D\006D\006E\006E\006F\006F\006G\006H\006I\006L\006O\006Q\006S\006U\006V\006Y\006[\006\\\006`\006a\006d\006i\006j\006m\006o\006r\006u\006}\006\127\006\129\006\131\006\132\006\134\006\136\006\138\006\142\006\145\006\146\006\149\006\150\006\152\006\153\006\153\006\154\006\158\006\167\006\174\006\179\006\188\006\195\006\199\006\203\006\213\006\221\006\229\006\235\006\245\006\253\007\005\007\011\007\015\007\019\007\021\007\023\007\026\007\030\007#\007$\007%\007'\007)\007*\007-\007.\0070\0073\0077\0079\007=\007C\007J\007M\007P\007R\007T\007W\007^\007g\007o\007y\007y\007z\007}\007\129\007\134\007\140\007\147\007\152\007\158\007\159\007\160\007\161\007\163\007\166\007\169\007\173\007\176\007\180\007\183\007\187\007\191\007\196\007\197\007\199\007\202\007\203\007\204\007\205\007\207\007\208\007\209\007\210\007\212\007\214\007\216\007\218\007\219\007\220\007\221\007\222\007\225\007\229\007\230\007\232\007\235\007\237\007\242\007\245\007\249\007\253\b\002\b\b\b\r\b\018\b\023\b\028\b \b%\b'\b)\b/\b2\b5\b8\b;\bC\bD\bF\bI\bJ\bK\bP\bS\bW\b[\b]\ba\bg\bh\bi\bj\bk\bn\br\bs\bu\bx\bz\b\127\b\130\b\134\b\138\b\143\b\149\b\154\b\159\b\164\b\169\b\173\b\178\b\180\b\182\b\188\b\191\b\194\b\197\b\200\b\208\b\209\b\210\b\211\b\212\b\213\b\214\b\217\b\221\b\222\b\224\b\227\b\229\b\234\b\237\b\241\b\245\b\250\t\000\t\005\t\n\t\015\t\020\t\024\t\029\t\031\t!\t'\t*\t-\t0\t3\t;\t<\t>\t@\tC\tF\tI\tJ\tK\tL\tM\tN\tO\tR\tU\tX\tY\tZ\t[\t^\t_\ta\tc\tg\tk\tl\tm\tp\ts\tv\t{\t\128\t\133\t\138\t\142\t\146\t\147\t\148\t\149\t\150\t\151\t\152\t\153\t\154\t\155\t\156\t\157\t\158\t\159\t\160\t\161\t\162\t\163\t\164\t\165\t\166\t\167\t\168\t\169\t\170\t\171\t\172\t\173\t\174\t\175\t\176\t\177\t\178\t\179\t\180\t\181\t\182\t\183\t\184\t\185\t\186\t\187\t\188\t\189\t\190\t\191\t\192\t\193\t\194\t\195\t\196\t\198\t\201\t\208\t\217\t\225\t\235\t\237\t\239\t\243\t\245\t\248\t\252\t\254\t\254\t\255\n\002\n\003\n\005\n\007\n\n\n\016\n\023\n\028\n\"\n#\n$\n%\n'\n*\n-\n1\n5\n:\n?\nE\nF\nI\nM\nN\nP\nS\nT\nV\nW\nX\nY\nZ\n^\nc\ne\nh\nk\nl\no\nq\nt\nw\nz\n|\n\127\n\131\n\136\n\138\n\141\n\144\n\148\n\149\n\152\n\152\n\154\n\157\n\159\n\162\n\165\n\169\n\171\n\175\n\179\n\184\n\189\n\195\n\197\n\201\n\203\n\204\n\205\n\207\n\207\n\208\n\209\n\210\n\211\n\212\n\215\n\219\n\225\n\229\n\236\n\243\n\247\n\253\011\001\011\011\011\019\011\022\011\025\011\028\011\031\011\"\011%\011(\011+\011.\0111\0114\0117\011:\011=\011@\011C\011F\011I\011L\011O\011R\011V\011Y\011[\011]\011_\011d\011j\011q\011y\011|\011~\011\128\011\133\011\134\011\135\011\136\011\139\011\140\011\143\011\149\011\156\011\161\011\167\011\172\011\178\011\182\011\182\011\183\011\189\011\196\011\201\011\205\011\209"))
    
    and lr0_core =
      (16, "\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\b\000\t\000\n\000\011\000\012\000\r\000\014\000\015\000\016\000\017\000\018\000\019\000\020\000\021\000\022\000\023\000\024\000\025\000\026\000\027\000\028\000\029\000\030\000\031\000 \000!\000\"\000#\000$\000%\000&\000'\000(\000)\000*\000+\000,\000-\000.\000/\0000\0001\0002\0003\0004\0005\0006\0007\0008\0009\000:\000;\000<\000=\000>\000?\000@\000A\000B\000C\000D\000E\000F\000G\000H\000I\000J\000K\000L\000M\000N\000O\000P\000Q\000R\000S\000T\000U\000V\000W\000X\000Y\000Z\000[\000\\\000]\000^\000_\000`\000a\000b\000c\000d\000e\000f\000g\000h\000i\000j\000k\000l\000m\000n\000o\000p\000q\000r\000s\000t\000u\000v\000w\000x\000y\000z\000{\000|\000}\000~\000\127\000\128\000\129\000\130\000\131\000\132\000\133\000\134\000\135\000\136\000\137\000\138\000\139\000\140\000\141\000\142\000\143\000\144\000\145\000\146\000\147\000\148\000\149\000\150\000\151\000\152\000\153\000\154\000\155\000\156\000\157\000\158\000\159\000\160\000\161\000\162\000\163\000\164\000\165\000\166\000\167\000\168\000\169\000\170\000\171\000\172\000\173\000\174\000\175\000\176\000\177\000\178\000\179\000\180\000\181\000\182\000\183\000\184\000\185\000\186\000\187\000\188\000\189\000\190\000\191\000\192\000\193\000\194\000\195\000\196\000\197\000\198\000\199\000\200\000\201\000\202\000\203\000\204\000\205\000\206\000\207\000\208\000\209\000\210\000\211\000\212\000\213\000\214\000\215\000\216\000\217\000\218\000\219\000\220\000\221\000\222\000\223\000\224\000\225\000\226\000\227\000\228\000\229\000\230\000\231\000\232\000\233\000\234\000\235\000\236\000\237\000\238\000\239\000\240\000\241\000\242\003u\003v\003w\003x\003y\003\"\002^\002_\002`\002a\002b\002c\002d\002e\002f\002g\002h\002i\002j\002k\0030\0031\0032\0033\0034\0035\000\243\000\244\003\203\003\204\003\205\003j\003k\003\206\000\245\000\246\000\251\000\252\000\253\002\255\003\000\003\001\003\002\003\003\003\004\003\005\002C\002D\002E\002F\002G\002B\002H\002I\002J\002K\002L\002M\002N\002O\002P\002Q\002R\002S\002T\002U\002V\002W\002X\003\006\003\007\003\b\001\157\001\158\001\159\001\160\001\161\001\162\001\163\001\164\001\165\001\166\001\167\001\r\001\014\001\015\001\016\001\017\001\018\001\019\001\020\001\021\001\022\001\023\001\024\001\025\001\026\001\027\001\028\001\029\001\030\001\031\001 \001!\001\"\001#\001$\001%\001&\001'\001(\001)\001*\001+\001,\001-\001.\001/\0010\0011\0012\0013\0014\0015\0016\0017\0018\0019\001:\001;\001<\001=\001>\001?\001@\001A\001B\001C\001D\001E\001F\001G\001H\001I\001J\001K\001L\001M\001N\001O\001P\001Q\001R\001S\001T\001U\001V\001W\001X\001Y\001Z\001[\001\\\001]\001^\001_\001`\001a\001b\001c\001d\001e\001f\001g\001h\001i\001j\001k\001l\001m\001n\001o\001p\001q\001r\001s\001t\001u\001v\001w\001x\001y\001z\001{\001|\001}\001~\001\127\001\128\001\129\001\130\001\131\001\132\001\133\001\134\001\135\001\136\001\137\001\138\001\139\001\140\001\141\001\142\001\143\001\144\001\168\001\169\001\170\001\171\001\172\001\173\001\174\001\175\001\176\001\177\001\178\001\179\001\180\001\181\001\182\001\183\001\184\001\185\001\186\001\187\001\188\001\189\001\190\001\191\001\192\001\193\001\194\001\012\001\145\001\195\001\196\001\197\001\198\001\199\001\200\001\201\001\202\001\203\001\204\001\205\001\206\001\207\001\208\001\209\001\210\001\211\001\212\001\213\001\214\001\215\001\216\001\217\001\218\001\219\001\220\001\221\001\222\001\223\001\224\001\225\001\226\001\227\001\228\001\229\001\230\001\231\001\232\001\233\001\234\001\235\001\236\001\237\001\238\001\239\001\240\001\241\001\242\001\243\001\244\001\245\001\246\001\247\001\248\001\249\001\250\001\251\001\252\001\253\001\254\001\255\002\000\002\001\002\002\002\003\002\004\002\005\002\006\002\007\002\b\002\t\002\n\002\011\002\012\002\r\002\014\002\015\002\016\002\017\002\018\002\019\002\020\002\021\002\022\002\023\002\024\002\025\002\026\002\027\002\028\002\029\002\030\002\031\002 \002!\002\"\002#\002$\002%\002&\002'\002(\002)\002*\002+\002,\002-\002.\002/\0020\0021\0022\0023\0024\0025\0026\0027\0028\0029\002:\002;\002<\002=\002>\002?\002@\002A\002Y\002Z\002[\002\\\002]\007\137\001\007\001\147\001\148\001\149\001\150\001\151\002q\002r\002s\002t\002u\002v\002w\002x\001\154\001\155\001\156\b\001\003\n\002y\002z\002{\002|\002}\002~\002\127\002\128\002\129\002\130\002\131\002\132\002\133\002\134\002\135\002\136\002\137\002\138\002\139\002\140\002\141\002\142\002\143\002\144\002\145\002\146\002\147\002\148\002\149\002\150\002\151\002\152\002\153\002\154\002\155\002\156\002\157\002\158\002\159\002\160\002\161\002\162\002\165\002\166\002\167\001\152\001\153\002\168\002\169\002\170\002\171\002\172\002\173\002\174\002\175\002\176\002\177\002\178\002\179\002\180\002\181\002\182\002\183\002\184\002\185\002\186\002\187\002\188\002\189\002\190\002\191\002\192\002\193\002\194\002\195\002\163\002\164\002\196\002\197\002\198\002\199\002\200\002\201\002\202\002\203\002\204\002\205\002\206\002\207\002\208\002\209\002\210\002\211\002\212\002\213\002\214\002\215\002\216\002\217\002\218\002\219\002\220\002\221\002\222\002\223\002\224\002\225\002\226\002\227\002\228\002\229\002\230\007\138\007\139\001\004\001\005\001\006\001\b\001\t\001\n\001\011\001\146\b\002\b\003\b\004\b\005\b\006\002n\002o\002p\002\231\002\232\002\233\002\234\002\235\002\236\002\237\002\238\002\239\002\240\002\241\002\242\002\243\002\244\002\245\002\246\002\247\002\248\002\249\002\250\002\251\002\252\002\253\002\254\000\247\000\248\004x\003\027\003\028\000\249\000\250\003\029\003\030\003\031\003 \003!\003z\003{\003|\006\211\003~\003\127\003\128\003\129\003\130\003\131\003\132\003\133\003\134\003\135\003\136\003\137\003\138\003\139\003\140\003\141\003\142\003\143\003\144\003\145\003\146\003\147\003\148\003\149\003\150\003\151\003\152\003\153\003\154\003\155\003\156\003\157\003\158\003\159\003\160\003\161\003\162\003\163\003\164\003\165\003\166\003\167\003\168\003\169\003\170\003\171\003\172\003\173\003\174\003\175\003\176\003\177\003\178\006\212\006\213\006\214\003*\003+\003,\003\182\0037\0038\003\183\003i\003l\003m\003n\003o\003p\003\184\003\185\003\186\003\187\003:\003;\003R\003S\003<\003=\003>\003?\003@\003A\003F\003G\003T\003U\003B\003C\003D\003E\003H\003I\003J\003K\003L\003M\003N\003O\003V\003W\003X\003Y\003P\003Q\003Z\003[\003\\\003]\003^\003_\003`\003q\003c\003d\003e\003f\003g\003h\003a\003b\003r\003s\003\188\003\189\003\190\006\215\006\216\006\217\003\194\003\195\006\218\006\219\003\198\003\199\003\200\003\201\003\202\003\207\003\208\000\254\000\255\001\000\001\001\001\002\003\209\001\003\0039\003t\002l\002m\007\027\007\028\007\029\007\030\004\129\004\130\007\031\007 \004\133\007!\006\220\006\221\006\222\006\223\006\224\006\225\006\226\006\227\006\228\003\219\003\220\006\229\006\230\003\223\006\231\003\225\003\226\003\227\003\228\003\229\003\230\006\232\003\232\003\233\003\234\003\235\003\236\003\237\003\238\003\239\003\240\003\241\003\242\003\243\003\244\003\245\003\246\003\247\003\248\003\249\003\250\003\251\003\252\003\253\003\254\003\255\004\000\004\001\004\002\004\003\004\004\004\005\004\006\004\007\004\b\004\t\004\n\004\011\004\012\004\r\004\014\004\015\004\016\004\017\006\233\006\234\006\235\006\236\004\022\004\023\004\024\004\025\004\026\004\027\004\028\004\029\004\030\004\031\004 \004!\004\"\004#\004$\004%\004&\004'\004(\004)\004*\004+\004,\004-\004.\004/\0040\003\019\006\237\006\238\006\239\006\240\006\241\006\242\006\243\006\244\006\245\006\246\006\247\006\248\006\249\006\250\006\251\006\252\006\253\006\254\006\255\004\135\004\136\007\000\004y\004z\004{\004|\004}\004~\004\127\004\128\004\131\004\132\004\134\007\017\007\018\007\019\007\020\007\021\004\215\007\022\004\166\004\167\007\023\007\024\007\025\007\026\004\146\b\007\b\b\b\t\b\n\b\011\b\012\b\r\b\014\b\015\b\016\b\017\b\018\b\019\b\020\b\021\b\022\b\023\b\024\b\025\b\026\b\027\b\028\b\029\004\149\004\150\004\151\004\152\004\153\004\154\004\155\b\030\b\031\004\158\b \007\140\003#\003$\003%\003&\003'\003(\003)\003-\003.\003/\0047\0048\0049\004:\004;\004<\004=\004>\004?\004@\004A\004B\004C\004D\004E\004F\004G\004H\004I\004J\004K\004L\004M\004N\004O\004P\004Q\004R\004S\004T\004U\004V\004W\004X\004Y\004Z\004[\004\\\004]\004^\004_\004`\004a\004b\004c\004d\004e\004f\004g\004h\004i\004j\004k\004l\003\011\003\012\003\r\003\014\004m\004n\004o\004p\004q\004r\004s\004t\004u\004v\004w\004\137\004\138\004\139\004\140\004\141\004\142\004\143\004\144\004\145\004\147\004\148\004\156\004\157\004\159\004\160\004\161\004\162\004\163\004\164\004\165\004\168\004\169\004\170\004\171\004\172\004\173\004\174\004\175\004\176\004\177\004\178\004\179\004\180\004\181\004\182\004\183\004\184\004\185\004\186\004\187\004\188\004\189\004\190\004\191\004\192\004\193\004\194\004\195\004\196\004\197\004\198\004\199\004\200\004\201\004\202\004\203\004\204\004\205\004\206\004\207\004\208\004\209\004\210\004\211\004\212\004\213\004\214\007\141\007\142\007\143\007\144\007\145\007\146\007\147\007\148\007\149\007\150\007\151\007\152\007\153\004\217\004\218\004\219\004\220\004\221\004\222\004\223\004\224\004\225\004\226\004\227\004\228\004\229\004\230\004\231\004\232\004\233\004\234\004\235\004\236\004\237\004\238\004\239\004\240\004\241\004\242\004\243\004\244\004\245\004\246\004\247\004\248\004\249\004\250\004\251\004\252\004\253\004\254\004\255\005\000\005\001\005\002\005\003\005\004\005\005\005\006\005\007\005\b\005\t\005\n\005\011\005\012\005\r\005\014\005\015\005\016\005\017\005\018\005\019\005\020\005\021\005\022\005\023\005\024\005\025\005\026\005\027\005\028\005\029\005\030\005\031\005 \005!\005\"\005#\005$\005%\005&\005'\005(\005)\005*\005+\005,\005-\005.\005/\0050\0051\0052\0053\0054\0055\0056\0057\0058\0059\005:\005;\005<\005=\005>\005?\005@\005A\005B\005C\005D\005E\005F\005G\007\154\007\155\007\156\007\157\005M\007\158\005O\005P\005Q\007\159\007\160\007\161\007\162\007\163\007\164\007\165\007\166\007\167\007\168\007\169\007\170\007\171\007\172\007\173\007\174\007\175\007\176\007\177\007\178\007\179\007\180\007\181\007\182\007\183\006f\007\184\007\185\007\186\007\187\007\188\007\189\007\190\007\191\007\192\007\193\007\194\007\195\006s\006t\006u\006v\006w\006x\007\196\007\197\007\198\007\199\007\200\007\201\007\202\007\203\007\204\006\159\007\205\007\206\007\207\007\208\007\209\007\210\007\211\006\167\006\168\006\169\007\212\007\213\007\214\007\215\007\216\007\217\007\218\007\219\007\220\007\221\007\222\007\223\007\224\007\225\007\226\007\227\007\228\007\229\007\230\007\231\006\188\006\189\006\190\007\232\007\233\007\234\007\235\007\236\007\237\007\238\007\239\007\240\007\241\007\242\007\243\007\244\007\245\007\246\007\247\004\216\005H\005I\005J\005K\005L\005N\005R\005S\005T\005U\005V\005W\005X\005Y\005Z\005[\005\\\005]\005^\005_\005`\005a\005b\005c\005d\005e\005f\005g\005h\005i\005j\005k\005l\005m\005n\005o\005p\005q\005r\005s\005t\005u\005v\005w\005x\005y\005z\005{\005|\005}\005~\005\127\005\128\005\129\005\130\005\131\005\132\005\133\005\134\005\135\005\136\005\137\005\138\005\139\005\140\005\141\005\142\005\143\005\144\005\145\005\146\005\147\005\148\005\149\005\150\005\151\005\152\005\153\005\154\005\155\005\156\005\157\005\158\005\159\005\160\005\161\005\162\005\163\005\164\005\165\005\166\005\167\005\168\005\169\005\170\005\171\005\172\005\173\005\174\005\175\005\176\005\177\005\178\005\179\005\180\005\181\005\182\005\183\005\184\005\185\005\186\005\187\005\188\005\189\005\190\005\191\005\192\005\193\005\194\005\195\005\196\005\197\005\198\005\199\005\200\005\201\005\202\005\203\005\204\005\205\005\206\005\207\005\208\005\209\005\210\005\211\005\212\005\213\005\214\005\215\005\216\005\217\005\218\005\219\005\220\005\221\005\222\005\223\005\224\005\225\005\226\005\227\005\228\005\229\005\230\005\231\005\232\005\233\005\234\005\235\005\236\005\237\005\238\005\239\005\240\005\241\005\242\005\243\005\244\005\245\005\246\005\247\005\248\005\249\005\250\005\251\005\252\005\253\005\254\005\255\006\000\006\001\006\002\006\003\006\004\006\005\006\006\006\007\006\b\006\t\006\n\006\011\007\248\006\012\006\r\006\014\006\015\006\016\006\017\006\018\006\019\006\020\006\021\006\022\006\023\006\024\006\025\006\026\006\027\006\028\006\029\006\030\006\031\006 \006!\006\"\006#\006$\006%\006&\006'\006(\006)\006*\006+\006,\006-\006.\006/\0060\0061\0062\0063\0064\0065\0066\0067\0068\0069\006:\006;\006<\006=\006>\006?\006@\006A\006B\006C\006D\006E\006F\006G\006H\006I\006J\006K\006L\006M\006N\006O\006P\006Q\006R\006S\006T\006U\006V\006W\006X\006Y\006Z\006[\006\\\006]\006^\006_\006`\006a\006b\006c\006d\006e\006g\006h\006i\006j\006k\006l\006m\006n\006o\006p\006q\006r\006y\006z\006{\006|\006}\006~\006\127\006\128\006\129\006\130\006\131\006\132\006\133\006\134\006\135\006\136\006\137\006\138\006\139\006\140\006\141\006\142\006\143\006\144\006\145\006\146\006\147\006\148\006\149\006\150\006\151\006\152\006\153\006\154\006\155\006\156\006\157\006\158\006\160\006\161\006\162\006\163\006\164\006\165\006\166\006\170\006\171\006\172\006\173\006\174\006\175\006\176\006\177\006\178\006\179\006\180\006\181\006\182\006\183\006\184\006\185\006\186\006\187\006\191\006\192\006\193\006\194\006\195\006\196\006\197\006\198\006\199\006\200\006\201\006\202\006\203\006\204\006\205\006\206\006\207\006\208\007\249\007\250\007\251\007\252\007\253\007\254\007\255\b\000\003\t\003\015\003\016\003\017\003\018\003\020\003\021\003\022\003\023\003\024\003\025\003\026\007\001\007\002\007\003\007\004\007\005\007\006\007\007\007\b\007\t\007\n\007\011\007\012\007\r\007\014\007\015\007\016\0036\0041\0042\0043\0044\0045\0046\007\"\007#\007$\007%\007&\007'\007(\007)\007*\007+\007,\007-\007.\007/\0070\0071\0072\0073\0074\0075\0076\0077\0078\0079\007:\007;\007<\007=\007>\007?\007@\007A\007B\007C\007D\007E\007F\007G\007H\007I\007J\007K\007L\007M\007N\007O\007P\007Q\007R\007S\007T\007U\007V\007W\007X\007Y\007Z\007[\007\\\007]\007^\007_\007`\007a\007b\007c\007d\007e\007f\007g\007h\007i\007j\007k\007l\007m\007n\007o\007p\007q\007r\007s\007t\007u\007v\007w\007x\007y\007z\007{\007|\007}\007~\007\127\007\128\007\129\007\130\007\131\007\132\007\133\007\134\007\135\007\136\006\209\006\210\003}\003\179\003\180\003\181\003\191\003\192\003\193\003\196\003\197\003\210\003\211\003\212\003\213\003\214\003\215\003\216\003\217\003\218\003\221\003\222\003\224\003\231\004\018\004\019\004\020\004\021\b!\b\"\b#\b$\b%\b&\b'\b(\b)\b*\b+\b,\b-\b.\b/\b0\b1\b2\b3\b4\b5\b6\b7\b8\b9\b:\b;\b<\b=\b>\b?\b@\bA\bB\bC\bD\bE\bF\bG\bH\bI\bJ\bK\bL\bM\bN\bO\bP\bQ\bR\bS\bT\bU\bV\bW\bX\bY\bZ\b[\b\\\b]\b^\b_\b`\ba\bb\bc\bd\be\bf\bg\bh\bi\bj\bk\bl\bm\bn\bo\bp\bq\br\bs\bt\bu\bv\bw\bx\by\bz\b{\b|\b}\b~\b\127\b\128\b\129\b\130\b\131\b\132\b\133\b\134\b\135\b\136\b\137\b\138\b\139\b\140\b\141\b\142\b\143\b\144\b\145\b\146\b\147\b\148\b\149\b\150\b\151\b\152\b\153\b\154\b\155\b\156\b\157\b\158\b\159\b\160\b\161\b\162\b\163\b\164\b\165\b\166\b\167\b\168\b\169\b\170\b\171\b\172\b\173\b\174\b\175\b\176\b\177\b\178\b\179\b\180\b\181\b\182\b\183\b\184\b\185\b\186\b\187\b\188\b\189\b\190\b\191\b\192\b\193\b\194\b\195\b\196\b\197\b\198\b\199\b\200\b\201\b\202\b\203\b\204\b\205\b\206\b\207\b\208\b\209\b\210\b\211\b\212\b\213\b\214\b\215\b\216\b\217\b\218\b\219\b\220\b\221\b\222\b\223\b\224\b\225\b\226\b\227\b\228\b\229\b\230\b\231\b\232\b\233\b\234\b\235\b\236\b\237\b\238\b\239\b\240\b\241\b\242\b\243\b\244\b\245\b\246\b\247\b\248\b\249\b\250\b\251\b\252\b\253\b\254\b\255\t\000\t\001\t\002\t\003\t\004\t\005\t\006\t\007\t\b\t\t\t\n\t\011\t\012\t\r\t\014\t\015\t\016\t\017\t\018\t\019\t\020\t\021\t\022\t\023\t\024\t\025\t\026\t\027\t\028\t\029\t\030\t\031\t \t!\t\"\t#\t$\t%\t&\t'\t(\t)\t*\t+\t,\t-\t.\t/\t0\t1\t2\t3\t4\t5\t6\t7\t8\t9")
    
    and lr0_items =
      ((32, "\000\000\000\000\000\002\023\001\000\000\157\001\000\001\228\001\000\001\227\129\000\001\227\001\000\001\226\129\000\001\226\001\000\001\204\001\000\001\225\129\000\001\225\001\000\001\224\129\000\001\224\001\000\001\223\129\000\001\217\001\000\001\223\001\000\001\222\129\000\001\222\001\000\001\221\129\000\001\221\001\000\001\220\129\000\001\220\001\000\001\219\129\000\001\219\001\000\001\218\129\000\001\218\001\000\001\217\129\000\001\203\129\000\001\216\129\000\001\216\001\000\001\215\129\000\001\215\001\000\001\214\129\000\001\214\001\000\001\213\129\000\001\213\001\000\001\212\129\000\001\212\001\000\001\211\129\000\001\211\001\000\001\210\129\000\001\210\001\000\001\209\129\000\001\209\001\000\001\208\129\000\001\208\001\000\001\207\129\000\001\207\001\000\001\206\129\000\001\206\001\000\001\205\129\000\001\205\001\000\001\204\129\000\000\017\001\000\000\016\129\000\000\017\002\000\000\017\003\000\000\157\002\000\002\023\002\000\001L\001\000\001K\129\000\000v\129\000\000v\130\000\000\031\129\000\000\031\001\000\000\030\129\000\000\030\001\000\000\029\129\000\000\029\001\000\000/\001\000\002.\001\000\002-\129\000\001\007\129\000\002.\002\000\002-\130\000\002.\003\000\002-\131\000\001\255\129\000\000\024\129\000\000\240\129\000\000\239\001\000\000\239\002\000\000\241\001\000\000\239\129\000\000\217\001\000\000\241\002\000\000\239\130\000\000\241\003\000\000\239\131\000\000\239\132\000\000\241\129\000\000\240\001\000\000\240\002\000\000\240\003\000\000\217\129\000\000\240\004\000\000\217\130\000\000\241\001\000\000\239\129\000\000\217\131\000\000\239\133\000\000\217\129\000\000\239\134\000\000\239\003\000\000\217\129\000\000\239\004\000\000\177\001\000\000\177\002\000\000\177\003\000\000\024\001\000\000\023\001\000\000\242\001\000\0006\129\000\000\242\129\000\0007\001\000\000\242\130\000\0007\002\000\000\242\131\000\0007\003\000\000\024\002\000\000\023\002\000\002\r\129\000\000\023\129\000\000\154\129\000\000\155\001\000\000\023\130\000\001[\001\000\000\240\129\000\000\239\001\000\000\154\129\000\001\188\129\000\001\002\001\000\000\152\129\000\000\152\001\000\000\151\129\000\000\151\001\000\001\000\001\000\001\000\002\000\000\139\129\000\000\139\130\000\002\004\129\000\001\230\001\000\001\229\129\000\001\027\129\000\002\004\130\000\001\230\002\000\001\229\130\000\002\000\129\000\000\240\129\000\000\239\001\000\000\239\002\000\000\206\129\000\000h\001\000\000g\129\000\000g\130\000\000i\001\000\000h\129\000\000i\002\000\000h\130\000\000h\131\000\000j\001\000\000i\129\000\000j\002\000\000i\130\000\000i\131\000\000\206\130\000\000\206\131\000\000\231\001\000\002\015\129\000\000\231\129\000\0015\001\000\000\231\130\000\000\231\131\000\002\014\129\000\002\015\130\000\002\000\130\000\002\012\129\000\002\012\001\000\002\011\129\000\002\011\001\000\002\n\129\000\002\n\001\000\002\t\129\000\002\t\001\000\002\b\129\000\002\b\001\000\002\007\129\000\002\007\001\000\002\003\001\000\002\002\129\000\002\002\001\000\002\001\129\000\000\240\129\000\000\239\001\000\000O\129\000\000\239\002\000\000N\129\000\000N\001\000\002\005\129\000\000\027\001\000\000\026\129\000\000\017\129\000\000\017\130\000\002\021\129\000\002\021\130\000\000K\129\000\000I\001\000\001\182\001\000\001\182\129\000\001\182\130\000\002+\001\000\001\175\001\000\001\154\129\000\001\154\001\000\000J\129\000\000u\001\000\000u\002\000\002*\129\000\000\162\129\000\000\160\129\000\000\160\130\000\000\161\129\000\000\161\001\000\000\160\001\000\000\162\001\000\000\161\002\000\000\160\002\000\000\160\003\000\001\145\001\000\001\145\129\000\001\145\130\000\002+\001\000\001\154\129\000\001\154\001\000\001\138\001\000\000J\129\000\000t\129\000\000t\130\000\000\157\129\000\001\166\001\000\001\166\129\000\001\166\130\000\002+\001\000\001\159\001\000\001\154\129\000\001\154\001\000\000J\129\000\001+\001\000\001(\001\000\000J\130\000\001\145\001\000\001$\129\000\000\163\001\000\000\241\001\000\000\239\129\000\000\163\002\000\000\163\003\000\001\152\129\000\001\152\001\000\001\151\129\000\000\164\001\000\000\164\002\000\000\164\129\000\001\157\129\000\001\157\001\000\0017\001\000\0015\001\000\000\221\001\000\000\006\001\000\000\005\129\000\001\251\129\000\001\251\001\000\002+\001\000\001\154\129\000\001\154\001\000\001\138\001\000\000w\129\000\000J\129\000\001%\001\000\001/\001\000\001)\129\000\000\006\001\000\001)\001\000\000\005\129\000\001/\129\000\001,\129\000\001\154\130\000\001\154\002\000\000\251\001\000\000\250\129\000\000\248\129\000\000\248\001\000\000\247\129\000\000\247\001\000\002*\129\000\000\135\001\000\000\135\002\000\001\136\129\000\001\136\001\000\001\136\002\000\001\136\003\000\001\136\130\000\000\221\129\000\0015\001\000\000\221\130\000\000\221\131\000\001\150\001\000\000J\001\000\000J\002\000\000\221\129\000\000\137\129\000\000\137\130\000\001\150\002\000\001\150\003\000\001\153\129\000\001\153\001\000\000\146\129\000\000\146\001\000\000\146\002\000\000\136\001\000\000G\129\000\000H\129\000\000K\001\000\000H\001\000\001\188\001\000\001\187\129\000\001\137\129\000\001\188\002\000\001\187\130\000\001\137\130\000\001\154\129\000\001\154\001\000\001\012\129\000\001\012\001\000\001\012\130\000\000v\001\000\000u\129\000\000v\002\000\000u\130\000\000v\003\000\000u\131\000\001\134\001\000\002+\129\000\001\150\129\000\001\135\129\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000v\004\000\000u\132\000\001\147\002\000\000J\001\000\001\188\001\000\001\187\129\000\001\158\129\000\001\188\002\000\001\187\130\000\001\158\130\000\001\188\003\000\001\187\131\000\001\151\001\000\001\155\001\000\001\170\129\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\001\147\003\000\001\168\002\000\001\169\001\000\001\168\129\000\001\168\003\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\001\168\130\000\001\168\131\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\001\147\130\000\001\149\129\000\001\148\001\000\001\147\131\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\001\146\130\000\001\146\131\000\001\138\130\000\001\148\002\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\001\148\003\000\001\167\130\000\001\167\131\000\001\159\130\000\001\169\002\000\001\169\003\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\001\161\130\000\000t\001\000\000r\129\000\000t\002\000\000r\130\000\000\150\129\000\000\150\001\000\000\149\129\000\000\149\001\000\001\194\001\000\000\175\129\000\000\175\130\000\000\174\129\000\000\174\001\000\000\173\129\000\000\174\130\000\000\174\002\000\000\173\130\000\001@\001\000\000\026\001\000\001#\001\000\001\"\129\000\001\"\001\000\001!\129\000\001!\001\000\001!\002\000\001#\002\000\001\"\002\000\001\233\129\000\001\233\130\000\001\026\129\000\001\026\001\000\000\023\129\000\001\026\130\000\001\026\002\000\000\023\130\000\001\026\129\000\001\026\001\000\001\026\130\000\001\026\002\000\001\026\131\000\000\015\001\000\000\014\129\000\0016\001\000\000\232\001\000\000\177\001\000\000\r\129\000\000\177\002\000\000\r\130\000\000\177\003\000\000\r\131\000\000\018\001\000\000X\129\000\001\011\129\000\000\025\001\000\000\022\129\000\000\022\130\000\000\177\004\000\000\r\132\000\000\177\005\000\001H\001\000\000\177\006\000\000\025\129\000\000Y\001\000\000Y\002\000\001\n\129\000\002\017\129\000\002\006\001\000\000\241\001\000\000\239\129\000\002\006\002\000\000\241\002\000\000\239\130\000\002\006\003\000\000\015\129\000\000\015\130\000\000\027\129\000\000\015\131\000\001\011\001\000\000\016\001\000\000\016\002\000\000\016\003\000\001\015\129\000\001\015\001\000\001\015\130\000\002\018\001\000\000X\001\000\000W\129\000\000X\002\000\000X\003\000\000X\004\000\001[\129\000\000\r\001\000\000\015\129\000\000\014\001\000\000\232\002\000\000\232\129\000\000\014\130\000\0015\001\000\000\232\130\000\000\232\131\000\000\232\132\000\000\014\131\000\000\014\132\000\000\015\002\000\000\015\003\000\000\015\004\000\001\233\131\000\001Z\001\000\001Z\002\000\001Z\003\000\001Y\129\000\001\031\129\000\001\030\129\000\001\031\130\000\001\031\131\000\001\"\003\000\001\"\004\000\000\229\001\000\000\204\129\000\000\220\001\000\001\234\001\000\001 \001\000\001\031\001\000\001\234\002\000\001\234\003\000\001\234\004\000\001 \002\000\001\031\002\000\001 \003\000\001 \004\000\001\234\129\000\000\229\129\000\0015\001\000\000\229\130\000\000\229\131\000\001\234\001\000\001\234\130\000\001 \129\000\000\220\129\000\0015\001\000\000\220\130\000\000\220\131\000\001 \001\000\001\031\001\000\001 \130\000\001#\003\000\001#\004\000\001\"\130\000\001!\130\000\001!\131\000\001!\132\000\001\"\131\000\001\"\132\000\000\021\129\000\001\253\001\000\001\252\001\000\001\253\002\000\001\252\002\000\000\028\129\000\001\252\003\000\001\252\004\000\001k\001\000\001j\129\000\001k\002\000\001k\003\000\001h\129\000\000\021\130\000\001\253\129\000\001\252\129\000\001\253\130\000\001\252\130\000\001\253\131\000\001\252\131\000\001\252\132\000\001\252\133\000\001\t\129\000\001i\001\000\001\011\001\000\001\015\129\000\001\015\001\000\001\n\001\000\001\n\002\000\000\026\002\000\000\026\003\000\001i\129\000\000\022\001\000\000\022\002\000\000\022\003\000\001i\130\000\000\195\129\000\000\195\130\000\001\253\129\000\001\252\129\000\000\022\001\000\001j\001\000\001j\002\000\001@\002\000\000\176\001\000\001\196\129\000\001\196\130\000\001\133\129\000\001\133\001\000\001\133\002\000\001\133\130\000\001Q\129\000\001Q\130\000\001Q\131\000\0019\001\000\001Q\132\000\001\005\129\000\002\004\129\000\001r\129\000\001r\001\000\002\004\130\000\001r\130\000\001r\002\000\002\001\001\000\001r\003\000\000\206\129\000\002\001\002\000\001r\004\000\001r\005\000\000n\129\000\001r\006\000\000\140\001\000\000N\129\000\000N\001\000\001]\001\000\001#\001\000\001\"\129\000\001\"\001\000\001!\129\000\001!\001\000\000\227\001\000\001h\001\000\001g\001\000\001h\002\000\001g\002\000\001h\003\000\001g\003\000\001h\004\000\001h\005\000\001g\129\000\001f\129\000\001g\130\000\001f\130\000\001g\131\000\001g\132\000\001]\002\000\000\227\129\000\0015\001\000\000\227\130\000\000\227\131\000\001]\003\000\001]\004\000\000N\002\000\000N\003\000\000\212\129\000\000O\001\000\0015\001\000\000\212\130\000\000\212\131\000\000O\002\000\000\212\001\000\000N\130\000\000N\131\000\000M\129\000\000\153\001\000\000\153\002\000\000M\001\000\000\140\002\000\001<\001\000\000\142\129\000\000\142\130\000\000\141\001\000\000\141\002\000\000\141\003\000\000\140\129\000\000\140\130\000\000\140\131\000\000\142\001\000\000\142\002\000\000\141\129\000\000\141\130\000\001\022\129\000\001\022\001\000\001\020\129\000\001\020\001\000\001\022\130\000\001\020\130\000\001\022\131\000\001\020\131\000\001\022\132\000\001\023\129\000\001\023\001\000\001\021\129\000\001\021\001\000\001\023\130\000\001\023\002\000\001\021\130\000\001\021\002\000\001\023\131\000\001\021\131\000\001\023\132\000\001\021\132\000\001\023\133\000\001\023\003\000\001\021\003\000\001\023\004\000\001\022\002\000\001\020\002\000\001\022\003\000\000\020\001\000\000\019\129\000\000\193\129\000\000\193\001\000\000\193\130\000\000\193\131\000\000\194\129\000\000\194\001\000\000\194\130\000\000\194\002\000\000\194\131\000\000\194\132\000\000\194\133\000\000\194\003\000\000\194\004\000\000\193\132\000\000\193\002\000\000\193\003\000\000\019\130\000\001r\007\000\002\004\001\000\002\003\129\000\001\025\129\000\001\025\001\000\000L\001\000\000L\002\000\000L\003\000\001\025\130\000\001\025\002\000\001\025\131\000\000\012\001\000\002\000\129\000\002\015\001\000\002\001\001\000\002\001\002\000\002\001\003\000\000\012\002\000\002\004\002\000\000\012\129\000\000\012\130\000\000\012\131\000\002\004\003\000\002\003\130\000\002\004\131\000\001r\131\000\000\241\001\000\000\239\129\000\001r\132\000\000\241\002\000\000\239\130\000\001r\133\000\001r\134\000\001r\135\000\001r\136\000\001r\137\000\001#\129\000\001J\001\000\001#\130\000\001#\131\000\000\242\129\000\000\242\130\000\001~\001\000\001}\001\000\0011\129\000\001~\002\000\001}\002\000\001~\003\000\001}\003\000\001\004\129\000\001\001\129\000\001\189\129\000\001\189\001\000\001\004\130\000\001\001\001\000\001\001\002\000\0022\001\000\0021\129\000\0021\001\000\000\166\129\000\000\242\129\000\000\167\001\000\000\242\130\000\000\167\002\000\000\167\003\000\0022\002\000\0021\130\000\0021\002\000\0022\003\000\0021\131\000\0021\003\000\0021\132\000\0021\004\000\0021\133\000\0021\005\000\0021\134\000\0021\006\000\0021\135\000\0022\004\000\0022\005\000\0023\001\000\0022\129\000\0023\002\000\000\242\001\000\0023\003\000\0023\004\000\000\241\001\000\000\239\129\000\0022\130\000\000\242\129\000\0022\131\000\0022\132\000\000\241\001\000\000\239\129\000\000\211\001\000\001\001\003\000\000\211\129\000\000\211\130\000\000\211\131\000\001\006\129\000\000\241\001\000\000\239\129\000\001\006\130\000\000\241\002\000\000\239\130\000\000\241\003\000\000\239\131\000\000\154\129\000\001\006\131\000\001\006\001\000\001\003\001\000\001\003\002\000\001\003\003\000\001\001\001\000\001\190\001\000\001\002\129\000\001\002\130\000\001\001\001\000\001\005\001\000\001~\004\000\001u\129\000\0012\001\000\0012\002\000\002+\001\000\001$\129\000\001)\129\000\001)\001\000\001*\129\000\001*\001\000\0010\001\000\001+\129\000\001(\129\000\001'\129\000\001'\001\000\001&\129\000\001&\001\000\0011\001\000\0010\129\000\001,\001\000\0010\130\000\001.\129\000\001-\001\000\001%\129\000\001-\129\000\001.\001\000\002+\002\000\002+\003\000\001u\130\000\001u\131\000\001u\132\000\000\156\129\000\000\156\130\000\002\021\001\000\002\021\002\000\001\173\129\000\001\173\001\000\001\173\002\000\001\173\003\000\001\173\130\000\000\221\129\000\001\173\131\000\001\173\132\000\001\174\129\000\001\174\130\000\001\171\001\000\002\021\003\000\001\185\001\000\001\184\129\000\001\184\001\000\001\183\129\000\001\178\129\000\001\178\001\000\001\177\129\000\001\176\129\000\001\175\129\000\001\184\002\000\001\184\003\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\001\162\130\000\001\162\002\000\001\160\130\000\001\162\003\000\000w\001\000\000w\002\000\000w\003\000\001\132\129\000\001\132\001\000\001\132\002\000\001\132\130\000\002+\001\000\001\197\129\000\001\197\001\000\001T\129\000\000J\129\000\001\133\129\000\001\133\001\000\001)\001\000\001\197\130\000\001Q\129\000\001\197\131\000\001Q\130\000\001\197\132\000\001\132\129\000\001\132\001\000\001*\001\000\001\200\001\000\000\224\001\000\001\199\129\000\000J\001\000\001\199\130\000\001\199\131\000\001O\001\000\000\224\129\000\0015\001\000\000\224\130\000\000\224\131\000\001\199\001\000\000\005\001\000\000\004\129\000\000\004\001\000\000\003\129\000\000\005\002\000\000\004\130\000\000\004\002\000\000\003\130\000\000\005\003\000\000\004\131\000\000\004\003\000\000\004\132\000\000\004\133\000\000\005\004\000\000\178\129\000\000\178\001\000\000\177\129\000\000\177\130\000\001U\129\000\002+\001\000\001\197\129\000\001\197\001\000\000J\129\000\001U\001\000\001\196\001\000\001S\129\000\001\196\002\000\001S\130\000\001\196\001\000\001\196\002\000\001\193\129\000\001\198\001\000\001\191\001\000\001\190\129\000\001S\131\000\001\195\001\000\001\194\129\000\001\195\002\000\001\195\003\000\001\131\129\000\001\203\001\000\001\202\129\000\001\202\001\000\001\201\129\000\001\201\001\000\001\200\129\000\000\242\129\000\000I\129\000\001\203\002\000\001\202\130\000\001\202\002\000\001\201\130\000\001\201\002\000\001\200\130\000\000\242\130\000\001\203\003\000\001\202\003\000\001\203\004\000\001R\001\000\001T\001\000\001R\129\000\001N\001\000\001T\002\000\001T\003\000\001T\001\000\001R\129\000\001R\130\000\001R\131\000\001\198\129\000\001\195\129\000\001S\001\000\001P\001\000\000J\129\000\000\225\001\000\001Q\001\000\001P\129\000\001N\129\000\001Q\002\000\001Q\003\000\001N\130\000\001N\131\000\001N\129\000\001V\001\000\001V\002\000\001T\001\000\001R\129\000\001P\002\000\000\225\129\000\0015\001\000\000\225\130\000\000\225\131\000\001P\003\000\001P\004\000\001\193\001\000\000\224\129\000\000\209\129\000\000\209\130\000\001\193\002\000\001\193\003\000\001\192\129\000\000J\001\000\001\192\130\000\001\192\131\000\001\192\001\000\001\192\002\000\001\192\003\000\001O\129\000\001S\002\000\000\242\129\000\000I\129\000\001\191\129\000\001\202\004\000\001N\129\000\001\202\005\000\001\201\131\000\001\201\132\000\001\201\133\000\001\202\131\000\001\201\003\000\001\202\132\000\001\201\004\000\001\201\005\000\001\200\131\000\001\200\132\000\001\200\133\000\001\195\129\000\001U\002\000\001T\001\000\001R\129\000\001\197\002\000\000\225\129\000\001\197\003\000\001\197\004\000\001U\130\000\001N\129\000\000\177\131\000\000\178\130\000\000\178\131\000\001\199\002\000\001\199\003\000\001N\129\000\000\224\132\000\001O\002\000\001N\129\000\000\224\002\000\001\200\002\000\001\200\003\000\001T\130\000\001T\131\000\001T\132\000\001T\133\000\001T\001\000\001R\129\000\001T\134\000\001T\135\000\001T\001\000\001R\129\000\001T\136\000\001N\129\000\000w\004\000\000w\005\000\000s\129\000\000s\001\000\000q\001\000\002+\001\000\000p\129\000\000p\001\000\000o\129\000\000o\001\000\000o\002\000\000p\130\000\000p\002\000\000p\003\000\000\175\001\000\000\216\129\000\000p\131\000\0015\001\000\000\216\130\000\000\216\131\000\000p\132\000\000p\133\000\000\216\001\000\000\216\129\000\000o\130\000\000o\131\000\000o\132\000\000q\129\000\000s\130\000\000s\002\000\000s\003\000\000\132\129\000\000\135\129\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000\135\130\000\001\154\129\000\001\154\001\000\000\169\001\000\000\168\129\000\000\168\001\000\0016\001\000\000\169\002\000\000\169\003\000\000\233\001\000\000\172\001\000\000\171\129\000\000\171\001\000\000\170\129\000\000\170\001\000\002+\001\000\000^\129\000\000\200\129\000\002\000\001\000\001\255\001\000\002\000\002\000\002\000\003\000\001J\129\000\001\001\001\000\001\255\002\000\001E\001\000\001E\002\000\001\255\003\000\001G\001\000\000\200\130\000\002,\001\000\000\242\129\000\002,\002\000\000\242\130\000\002,\003\000\000^\130\000\000^\131\000\002*\129\000\000\171\130\000\000\171\002\000\000\171\131\000\000\171\003\000\000\171\132\000\000\171\004\000\000\171\133\000\000\173\001\000\000\131\129\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000\134\129\000\000\134\001\000\000\133\129\000\000\133\001\000\000r\001\000\001\140\130\000\000\133\130\000\002,\001\000\001\148\129\000\001\146\001\000\001\144\129\000\001\144\001\000\001\143\129\000\001\143\001\000\001\142\129\000\001\142\001\000\001\140\001\000\001\139\001\000\000\242\129\000\000I\129\000\002,\002\000\001\148\130\000\001\146\002\000\001\144\130\000\001\144\002\000\001\143\130\000\001\143\002\000\001\142\130\000\001\142\002\000\001\140\002\000\001\139\002\000\000\242\130\000\002+\001\000\001\148\131\000\001\139\003\000\001\148\132\000\000\254\129\000\001\245\001\000\001\244\001\000\0011\129\000\001\245\002\000\001\244\002\000\001:\001\000\001\245\003\000\001\244\003\000\001\245\004\000\001\244\004\000\001\245\005\000\002+\001\000\002\024\001\000\001\154\129\000\001\154\001\000\001\138\001\000\000J\129\000\001\251\129\000\001*\129\000\001\251\001\000\001*\001\000\001+\129\000\000\163\001\000\002\024\002\000\002\024\003\000\002\024\004\000\000\159\001\000\000\158\129\000\000\158\001\000\000\158\002\000\000\153\129\000\000\158\130\000\000\154\001\000\000\154\002\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\000\196\129\000\001\161\130\000\000J\001\000\001\135\001\000\001\149\001\000\001\161\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000}\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\003\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000z\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\003\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\136\130\000\000\136\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\129\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\003\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000{\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\131\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000{\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\003\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\129\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\131\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000~\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\131\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000|\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\131\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000|\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\003\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\130\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\003\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000}\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\131\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000z\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\131\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000y\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\131\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000y\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\003\000\000y\001\000\000x\129\000\000x\001\000\000x\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\131\000\000x\129\000\000x\001\000\000x\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\003\000\000x\001\000\000\131\002\000\000\136\129\000\000\131\003\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\130\130\000\000~\002\000\000\130\131\000\000\136\129\000\000\131\001\000\000\130\132\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\128\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\131\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\127\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\003\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\127\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\131\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\128\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\003\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\187\001\000\001\186\129\000\001\137\001\000\001\187\002\000\001\186\130\000\001\134\129\000\000\137\001\000\000\137\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\132\001\000\000\136\129\000\000\132\002\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\003\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\136\132\000\000\136\133\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\161\132\000\001\156\129\000\002,\001\000\001\169\129\000\001\167\001\000\001\165\129\000\001\165\001\000\001\164\129\000\001\164\001\000\001\163\129\000\001\163\001\000\001\161\001\000\001\160\001\000\000\242\129\000\000I\129\000\002,\002\000\001\169\130\000\001\167\002\000\001\165\130\000\001\165\002\000\001\164\130\000\001\164\002\000\001\163\130\000\001\163\002\000\001\161\002\000\001\160\002\000\000\242\130\000\002+\001\000\001\169\131\000\001\160\003\000\001\169\132\000\000[\001\000\000Z\129\000\000\250\001\000\001\169\133\000\000\252\129\000\000\243\129\000\000\244\001\000\000\252\129\000\000\246\129\000\000\246\001\000\000\246\130\000\001\001\001\000\000\246\131\000\000\243\001\000\000\252\130\000\000\218\001\000\000\243\130\000\000\243\131\000\000\249\129\000\000\242\129\000\000\244\129\000\000\218\129\000\0015\001\000\000\218\130\000\000\218\131\000\000\251\129\000\000\252\001\000\000\152\129\000\000\152\001\000\000\151\129\000\000\151\001\000\000\255\129\000\000\240\129\000\000\239\001\000\000\154\129\000\000\255\130\000\001\001\001\000\000\255\131\000\000\151\002\000\001\188\129\000\001\002\001\000\000\255\001\000\000\152\129\000\000\152\001\000\000\151\129\000\000\151\001\000\000\255\002\000\000\151\002\000\001\002\002\000\001\002\003\000\001\002\004\000\001\002\005\000\000\252\129\000\001\002\006\000\000\253\001\000\000\253\002\000\000\252\129\000\001\001\001\000\001\000\129\000\001\188\130\000\000\152\130\000\000\152\002\000\000\151\130\000\001\188\131\000\000\151\131\000\000\152\131\000\000\152\003\000\000\152\004\000\000\219\001\000\000\219\129\000\000\152\132\000\0015\001\000\000\219\130\000\000\219\131\000\000\152\133\000\000\152\134\000\000\152\130\000\000\152\002\000\000\151\130\000\000\151\131\000\000\252\002\000\001D\001\000\001\188\129\000\001\188\130\000\001\188\131\000\001D\002\000\000\252\003\000\000\252\004\000\000\252\129\000\000\252\005\000\000\244\130\000\001\169\134\000\001\169\135\000\001\169\136\000\001%\129\000\000\132\129\000\000\136\129\000\000\132\130\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\214\129\000\000\138\001\000\0015\001\000\000\214\130\000\000\214\131\000\000\139\001\000\000\138\129\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\139\002\000\000\138\002\000\000\214\001\000\001\160\004\000\001\160\005\000\001\164\131\000\000\241\001\000\000\239\129\000\000\163\129\000\000\163\130\000\001\164\132\000\001\164\133\000\000\166\001\000\000\165\129\000\000\165\001\000\000\165\002\000\000\165\130\000\000\154\001\000\000\165\131\000\000\165\132\000\001\156\001\000\001\170\001\000\001\187\001\000\001\186\129\000\001\158\001\000\001\155\129\000\000\166\002\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\000\166\003\000\000\166\004\000\001\164\003\000\001\164\004\000\001\164\005\000\001\165\131\000\001\165\003\000\001\165\004\000\001\165\132\000\001\165\133\000\001\167\003\000\001\167\004\000\000\215\129\000\0015\001\000\000\215\130\000\000\215\131\000\001\167\005\000\001\167\006\000\000\215\001\000\001\163\131\000\001\163\003\000\001\161\003\000\001\232\129\000\001\232\001\000\001e\129\000\001\232\002\000\001\232\130\000\001e\130\000\001\232\131\000\001e\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\232\132\000\0015\001\000\001e\132\000\001\161\004\000\001e\001\000\001_\129\000\001_\001\000\001^\129\000\001^\001\000\001]\129\000\001e\002\000\001_\130\000\001_\002\000\001^\130\000\001^\002\000\001]\130\000\001^\131\000\000\222\129\000\000\222\001\000\000\222\130\000\000\222\002\000\000\222\003\000\000\222\004\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001^\132\000\000\223\129\000\000\223\001\000\0015\001\000\000\223\130\000\000\223\002\000\000\223\131\000\000\223\003\000\000\223\132\000\000\223\004\000\000\223\005\000\000\223\006\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001^\133\000\001e\003\000\001_\131\000\001_\003\000\001^\003\000\001]\131\000\001\231\129\000\001A\001\000\001A\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\231\130\000\001e\004\000\000\228\001\000\001_\132\000\001_\004\000\001^\004\000\001]\132\000\001_\133\000\001_\005\000\001^\005\000\001]\133\000\001_\006\000\001]\134\000\001_\007\000\001]\135\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001_\b\000\001]\136\000\000\200\001\000\000\199\129\000\001_\t\000\0015\001\000\000\200\002\000\000\199\130\000\000\200\003\000\000\199\131\000\000\200\004\000\000\199\132\000\000\199\133\000\000\199\134\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001]\137\000\001_\134\000\001^\006\000\000\200\001\000\000\199\129\000\001_\135\000\001^\007\000\001\233\001\000\000\228\129\000\0015\001\000\000\228\130\000\000\228\131\000\001\233\002\000\001f\001\000\001f\002\000\001\163\132\000\001\163\133\000\001\163\004\000\001\163\005\000\001d\129\000\001d\001\000\001c\129\000\001c\001\000\001b\129\000\001b\001\000\001a\129\000\001a\001\000\001`\129\000\001`\001\000\001d\130\000\001d\002\000\001b\130\000\001b\002\000\001d\131\000\001d\003\000\001b\131\000\001b\003\000\001d\132\000\001d\004\000\001b\132\000\001b\004\000\001d\005\000\001b\005\000\001d\006\000\001b\006\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001d\007\000\001b\007\000\000\200\001\000\000\199\129\000\001d\b\000\001b\b\000\001d\133\000\001b\133\000\000\200\001\000\000\199\129\000\001d\134\000\001b\134\000\001c\130\000\001c\002\000\001a\130\000\001a\002\000\001`\130\000\001`\002\000\001c\131\000\001c\003\000\001a\131\000\001a\003\000\001`\131\000\001`\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001`\132\000\001c\132\000\001c\004\000\001a\132\000\001a\004\000\0015\001\000\001c\133\000\001c\005\000\001a\133\000\001a\005\000\001c\134\000\001c\006\000\001a\134\000\001a\006\000\001c\007\000\001a\007\000\001c\b\000\001a\b\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001c\t\000\001a\t\000\000\200\001\000\000\199\129\000\001c\n\000\001a\n\000\001c\135\000\001a\135\000\000\200\001\000\000\199\129\000\001c\136\000\001a\136\000\001`\004\000\000\196\130\000\000\158\131\000\000\158\132\000\000\159\002\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\000\159\003\000\000\159\004\000\002\024\005\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\024\006\000\002\024\007\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\024\b\000\001\138\002\000\001\138\003\000\002*\129\000\002'\129\000\002'\130\000\002'\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\0012\001\000\000\179\001\000\000\179\002\000\001\\\129\000\000\179\003\000\001\191\001\000\000\182\129\000\000\182\130\000\000\182\131\000\000\182\132\000\000\182\133\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\190\129\000\000\181\129\000\000\181\001\000\000\180\129\000\000\180\001\000\000\148\129\000\000\148\001\000\000\147\129\000\000\147\001\000\000\147\002\000\000\147\003\000\000a\129\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000a\130\000\000\147\004\000\000b\001\000\000\148\130\000\000\148\002\000\000\148\003\000\000\148\004\000\000\148\005\000\000\216\129\000\000\148\131\000\000\148\132\000\000\148\133\000\000\148\134\000\000\148\135\000\000\216\129\000\000\147\130\000\000\147\131\000\000\147\132\000\000\147\133\000\000\147\134\000\002\000\001\000\001\255\001\000\000\181\130\000\000\181\002\000\000\181\131\000\001\r\129\000\001\r\001\000\001\r\130\000\000\181\132\000\000\181\133\000\000\181\134\000\000\181\135\000\000\181\136\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\181\003\000\000\181\004\000\000\181\005\000\000\181\006\000\000\181\007\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\180\002\000\000\180\003\000\000\180\004\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\180\130\000\001N\129\000\000\182\001\000\000\182\002\000\000\182\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\179\004\000\001=\001\000\002(\129\000\002(\130\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\001\140\130\000\001\140\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\140\132\000\001\141\130\000\001\141\002\000\001\139\130\000\001\141\003\000\001\141\004\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\141\005\000\001\141\131\000\001\141\132\000\000\213\129\000\0015\001\000\000\213\130\000\000\213\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\141\133\000\001\141\134\000\000\213\001\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\139\131\000\000\167\129\000\001\149\130\000\001\248\001\000\001\248\002\000\000\252\129\000\002\022\129\000\002\022\001\000\002\022\130\000\002\022\002\000\002\022\131\000\002\022\003\000\002\022\132\000\002\022\004\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\002\022\133\000\002\022\134\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001K\001\000\001I\001\000\002\020\129\000\002\019\001\000\002\020\130\000\002\019\002\000\000\236\001\000\001N\129\000\000\236\002\000\001F\001\000\001F\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\236\003\000\000\236\004\000\000\236\005\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\020\131\000\002\020\132\000\000\197\129\000\000\197\130\000\002\019\003\000\002\023\129\000\002\023\130\000\002\023\131\000\002\023\132\000\001N\129\000\002\023\133\000\002\023\134\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000Y\129\000\000Z\001\000\002\023\135\000\002\023\136\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\023\137\000\002\023\138\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\001\239\129\000\001\238\129\000\001\239\130\000\001\238\130\000\001\239\131\000\001\238\131\000\001\239\132\000\001\238\132\000\001\239\133\000\001\238\133\000\001\014\129\000\001\014\001\000\001\014\130\000\001\238\134\000\001Z\129\000\001\228\129\000\000\143\001\000\000\140\001\000\000\143\002\000\000J\129\000\000\143\003\000\000\145\129\000\000\142\129\000\000\145\130\000\000\145\131\000\000\144\001\000\000\141\001\000\000\144\002\000\000\141\002\000\000\144\003\000\000\144\004\000\000\143\129\000\000\140\129\000\000\143\130\000\000\140\130\000\000\143\131\000\000\143\132\000\000\145\001\000\000\142\001\000\000\145\002\000\000\145\003\000\000\144\129\000\000\141\129\000\000\144\130\000\000\144\131\000\000^\001\000\000]\129\000\001\228\130\000\002\020\001\000\002\019\129\000\002\020\002\000\002\019\130\000\002\019\131\000\002\019\132\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\020\003\000\002\020\004\000\002\020\005\000\002\020\006\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\n\001\000\001\246\129\000\000E\129\000\0020\129\000\000E\130\000\000E\001\000\000E\002\000\000\201\129\000\002\016\129\000\002\017\001\000\002\r\001\000\002\014\001\000\002\014\002\000\002\r\002\000\000\230\001\000\000\230\129\000\000\201\130\000\0015\001\000\000\230\130\000\000\230\131\000\000\201\131\000\000\201\132\000\000E\003\000\000D\129\000\000D\001\000\000<\001\000\001\b\129\000\001\b\130\000\001\t\001\000\001\t\002\000\000<\002\000\002/\129\000\002/\130\000\002/\131\000\002/\132\000\001;\001\000\000>\001\000\000>\002\000\000>\003\000\000>\004\000\000>\005\000\000=\001\000\000=\002\000\000=\003\000\000=\004\000\000=\005\000\000;\001\000\000F\129\000\000\241\001\000\000\239\129\000\000G\001\000\000\241\002\000\000\239\130\000\000G\002\000\000G\003\000\0006\001\000\0004\129\000\000\205\129\000\000\212\129\000\000C\129\000\000C\130\000\000\205\130\000\000\205\131\000\0004\130\000\0005\129\000\000;\002\000\0005\001\000\0005\002\000\000D\130\000\000?\001\000\000L\129\000\000L\130\000\000L\131\000\000?\002\000\0008\001\000\0008\002\000\000:\001\000\000A\001\000\000@\129\000\000?\129\000\000>\129\000\000=\129\000\000<\129\000\000;\129\000\000<\130\000\000<\131\000\000>\130\000\000>\131\000\000>\132\000\000>\133\000\000>\134\000\000=\130\000\000=\131\000\000=\132\000\000=\133\000\000=\134\000\000;\130\000\000;\131\000\000?\130\000\000?\131\000\000@\130\000\000\235\129\000\000:\129\000\001;\001\000\000\235\130\000\000@\001\000\000\235\131\000\000:\130\000\000\235\001\000\0009\129\000\000D\131\000\000D\132\000\0009\001\000\0008\129\000\0009\002\000\0009\003\000\000D\002\000\000D\003\000\000`\129\000\000`\130\000\000E\004\000\000a\001\000\000E\131\000\000\b\129\000\000\b\130\000\000\t\001\000\000\t\002\000\000\t\003\000\000E\132\000\000\186\001\000\000\186\002\000\000&\001\000\000%\129\000\000%\001\000\000$\129\000\000$\001\000\000#\129\000\000#\001\000\000\"\129\000\000\"\001\000\000!\129\000\000&\002\000\000%\130\000\000%\002\000\000$\130\000\000$\002\000\000#\130\000\000#\002\000\000\"\130\000\000\"\002\000\000!\130\000\000&\003\000\000%\131\000\000%\003\000\000$\131\000\000$\003\000\000#\131\000\000#\003\000\000\"\131\000\000\"\003\000\000\"\004\000\001?\001\000\000 \001\000\001?\002\000\000 \129\000\000 \130\000\000 \131\000\000!\001\000\000`\001\000\000[\129\000\000\\\001\000\000C\001\000\000B\129\000\000B\001\000\000\179\001\000\0002\001\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\0002\002\000\000.\001\000\000.\002\000\000+\129\000\000+\130\000\000\210\129\000\000+\131\000\000,\001\000\000*\001\000\000)\129\000\000)\001\000\000(\129\000\000*\002\000\000)\130\000\000)\002\000\000(\130\000\000(\131\000\000(\132\000\000*\129\000\000(\001\000\000*\130\000\000A\129\000\000(\133\000\000+\001\000\000+\002\000\000*\003\000\000)\131\000\000)\132\000\000)\133\000\000)\134\000\000\216\129\000\000*\004\000\000*\005\000\000*\006\000\000*\007\000\000*\b\000\000\216\129\000\000)\003\000\000)\004\000\000)\005\000\000)\006\000\000)\007\000\000.\003\000\001>\001\000\001>\002\000\000.\004\000\0001\001\000\0001\002\000\001\029\129\000\001\029\001\000\000-\129\000\000\203\129\000\000\179\129\000\0004\001\000\0003\129\000\0002\129\000\0001\129\000\0000\129\000\000/\129\000\000.\129\000\000/\130\000\000/\131\000\002/\001\000\002.\129\000\002-\001\000\002,\129\000\002-\002\000\002,\130\000\001\007\129\000\002-\003\000\002,\131\000\002-\004\000\002,\132\000\002,\133\000\002\000\001\000\001\255\001\000\002,\134\000\001\255\002\000\002-\005\000\002-\006\000\002-\007\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002/\002\000\002.\130\000\002/\003\000\002.\131\000\002.\132\000\002.\133\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002/\004\000\002/\005\000\002/\006\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\179\130\000\000\179\131\000\000\179\132\000\000\179\133\000\0002\130\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\0002\131\000\000.\130\000\000.\131\000\000.\132\000\000.\133\000\0001\130\000\0001\131\000\0003\130\000\0000\130\000\000\238\129\000\000\238\001\000\000\237\129\000\000\237\001\000\000\237\002\000\000\237\003\000\000\237\004\000\000\237\005\000\000\238\130\000\000\238\002\000\000\237\130\000\001C\001\000\000\238\131\000\000\238\132\000\000\238\133\000\000\238\134\000\000\238\135\000\000\238\136\000\001C\002\000\000\238\003\000\000\238\004\000\000\237\131\000\0000\131\000\001\030\001\000\000\234\129\000\001;\001\000\000\234\130\000\0004\001\000\0003\129\000\0002\129\000\0001\129\000\0000\129\000\000/\129\000\000.\129\000\0003\001\000\0000\001\000\0000\002\000\000\234\131\000\001\030\002\000\001\028\129\000\001\028\001\000\0007\129\000\001N\129\000\0007\130\000\001\028\130\000\001\028\002\000\001\028\131\000\001\028\132\000\000\234\001\000\000-\001\000\000-\002\000\000\183\001\000\000\187\001\000\000\187\002\000\000\187\129\000\000\187\130\000\000\187\131\000\000\187\132\000\000\187\003\000\000\183\002\000\000-\003\000\000,\129\000\001\015\129\000\001\015\001\000\000+\001\000\000B\002\000\000B\003\000\000C\002\000\000B\130\000\000C\003\000\000B\131\000\000B\132\000\000B\133\000\000`\002\000\000`\003\000\000_\129\000\000_\130\000\000!\002\000\000\"\005\000\002\016\129\000\001\133\129\000\001\133\001\000\002\017\001\000\001\132\129\000\001\132\001\000\000#\132\000\000#\004\000\000#\005\000\000#\006\000\000\216\129\000\000#\133\000\000#\134\000\000#\135\000\000#\136\000\000\230\129\000\000&\004\000\000%\132\000\000%\004\000\000$\132\000\000$\004\000\000&\005\000\000%\133\000\000%\005\000\000$\133\000\000$\005\000\000&\006\000\000%\134\000\000%\006\000\000$\134\000\000$\006\000\000&\007\000\000%\135\000\000%\007\000\000$\135\000\000$\136\000\000$\137\000\000&\b\000\000%\136\000\000%\137\000\000%\138\000\000\216\129\000\000&\t\000\000&\n\000\000&\011\000\000&\012\000\000\216\129\000\000%\b\000\000%\t\000\000%\n\000\000%\011\000\000$\007\000\000\216\129\000\000\"\132\000\000\"\133\000\000\"\134\000\000\"\135\000\000!\131\000\001\246\130\000\000\006\129\000\000\006\130\000\000\007\001\000\000\007\002\000\000\007\003\000\001\246\131\000\000\184\001\000\000\184\002\000\002%\001\000\002%\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002(\001\000\002(\002\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\002)\001\000\002#\129\000\002#\001\000\002\"\129\000\002\"\001\000\002!\129\000\002!\001\000\002 \129\000\002 \001\000\002\031\129\000\002\031\001\000\002\030\129\000\002\030\001\000\002\029\129\000\002\029\001\000\002\028\129\000\002\028\001\000\002\027\129\000\002\027\001\000\002\026\129\000\002\026\001\000\002\025\129\000\002\025\001\000\002\024\129\000\001\236\129\000\002\029\130\000\002\029\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\026\130\000\002\026\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002)\002\000\002)\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002)\004\000\002)\005\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002!\130\000\002!\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\028\002\000\002\028\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\027\130\000\002\027\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\"\002\000\002\"\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\031\002\000\002\031\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\029\002\000\002\029\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\028\130\000\002\028\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\"\130\000\002\"\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\030\002\000\002\030\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\027\002\000\002\027\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\026\002\000\002\026\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\025\130\000\002\025\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\025\002\000\002\025\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\024\130\000\002\024\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002#\130\000\002#\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002#\002\000\002\030\130\000\002#\003\000\002#\004\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\030\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002!\002\000\002!\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002\031\130\000\002\031\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002 \002\000\002 \003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002 \130\000\002 \131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\240\129\000\002$\001\000\002$\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\236\001\000\001\235\129\000\001\236\002\000\001\236\003\000\001\241\001\000\001\241\129\000\002'\001\000\002&\129\000\002&\001\000\002%\129\000\002\018\129\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\002&\002\000\001\140\130\000\002&\003\000\001\140\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002&\004\000\001\140\132\000\002&\005\000\002&\006\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002'\002\000\002&\130\000\002%\130\000\001\141\130\000\001\141\002\000\001\139\130\000\002&\131\000\001\141\003\000\002&\132\000\001\141\004\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002&\133\000\001\141\005\000\002&\134\000\002&\135\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002'\003\000\001\141\131\000\002'\004\000\001\141\132\000\000\213\129\000\002'\005\000\001\141\133\000\002'\006\000\001\141\134\000\002'\007\000\002'\b\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\002%\131\000\001\139\131\000\002%\132\000\002%\133\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\242\001\000\001\242\002\000\000\245\129\000\000\245\001\000\000\253\129\000\000\253\130\000\000\252\129\000\000\245\130\000\001\001\001\000\000\245\131\000\000\254\001\000\000\245\132\000\000\245\002\000\000\202\129\000\001\243\001\000\001\243\002\000\000\t\129\000\000\t\130\000\000\t\131\000\000\n\001\000\000\n\002\000\000\n\003\000\000\n\004\000\001\243\003\000\000\188\129\000\000\188\130\000\0014\001\000\0013\129\000\0013\001\000\0012\129\000\0013\130\000\0013\002\000\0012\130\000\0012\131\000\0013\003\000\0014\002\000\001\246\001\000\002\005\001\000\001\250\129\000\001\249\129\000\001\248\129\000\001\247\001\000\001\245\129\000\001\244\129\000\001\243\129\000\001\242\129\000\001\240\001\000\001\239\001\000\001\238\001\000\001\237\001\000\001\231\001\000\001\230\129\000\001\229\001\000\001$\001\000\000\179\129\000\000F\001\000\002\005\002\000\001\231\002\000\001\230\130\000\002\005\003\000\001\231\003\000\001\230\131\000\002\001\001\000\001\230\132\000\002\001\002\000\001\230\133\000\001\230\134\000\001\230\135\000\001\018\129\000\001\018\001\000\001\016\129\000\001\016\001\000\001\018\130\000\001\016\130\000\001\018\131\000\001\016\131\000\001\018\132\000\001\019\129\000\001\019\001\000\001\017\129\000\001\017\001\000\001\019\130\000\001\019\002\000\001\017\130\000\001\017\002\000\001\019\131\000\001\017\131\000\001\019\132\000\001\017\132\000\001\019\133\000\001\019\003\000\001\017\003\000\001\019\004\000\001\018\002\000\001\016\002\000\001\018\003\000\000\019\001\000\000\018\129\000\000\191\001\000\000\190\129\000\000\191\002\000\000\191\003\000\000\192\001\000\000\191\129\000\000\192\002\000\000\191\130\000\000\192\003\000\000\192\004\000\000\192\005\000\000\191\131\000\000\191\132\000\000\191\004\000\000\190\130\000\000\190\131\000\000\018\130\000\001\230\136\000\002\005\004\000\001\231\004\000\000\241\001\000\000\239\129\000\001\231\005\000\000\241\002\000\000\239\130\000\001\231\006\000\001\231\007\000\001\231\b\000\001\231\t\000\001\231\n\000\001$\002\000\001$\003\000\001$\004\000\000\242\129\000\001\245\130\000\001\244\130\000\0011\129\000\001\245\131\000\001\244\131\000\001\245\132\000\001\244\132\000\001\245\133\000\001\244\133\000\001\245\134\000\0012\001\000\000\179\130\000\001\248\130\000\001\248\131\000\000\252\129\000\001\240\002\000\001\239\002\000\001\240\003\000\001\239\003\000\001\240\004\000\001\239\004\000\001\240\005\000\001\239\005\000\001\240\006\000\001\239\006\000\001\239\007\000\001\229\002\000\001\229\003\000\001\247\002\000\000F\002\000\000F\003\000\000F\004\000\000F\005\000\001\247\003\000\001\247\004\000\002)\001\000\002#\129\000\002#\001\000\002\"\129\000\002\"\001\000\002!\129\000\002!\001\000\002 \129\000\002 \001\000\002\031\129\000\002\031\001\000\002\030\129\000\002\030\001\000\002\029\129\000\002\029\001\000\002\028\129\000\002\028\001\000\002\027\129\000\002\027\001\000\002\026\129\000\002\026\001\000\002\025\129\000\002\025\001\000\002\024\129\000\001\237\002\000\001\242\130\000\001\242\131\000\001\243\130\000\001\243\131\000\001\243\132\000\001\238\002\000\001\238\003\000\001\250\001\000\001\237\129\000\001\237\130\000\001\249\001\000\001\247\129\000\002$\129\000\002$\130\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\249\130\000\000\254\130\000\000\254\131\000\001\148\133\000\000\252\129\000\001\148\134\000\001\148\135\000\001\148\136\000\001\139\004\000\001\139\005\000\001\143\131\000\001\143\132\000\001\143\133\000\001\143\003\000\001\143\004\000\001\143\005\000\001\144\131\000\001\144\003\000\001\144\004\000\001\144\132\000\001\144\133\000\001\146\003\000\001\146\004\000\000\215\129\000\001\146\005\000\001\146\006\000\001\142\131\000\001\142\003\000\001\140\003\000\001\140\004\000\001\142\132\000\001\142\133\000\001\142\004\000\001\142\005\000\001\140\131\000\000\136\129\000\000\133\131\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\140\132\000\000\133\132\000\000\133\133\000\000\136\129\000\000\133\134\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\141\130\000\001\141\002\000\001\139\130\000\000\134\130\000\000\134\002\000\000\133\002\000\001\141\003\000\000\134\003\000\001\141\004\000\000\136\129\000\000\134\004\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\141\005\000\000\134\005\000\000\134\006\000\000\136\129\000\000\134\007\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\141\131\000\000\134\131\000\001\141\132\000\000\213\129\000\000\134\132\000\001\141\133\000\000\134\133\000\001\141\134\000\000\134\134\000\000\134\135\000\000\136\129\000\000\134\136\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\139\131\000\000\133\003\000\000\133\004\000\000\136\129\000\000\133\005\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\136\129\000\000\131\130\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\171\005\000\000\172\129\000\000\200\129\000\000\170\130\000\000\170\131\000\000_\001\000\000\170\002\000\000\233\002\000\000\169\129\000\000\168\002\000\000\168\003\000\000\233\129\000\000\168\130\000\0015\001\000\000\233\130\000\000\233\131\000\000\233\132\000\000\168\131\000\000\168\132\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000s\004\000\000s\131\000\000s\132\000\000s\133\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000s\134\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000w\006\000\000w\007\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000w\b\000\000w\t\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000w\n\000\001\162\004\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\162\005\000\001\162\131\000\001\162\132\000\000\213\129\000\001\162\133\000\001\162\134\000\001\160\131\000\001\184\130\000\001\184\131\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\001\183\130\000\001\183\131\000\001\175\130\000\001\185\002\000\001\185\003\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\001\177\130\000\001\177\131\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\177\132\000\002\021\004\000\000\236\129\000\001N\129\000\000\236\130\000\000\236\131\000\000\236\132\000\0011\129\000\0018\001\000\0012\001\000\000\179\001\000\001o\129\000\001o\130\000\001k\129\000\001o\131\000\001n\129\000\001n\130\000\001n\131\000\001n\132\000\000\242\129\000\001n\133\000\001n\134\000\001n\001\000\001n\002\000\001n\003\000\001n\004\000\0014\001\000\0013\129\000\001\229\001\000\001o\001\000\000\179\129\000\0018\001\000\000\179\130\000\001o\002\000\001o\003\000\001o\004\000\001o\005\000\000\242\129\000\001o\006\000\001o\007\000\001p\129\000\001p\001\000\001p\002\000\001;\001\000\001p\003\000\001m\001\000\001l\001\000\001l\002\000\001m\129\000\001m\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001m\003\000\001;\001\000\001m\004\000\001m\129\000\001l\129\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001l\130\000\001;\001\000\001l\131\000\001\015\129\000\001\015\001\000\000\137\001\000\001m\130\000\001p\130\000\000\236\133\000\002\021\005\000\002\021\006\000\000\198\129\000\002\021\007\000\000\198\130\000\001\178\130\000\001\178\002\000\001\176\130\000\001\178\003\000\001\178\004\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\178\005\000\001\178\131\000\001\178\132\000\000\213\129\000\001\178\133\000\001\178\134\000\001\176\131\000\001\172\129\000\002,\001\000\001\185\129\000\001\183\001\000\001\181\129\000\001\181\001\000\001\180\129\000\001\180\001\000\001\179\129\000\001\179\001\000\001\177\001\000\001\176\001\000\000\242\129\000\000I\129\000\002,\002\000\001\185\130\000\001\183\002\000\001\181\130\000\001\181\002\000\001\180\130\000\001\180\002\000\001\179\130\000\001\179\002\000\001\177\002\000\001\176\002\000\000\242\130\000\002+\001\000\001\185\131\000\001\176\003\000\001\185\132\000\001\185\133\000\000\252\129\000\001\185\134\000\001\185\135\000\001\185\136\000\001\176\004\000\001\176\005\000\001\180\131\000\001\180\132\000\001\180\133\000\001\180\003\000\001\180\004\000\001\180\005\000\001\181\131\000\001\181\003\000\001\181\004\000\001\181\132\000\001\181\133\000\001\183\003\000\001\183\004\000\000\215\129\000\001\183\005\000\001\183\006\000\001\179\131\000\001\179\003\000\001\177\003\000\001\177\004\000\001\179\132\000\001\179\133\000\001\179\004\000\001\179\005\000\001\172\001\000\001\186\001\000\001\174\001\000\001\171\129\000\001X\129\000\001X\001\000\001X\130\000\001X\002\000\001N\129\000\001X\131\000\001X\132\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001W\129\000\001W\001\000\001\127\129\000\001\127\130\000\001\001\001\000\001w\129\000\001v\129\000\001w\130\000\001v\130\000\001w\131\000\001v\131\000\001w\132\000\001v\132\000\001w\133\000\001v\133\000\001v\134\000\001q\001\000\001q\002\000\000E\129\000\000'\001\000\000&\129\000\000&\130\000\000&\131\000\000&\132\000\000&\133\000\000'\002\000\000\007\129\000\000\007\130\000\000\b\001\000\000\b\002\000\000\b\003\000\000'\003\000\000\185\001\000\000\185\002\000\001x\129\000\001u\001\000\001t\129\000\001u\002\000\001\130\129\000\001u\003\000\001y\001\000\001y\129\000\001{\001\000\001z\001\000\001{\002\000\001{\003\000\000\242\129\000\001z\002\000\000\249\001\000\001\003\129\000\001\003\130\000\001\001\001\000\001\004\001\000\000\249\002\000\001|\001\000\001|\002\000\000\n\129\000\000\n\130\000\000\n\131\000\000\011\001\000\000\011\002\000\000\011\003\000\000\011\004\000\001|\003\000\000\189\129\000\000\189\130\000\001\127\001\000\002\005\001\000\001\131\001\000\001\130\001\000\001\128\001\000\001~\129\000\001}\129\000\001|\129\000\001{\129\000\001z\129\000\001x\001\000\001w\001\000\001v\001\000\001s\129\000\001s\001\000\001q\129\000\001$\001\000\000F\001\000\000'\129\000\002\005\002\000\001s\130\000\001s\002\000\002\005\003\000\001s\131\000\001s\003\000\002\001\001\000\001s\004\000\002\001\002\000\001s\005\000\001s\006\000\001s\007\000\001s\b\000\001s\132\000\000\241\001\000\000\239\129\000\001s\133\000\000\241\002\000\000\239\130\000\001s\134\000\001s\135\000\001s\136\000\001s\137\000\001s\138\000\001~\130\000\001}\130\000\0011\129\000\001~\131\000\001}\131\000\001~\132\000\001}\132\000\001~\133\000\001v\002\000\0012\001\000\001v\003\000\001v\004\000\001v\005\000\001\128\002\000\001\128\003\000\001\001\001\000\001x\002\000\001w\002\000\001x\003\000\001w\003\000\001x\004\000\001w\004\000\001x\005\000\001w\005\000\001x\006\000\001w\006\000\001w\007\000\001q\130\000\001q\131\000\000F\002\000\000'\130\000\000'\131\000\000'\132\000\001{\130\000\001z\130\000\001{\131\000\001{\132\000\000\242\129\000\001z\131\000\001|\130\000\001|\131\000\001|\132\000\001\130\002\000\001\129\129\000\001\129\001\000\001\128\129\000\001W\002\000\002\005\001\000\001\131\001\000\001\130\001\000\001\128\001\000\001~\129\000\001}\129\000\001|\129\000\001{\129\000\001z\129\000\001x\001\000\001w\001\000\001v\001\000\001s\129\000\001s\001\000\001q\129\000\001$\001\000\000Y\001\000\000F\001\000\000'\129\000\001W\130\000\002+\129\000\001\193\129\000\001V\129\000\001Y\001\000\001Y\002\000\001Y\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\156\131\000\000\156\132\000\001\005\130\000\001\005\131\000\001Q\133\000\000\176\002\000\000\176\129\000\000\174\131\000\000\174\003\000\000\173\131\000\000\174\132\000\000\174\004\000\000\174\133\000\000\174\005\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\149\002\000\001B\001\000\001B\002\000\000\149\003\000\000b\129\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000b\130\000\000\149\004\000\000c\001\000\000\150\130\000\000\150\002\000\000\150\003\000\000\150\004\000\000\150\005\000\000\216\129\000\000\150\131\000\000\150\132\000\000\150\133\000\000\150\134\000\000\150\135\000\000\216\129\000\000\149\130\000\000\149\131\000\000\149\132\000\000\149\133\000\000\149\134\000\000t\003\000\000\197\129\000\000t\004\000\000r\131\000\000v\005\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000v\006\000\001\012\002\000\000\214\129\000\001\012\003\000\001\012\004\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000\136\002\000\000\146\003\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001\153\130\000\001\153\002\000\000\215\129\000\001\153\003\000\001\153\004\000\000\221\132\000\001\136\131\000\001\136\132\000\000\136\129\000\000\135\003\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\248\130\000\000\248\002\000\000\247\130\000\000\247\002\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000\248\131\000\000\248\132\000\000\248\133\000\000\248\003\000\000\247\131\000\000\248\004\000\000\247\132\000\000\248\005\000\000\247\133\000\000\248\006\000\000\248\007\000\000\248\b\000\000\251\002\000\000\250\130\000\000\250\131\000\001\154\131\000\001\154\003\000\000\252\129\000\001\154\004\000\001\154\132\000\001\154\133\000\001\154\134\000\000w\130\000\000w\131\000\000w\132\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000w\133\000\000w\134\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000w\135\000\000w\136\000\000\221\002\000\001\157\002\000\001\157\003\000\001\157\130\000\000\221\129\000\001\157\131\000\001\157\132\000\000\164\130\000\000\164\131\000\001\152\130\000\001\152\002\000\001\151\130\000\001\152\003\000\001\152\131\000\001\151\131\000\001\152\132\000\001\151\132\000\001\151\133\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\145\002\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\001\159\002\000\001\159\003\000\001\169\001\000\001\168\129\000\001\168\001\000\001\167\129\000\001\166\002\000\001\162\129\000\001\162\001\000\001\161\129\000\001\160\129\000\001\159\129\000\000\157\130\000\000\157\131\000\001\185\001\000\001\184\129\000\001\184\001\000\001\183\129\000\001\178\129\000\001\178\001\000\001\177\129\000\001\176\129\000\001\175\129\000\000t\131\000\000t\132\000\000t\133\000\000\198\129\000\000t\134\000\000t\135\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000\160\004\000\000\160\005\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000\161\003\000\000\161\004\000\000\161\130\000\000\160\131\000\000\162\130\000\001\185\001\000\001\184\129\000\001\184\001\000\001\183\129\000\001\178\129\000\001\178\001\000\001\177\129\000\001\176\129\000\001\175\129\000\000u\003\000\000u\004\000\000u\005\000\000\198\129\000\000u\006\000\000u\007\000\001\175\002\000\001\175\003\000\001\185\001\000\001\184\129\000\001\184\001\000\001\183\129\000\001\182\002\000\001\178\129\000\001\178\001\000\001\177\129\000\001\176\129\000\001\175\129\000\002\021\131\000\001\185\001\000\001\184\129\000\001\184\001\000\001\183\129\000\001\178\129\000\001\178\001\000\001\177\129\000\001\176\129\000\001\175\129\000\002\021\132\000\002\021\133\000\002\021\134\000\000\198\129\000\002\021\135\000\000\017\131\000\000\017\132\000\000\208\129\000\000\026\130\000\000\026\131\000\000\027\002\000\000\207\129\000\001\024\129\000\001\024\001\000\001\024\130\000\001\024\002\000\001\024\131\000\000\207\130\000\000\027\003\000\000\027\004\000\002\006\001\000\000\241\001\000\000\239\129\000\000\217\001\000\000O\130\000\000R\001\000\000R\002\000\002\t\130\000\002\t\002\000\002\007\130\000\002\002\002\000\002\r\129\000\000P\129\000\000P\130\000\000P\131\000\000\226\001\000\002\r\130\000\000\226\129\000\0015\001\000\000\226\130\000\000\226\131\000\002\r\131\000\002\r\132\000\000P\001\000\000\026\001\000\000P\002\000\000P\003\000\000Q\129\000\000Q\130\000\000Q\001\000\000Q\002\000\000\020\129\000\000O\129\000\000P\129\000\000P\001\000\000U\001\000\000T\129\000\000T\001\000\000S\129\000\000S\001\000\000R\129\000\000R\130\000\000R\131\000\000U\002\000\000U\003\000\000S\130\000\000S\131\000\000S\132\000\000S\002\000\000S\003\000\000S\004\000\000T\130\000\000T\131\000\000T\002\000\000T\003\000\000\020\130\000\002\t\003\000\002\t\131\000\000Y\001\000\000U\001\000\000T\129\000\000T\001\000\000S\129\000\000S\001\000\000R\129\000\000\021\001\000\000\240\129\000\000\239\001\000\000R\130\000\002\r\129\000\000S\130\000\000S\002\000\000\026\001\000\000\021\002\000\000\021\003\000\002\t\132\000\000U\129\000\000W\001\000\000W\002\000\000\021\001\000\000\012\129\000\000U\130\000\000V\001\000\000V\002\000\000V\129\000\002\007\131\000\002\002\003\000\000\\\129\000\000]\001\000\002\n\002\000\002\b\002\000\002\b\130\000\000Y\001\000\000U\001\000\000T\129\000\000T\001\000\000S\129\000\000S\001\000\000R\129\000\000\021\001\000\002\b\131\000\002\012\130\000\002\012\002\000\002\011\130\000\002\011\002\000\002\n\130\000\002\007\002\000\002\003\002\000\002\002\130\000\002\012\131\000\002\012\003\000\002\011\131\000\002\011\003\000\002\n\131\000\002\003\003\000\002\002\131\000\002\012\132\000\002\012\004\000\002\003\004\000\001]\001\000\002\012\005\000\002\012\133\000\000U\001\000\000T\129\000\000T\001\000\000S\129\000\000S\001\000\000R\129\000\000\021\001\000\002\012\134\000\002\003\005\000\002\n\132\000\002\011\004\000\002\011\132\000\000U\001\000\000T\129\000\000T\001\000\000S\129\000\000S\001\000\000R\129\000\000\021\001\000\002\011\133\000\002\002\132\000\002\001\130\000\002\000\131\000\002\001\001\000\001\229\131\000\002\001\002\000\001\229\132\000\001\229\133\000\001\229\134\000\001\229\135\000\001\230\003\000\000\241\001\000\000\239\129\000\001\230\004\000\000\241\002\000\000\239\130\000\001\230\005\000\001\230\006\000\001\230\007\000\001\230\b\000\001\230\t\000\000\139\131\000\000\139\132\000\001\001\001\000\001\000\003\000\001[\002\000\000\023\003\000\000\177\004\000\001\255\130\000\002-\132\000\002\000\001\000\001\255\001\000\002-\133\000\001\255\002\000\002.\004\000\002.\005\000\002.\006\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\000/\002\000\001\232\129\000\001\232\001\000\001e\129\000\000I\001\000\002*\129\000\000\166\129\000\000\135\001\000\001e\001\000\001_\129\000\001_\001\000\001^\129\000\001^\001\000\001]\129\000\000\030\002\000\000\029\130\000\001e\002\000\001_\130\000\001_\002\000\001^\130\000\001^\002\000\001]\130\000\000\030\003\000\000\029\131\000\001^\131\000\000\030\004\000\000\030\005\000\001e\003\000\001_\131\000\001_\003\000\001^\003\000\001]\131\000\0015\001\000\000\029\132\000\000\029\133\000\000\029\002\000\000\029\003\000\000\031\002\000\000\031\003\000\000\030\130\000\000\030\131\000\000\031\130\000\000\031\131\000\001\229\001\000\001o\001\000\000\203\129\000\000\179\129\000\0004\001\000\0003\129\000\0002\129\000\0001\129\000\0000\129\000\000/\129\000\000.\129\000\002,\001\000\001\148\129\000\001\146\001\000\001\144\129\000\001\144\001\000\001\143\129\000\001\143\001\000\001\142\129\000\001\142\001\000\001\140\001\000\001\139\001\000\000\242\129\000\000\167\001\000\000I\129\000\002,\002\000\001\148\130\000\001\146\002\000\001\144\130\000\001\144\002\000\001\143\130\000\001\143\002\000\001\142\130\000\001\142\002\000\001\140\002\000\001\139\002\000\000\242\130\000\000\167\002\000\002*\129\000\000\167\003\000\000v\131\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000v\132\000\001K\130\000\001K\131\000\001L\002\000\001L\003\000\002\023\003\000\002\023\004\000\001\149\129\000\001\148\001\000\001\147\129\000\001\147\001\000\001\146\129\000\001\141\129\000\001\141\001\000\001\140\129\000\001\139\129\000\001\138\129\000\000\155\129\000\000\155\130\000\000\000\001\000\000\000\128\000\000\156\001\000\000\156\002\000\000\000\129\000\000\001\000\000\000\001\001\000\001L\129\000\001L\130\000\000\001\128\000\000\001\129\000\001M\001\000\000\136\129\000\000\131\001\000\000\130\129\000\000\130\001\000\000\129\129\000\000\129\001\000\000\128\129\000\000\128\001\000\000\127\129\000\000\127\001\000\000~\129\000\000~\001\000\000}\129\000\000}\001\000\000|\129\000\000|\001\000\000{\129\000\000{\001\000\000z\129\000\000z\001\000\000y\129\000\000y\001\000\000x\129\000\000x\001\000\001M\002\000\000\002\000\000\001N\129\000\001M\129\000\001M\130\000\000\002\001\000\000\002\128\000\001\254\001\000\001\254\002\000\000m\129\000\000k\001\000\000k\129\000\000m\001\000\000l\001\000\002,\001\000\000\242\129\000\000l\129\000\001\254\003\000\000c\129\000\000\002\129\000\000d\129\000\000d\130\000\000d\001\000\000d\002\000\001\254\129\000\000\003\000\000\000e\001\000\002)\129\000\000\003\001\000\000g\001\000\000f\001\000\000f\002\000\000f\003\000\000f\129\000\000e\129\000\000e\130\000\000e\131\000\002*\001\000\000f\130\000\000g\002"), (16, "\000\000\000\001\000\002\000\003\000\004\000\005\000\006\000\007\000\b\000\t\000\n\000\011\000\012\000\r\000\014\000\015\000\016\000\017\000\018\000\019\000\020\000\021\000\022\000\023\000\024\000\025\000\026\000\027\000\028\000\029\000\030\000\031\000 \000!\000\"\000#\000$\000%\000&\000'\000(\000)\000*\000+\000,\000-\000.\000/\0000\0001\0002\0003\0004\0005\0007\0008\0009\000:\000;\000=\000>\000?\000E\000F\000H\000I\000K\000M\000N\000O\000Q\000R\000U\000W\000Y\000Z\000\\\000]\000_\000`\000a\000d\000f\000g\000i\000j\000k\000l\000m\000o\000p\000q\000s\000u\000v\000w\000y\000z\000{\000|\000}\000~\000\127\000\130\000\136\000\137\000\138\000\139\000\140\000\143\000\144\000\147\000\150\000\152\000\153\000\154\000\155\000\157\000\158\000\159\000\160\000\162\000\163\000\164\000\165\000\166\000\167\000\168\000\170\000\172\000\173\000\174\000\175\000\176\000\192\000\195\000\198\000\199\000\200\000\201\000\202\000\203\000\204\000\205\000\206\000\207\000\208\000\209\000\210\000\215\000\216\000\217\000\218\000\219\000\220\000\221\000\224\000\225\000\227\000\228\000\229\000\230\000\231\000\236\000\237\000\238\000\239\000\240\000\241\000\242\000\247\000\248\000\249\000\250\000\252\000\253\001\000\001\001\001\004\001\005\001\006\001\007\001\t\001\n\001\011\001\012\001\r\001\014\001\015\001\016\001\022\001\023\001\024\001\026\001\028\001\029\001\030\001 \001\"\001&\001(\001)\001+\001,\001-\001/\0011\0012\0014\0015\0017\0018\0019\001:\001<\001>\001?\001@\001A\001B\001C\001D\001G\001J\001N\001O\001Q\001S\001U\001V\001W\001X\001Y\001e\001f\001g\001j\001m\001n\001o\001p\001q\001r\001|\001}\001\135\001\136\001\147\001\148\001\159\001\160\001\161\001\162\001\163\001\173\001\174\001\175\001\176\001\177\001\187\001\188\001\190\001\192\001\196\001\197\001\198\001\199\001\202\001\205\001\206\001\207\001\212\001\213\001\215\001\216\001\217\001\220\001\223\001\225\001\227\001\228\001\229\001\230\001\231\001\232\001\234\001\236\001\238\001\239\001\240\001\241\001\243\001\244\001\246\001\247\001\248\001\249\001\250\001\251\001\252\001\253\001\254\002\001\002\004\002\005\002\006\002\007\002\b\002\t\002\011\002\012\002\r\002\015\002\016\002\017\002\019\002\020\002\021\002\022\002\023\002\024\002\026\002\027\002\029\002\031\002 \002!\002\"\002#\002$\002%\002&\002'\002(\002)\002*\002+\002-\002.\002/\0020\0021\0022\0023\0024\0027\0028\0029\002:\002<\002=\002>\002@\002B\002C\002D\002E\002G\002I\002J\002L\002M\002N\002O\002Q\002R\002S\002T\002U\002V\002X\002Z\002[\002\\\002]\002_\002`\002a\002b\002c\002e\002g\002i\002j\002k\002l\002m\002n\002q\002r\002s\002t\002u\002v\002w\002x\002y\002z\002{\002~\002\127\002\128\002\129\002\130\002\131\002\132\002\134\002\135\002\136\002\137\002\138\002\139\002\140\002\141\002\142\002\145\002\148\002\150\002\151\002\153\002\154\002\155\002\156\002\157\002\159\002\165\002\166\002\168\002\170\002\172\002\173\002\174\002\176\002\178\002\179\002\180\002\182\002\184\002\185\002\186\002\187\002\188\002\189\002\191\002\193\002\194\002\195\002\196\002\197\002\198\002\199\002\200\002\201\002\202\002\203\002\204\002\205\002\206\002\207\002\208\002\209\002\210\002\211\002\212\002\213\002\214\002\215\002\216\002\220\002\222\002\224\002\225\002\229\002\233\002\235\002\237\002\238\002\240\002\241\002\243\002\244\002\245\002\246\002\248\002\249\002\250\002\252\002\254\002\255\003\000\003\001\003\002\003\003\003\004\003\005\003\006\003\007\003\b\003\n\003\012\003\r\003\014\003\015\003\017\003\018\003\019\003\020\003\021\003\022\003\023\003\024\003\025\003\026\003\027\003\028\003\029\003\030\003\031\003 \003#\003&\003'\003(\003)\003*\003+\003,\003-\003.\0030\0031\0034\0036\0038\0039\003:\003;\003<\003>\003?\003B\003C\003E\003G\003H\003K\003N\003P\003R\003T\003U\003V\003W\003Y\003[\003\\\003_\003a\003b\003e\003f\003h\003i\003j\003m\003p\003s\003t\003u\003v\003w\003y\003z\003{\003}\003~\003\127\003\129\003\130\003\131\003\132\003\133\003\134\003\135\003\136\003\137\003\138\003\139\003\140\003\141\003\142\003\143\003\144\003\146\003\147\003\148\003\149\003\150\003\151\003\152\003\153\003\154\003\155\003\156\003\157\003\158\003\159\003\160\003\161\003\163\003\164\003\165\003\167\003\168\003\169\003\170\003\171\003\172\003\182\003\183\003\193\003\196\003\197\003\198\003\199\003\200\003\202\003\203\003\204\003\209\003\212\003\214\003\216\003\217\003\220\003\221\003\222\003\224\003\225\003\226\003\228\003\230\003\231\003\232\003\236\003\240\003\243\003\244\003\245\003\246\003\249\003\250\003\251\003\255\004\000\004\002\004\004\004\005\004\006\004\007\004\b\004\t\004\n\004\011\004\r\004\014\004\015\004\016\004\024\004\031\004!\004\"\004#\004&\004'\004*\004+\004,\004-\004/\0041\0042\0045\0046\0047\0048\004:\004;\004>\004@\004B\004C\004D\004E\004F\004H\004I\004J\004K\004M\004N\004O\004P\004Q\004R\004S\004T\004V\004W\004Y\004Z\004[\004\\\004]\004_\004`\004a\004b\004c\004d\004e\004f\004i\004k\004l\004m\004n\004p\004q\004r\004s\004t\004v\004w\004y\004z\004{\004|\004}\004~\004\129\004\130\004\133\004\134\004\136\004\137\004\139\004\140\004\145\004\146\004\148\004\149\004\150\004\152\004\154\004\155\004\156\004\157\004\158\004\160\004\161\004\162\004\163\004\165\004\166\004\167\004\168\004\179\004\184\004\186\004\187\004\188\004\189\004\193\004\195\004\196\004\198\004\199\004\200\004\202\004\203\004\204\004\205\004\206\004\207\004\208\004\210\004\212\004\213\004\214\004\215\004\218\004\220\004\222\004\223\004\224\004\225\004\240\004\242\004\255\005\011\005\014\005\015\005\016\005\019\005\021\005\022\005\024\005\026\005\027\005!\005#\005%\005'\005(\005)\005*\005-\005.\005/\0051\0052\005<\005>\005?\005@\005Y\005Z\005s\005t\005\141\005\142\005\167\005\168\005\193\005\194\005\219\005\220\005\245\005\246\006\015\006\016\006)\006*\006C\006D\006]\006^\006w\006x\006\145\006\146\006\171\006\172\006\197\006\198\006\223\006\224\006\249\006\250\007\019\007\020\007-\007/\0070\007I\007J\007c\007d\007}\007~\007\151\007\152\007\177\007\180\007\181\007\182\007\183\007\184\007\209\007\210\007\235\b\004\b\005\b\030\b\031\b \b-\b9\b<\b=\b>\b?\b@\bB\bC\bD\bG\bH\bJ\bK\bL\bM\bN\bO\bQ\bS\bU\bV\bW\bX\b\\\b`\ba\bc\bd\bk\bm\bn\bo\bp\br\bs\bt\bv\bx\b|\b~\b\128\b\129\b\130\b\132\b\134\b\135\b\136\b\137\b\140\b\141\b\142\b\143\b\144\b\145\b\146\b\147\b\148\b\149\b\151\b\152\b\153\b\154\b\155\b\157\b\182\b\184\b\186\b\187\b\213\b\214\b\215\b\216\b\217\b\218\b\219\b\222\b\223\b\224\b\225\b\228\b\229\b\231\b\232\b\233\b\234\b\235\b\238\b\239\b\240\b\250\b\251\b\252\b\253\b\254\t\000\t\001\t\002\t\003\t\004\t\006\t\b\t\t\t\n\t\011\t\012\t\015\t\018\t\019\t\021\t/\t1\t2\t3\t9\t?\t@\tB\tD\tE\t^\ta\td\tf\th\ti\t\130\t\131\t\136\t\137\t\138\t\163\t\164\t\165\t\166\t\170\t\174\t\176\t\202\t\206\t\207\t\210\t\212\t\214\t\215\t\240\t\241\t\245\t\246\t\247\t\249\t\251\t\252\t\253\t\254\t\255\n\000\n\001\n\002\n\003\n\r\n\017\n\021\n\025\n\027\n5\n9\n:\n;\n?\n@\nA\nG\ne\nf\nk\no\ns\nu\n\143\n\147\n\148\n\149\n\153\n\154\n\155\n\156\n\157\n\158\n\159\n\160\n\170\n\171\n\196\n\197\n\222\n\223\n\224\n\225\n\227\n\228\n\253\n\255\011\000\011\001\011\002\011\004\011\005\011\006\011\007\011 \011%\011)\011*\011+\011,\011E\011F\011G\011I\011J\011K\011L\011N\011O\011P\011Q\011R\011T\011U\011V\011W\011X\011\\\011]\011_\011`\011a\011b\011c\011d\011}\011~\011\127\011\128\011\129\011\154\011\155\011\156\011\181\011\182\011\184\011\185\011\210\011\211\011\212\011\213\011\224\011\225\011\250\011\251\011\254\011\255\012\024\012\025\012\026\012\028\012\030\0127\0128\0129\012R\012S\012T\012U\012V\012X\012Z\012\\\012^\012j\012k\012\132\012\133\012\134\012\136\012\138\012\139\012\141\012\142\012\167\012\168\012\169\012\194\012\195\012\197\012\198\012\199\012\200\012\201\012\202\012\204\012\205\012\230\012\231\012\232\012\233\r\002\r\003\r\014\r\016\r\018\r\020\r\022\r\023\r\024\r\026\r\027\r\028\r\029\r\030\r \r!\r\"\r#\r%\r&\r'\r)\r+\r,\r-\r/\r1\r2\r3\r5\r6\r7\r9\r:\r;\r<\r=\r>\r@\rB\rC\r\\\r]\r^\r_\rx\ry\r{\r|\r}\r~\r\127\r\128\r\129\r\130\r\131\r\132\r\133\r\134\r\135\r\137\r\139\r\140\r\141\r\142\r\143\r\145\r\146\r\147\r\148\r\149\r\150\r\151\r\152\r\153\r\154\r\155\r\156\r\157\r\158\r\159\r\160\r\161\r\162\r\163\r\164\r\165\r\166\r\167\r\168\r\171\r\174\r\175\r\176\r\177\r\178\r\180\r\181\r\182\r\183\r\184\r\185\r\186\r\187\r\188\r\189\r\190\r\191\r\192\r\193\r\194\r\195\r\196\r\197\r\204\r\205\r\206\r\207\r\208\r\209\r\210\r\211\r\212\r\213\r\214\r\215\r\216\r\217\r\218\r\219\r\220\r\221\r\223\r\225\r\226\r\227\r\228\r\229\r\230\r\231\r\232\r\234\r\235\r\236\r\237\r\238\r\239\r\240\r\241\r\242\r\243\r\244\r\245\r\246\r\247\r\248\r\249\r\250\r\251\014\005\014\015\014\024\014\025\014\026\014\027\014\028\014\029\014\030\014\031\014 \014!\014\"\014#\014%\014&\014'\014(\0143\0144\0145\0146\0147\0148\0149\014:\014>\014B\014C\014D\014F\014G\014H\014I\014J\014K\014M\014N\014O\014P\014R\014S\014T\014U\014V\014X\014Y\014Z\014[\014\\\014]\014^\014_\014`\014a\014b\014c\014d\014e\014n\014o\014p\014t\014w\014y\014{\014~\014\128\014\129\014\130\014\155\014\157\014\159\014\160\014\185\014\186\014\187\014\212\014\213\014\214\014\215\014\216\014\217\014\228\014\229\014\230\014\231\014\232\014\233\014\234\014\235\014\236\014\240\014\241\014\242\014\243\014\244\014\247\014\249\014\250\014\251\014\252\014\253\014\254\014\255\015\000\015\001\015\002\015\003\015\005\015\007\015\014\015\015\015\016\015\017\015\018\015\019\015\021\015\022\015\024\015\026\015\027\015\028\015\029\015\030\015\031\015 \015!\015\"\015#\015$\015%\015&\015'\015(\015)\015*\015-\015.\015/\0151\0152\0153\0154\0155\0156\0157\0158\0159\015:\015;\015>\015A\015C\015D\015E\015G\015H\015I\015J\015P\015U\015Z\015^\015_\015`\015b\015c\015d\015f\015g\015h\015i\015k\015l\015m\015n\015o\015q\015r\015s\015t\015u\015v\015w\015x\015y\015z\015{\015|\015}\015~\015\127\015\152\015\153\015\164\015\189\015\190\015\215\015\216\015\241\015\242\016\011\016\012\016%\016&\016?\016@\016Y\016Z\016s\016t\016\141\016\142\016\167\016\168\016\193\016\194\016\219\016\220\016\245\016\246\017\015\017\016\017)\017*\017C\017D\017]\017^\017w\017x\017\145\017\146\017\171\017\173\017\174\017\199\017\224\017\225\017\250\017\251\018\020\018\021\018.\018/\018H\018I\018J\018c\018e\018f\018g\018h\018i\018x\018z\018\148\018\150\018\151\018\176\018\182\018\184\018\210\018\212\018\213\018\238\018\240\018\243\018\245\018\247\018\248\019\017\019\019\019\020\019-\019.\019/\0191\0192\0194\0195\0197\0198\0199\019:\019;\019<\019=\019>\019?\019@\019A\019B\019C\019D\019E\019F\019G\019K\019L\019N\019O\019P\019Q\019R\019e\019h\019k\019m\019o\019p\019q\019u\019w\019y\019z\019~\019\130\019\132\019\134\019\135\019\137\019\138\019\140\019\141\019\142\019\143\019\145\019\146\019\147\019\149\019\151\019\152\019\153\019\154\019\155\019\156\019\157\019\158\019\159\019\160\019\161\019\162\019\165\019\168\019\169\019\170\019\171\019\172\019\173\019\174\019\175\019\177\019\180\019\182\019\184\019\186\019\187\019\189\019\190\019\192\019\194\019\196\019\198\019\200\019\201\019\202\019\203\019\204\019\205\019\207\019\208\019\209\019\210\019\211\019\212\019\237\019\238\019\239\019\240\019\241\019\242\019\243\019\244\019\245\019\246\019\247\019\248\019\249\019\250\020\019\020\020\020\021\020\022\020\024\020\025\020\026\020\027\020\028\020\029\020\030\020\031\020 \020!\020\"\020#\020%\020&\020'\020(\020)\020+\020,\020-\0200\0201\0202\0203\0204\0205\020O\020Q\020R\020k\020q\020s\020\141\020\143\020\144\020\169\020\171\020\174\020\176\020\178\020\179\020\204\020\206\020\207\020\232\021\001\021\002\021\003\021\005\021\006\021\007\021\b\021\t\021\n\021\011\021\012\021\014\021\016\021\017\021\018\021\019\021\020\021-\021.\021/\0210\021I\021b\021c\021|\021}\021\136\021\161\021\162\021\163\021\165\021\166\021\167\021\168\021\169\021\180\021\181\021\182\021\183\021\184\021\194\021\195\021\220\021\221\021\222\021\223\021\225\021\226\021\227\021\228\021\231\021\232\021\233\021\234\021\235\021\236\021\237\021\238\021\240\021\241\021\242\021\243\021\244\021\245\021\246\021\248\021\251\021\253\021\254\021\255\022\000\022\002\022\003\022\004\022\006\022\b\022\t\022\011\022\012\022&\022(\022)\022C\022E\022F\022I\022J\022K\022L\022M\022O\022P\022Q\022T\022U\022n\022o\022p\022r\022s\022t\022u\022v\022\131\022\143\022\146\022\147\022\149\022\150\022\151\022\152\022\153\022\154\022\155\022\156\022\157\022\158\022\159\022\160\022\162\022\163\022\164\022\165\022\166\022\168\022\169\022\170\022\173\022\174\022\175\022\176\022\177\022\178\022\179\022\180\022\181\022\182\022\184\022\187\022\188\022\213\022\215\022\216\022\218\022\220\022\222\022\224\022\226\022\227\022\228\022\229\022\230\022\231\022\233\022\234\022\235\022\236\022\237\022\238\022\239\022\240\022\241\022\242\022\243\022\244\022\245\022\246\022\247\022\248\022\250\022\251\022\252\022\253\022\254\022\255\023\001\023\002\023\004\023\005\023\006\023\007\023\t\023\n\023\011\023\012\023\r\023\014\023\015\023\016\023\017\023\018\023\019\023\020\023\021\023\022\023\023\023\024\023*\023-\0230\0232\0234\0235\0236\0237\023:\023=\023>\023?\023@\023A\023B\023E\023G\023I\023J\023L\023M\023N\023O\023P\023R\023T\023V\023X\023Z\023[\023\\\023]\023^\023_\023a\023b\023c\023e\023f\023h\023i\023j\023k\023l\023m\023n\023o\023p\023q\023\132\023\133\023\135\023\136\023\137\023\138\023\163\023\164\023\165\023\166\023\167\023\168\023\169\023\170\023\173\023\175\023\176\023\201\023\202\023\203\023\204\023\205\023\206\023\231\023\232\023\233\023\235\023\236\023\237\023\238\023\240\023\241\023\242\023\243\023\244\023\246\023\247\023\248\023\249\023\250\023\251\023\253\023\254\023\255\024\024\024\026\024\027\024\028\024'\024@\024A\024C\024D\024E\024F\024G\024H\024a\024}\024~\024\127\024\128\024\130\024\132\024\134\024\135\024\136\024\137\024\138\024\139\024\140\024\143\024\144\024\145\024\146\024\147\024\148\024\149\024\150\024\175\024\176\024\201\024\202\024\203\024\204\024\205\024\207\024\208\024\209\024\210\024\211\024\214\024\215\024\217\024\218\024\219\024\220\024\231\024\232\024\233\024\243\024\244\024\245\024\255\025\000\025\001\025\003\025\004\025\015\025\016\025\027\025\028\025\029\025\030\025\031\025)\025*\025+\025-\025.\025/\0250\025:\025D\025E\025F\025H\025I\025J\025K\025L\025M\025N\025O\025P\025R\025T\025U\025V\025W\025X\025\\\025]\025^\025_\025c\025e\025f\025g\025h\025j\025l\025m\025n\025o\025q\025r\025s\025t\025u\025v\025w\025x\025y\025z\025{\025\129\025\130\025\131\025\132\025\133\025\134\025\135\025\136\025\137\025\138\025\139\025\140\025\141\025\142\025\143\025\144\025\145\025\154\025\157\025\159\025\161\025\162\025\163\025\164\025\165\025\166\025\167\025\169\025\170\025\171\025\172\025\173\025\174\025\175\025\176\025\177\025\178\025\179\025\188\025\189\025\197\025\204\025\207\025\208\025\209\025\217\025\218\025\219\025\220\025\221\025\229\025\230\025\231\025\232\025\233\025\235\025\237\025\238\025\239\025\240\025\243\025\246\025\247\025\248\025\249\025\250\025\251\025\252\025\253\025\255\026\000\026\001\026\002\026\003\026\006\026\b\026\t\026\n\026#\026$\026(\026+\0263\026;\026=\026>\026D\026E\026F\026G\026H\026I\026J\026K\026L\026M\026N\026Y\026g\026t\026v\026w\026\130\026\131\026\132\026\133\026\134\026\135\026\146\026\147\026\148\026\149\026\150\026\151\026\152\026\153\026\154\026\155\026\156\026\157\026\158\026\159\026\184\026\185\026\186\026\188\026\189\026\190\026\191\026\192\026\193\026\194\026\195\026\196\026\197\026\198\026\201\026\202\026\203\026\204\026\205\026\206\026\207\026\208\026\209\026\210\026\211\026\212\026\213\026\215\026\216\026\217\026\219\026\220\026\221\026\222\026\223\026\224"))
    
    and nullable =
      "\000\128P\144\016\000\000 \002 \007\255\255\224\028\0000\000\128\000\000\000\255\223\255\004\002\002\000\024\000\b\000\012\016\016\002\000"
    
    and first =
      (126, "!\226\130\000N\137|\222\254\002\131\248\128\128a\192\135\138\b\001:%\243{\248\n\015\226\002\001\135\0002\b \000@\003\128N\224\000\r\000\b\002\b\bX\160\000\019\002\0305\191\128 \242\000 \bp\003\b\002\004\000\000\024\007h\000\000\b\000\128\000\000\002\000\000\000\002\004\016!\000\b\000\194\002\001\000\002\030(\000\004\232\151\205\239\224(?\136\b\006\028\000 \000\000\000\000@\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\b \000\000\000\000\000\000\000\000\000\128\000\000\000\000 \128\000\000\000\000\000\000\000\016\000@\000\000\000\000\006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\024\000\000\000\000\000\000\000\000\000\135\138\b\001:%\243{\248\n\015\226\002\001\135\002\030( \004\232\151\205\239\224(?\136\b\006\028\bX\160\000\019\002\0305\175\128 \242\000\000\bp\003\b\002\004\000\000\024\007(\000\000\b\000\000\000\000\000\000\000\000\016\000\128\000\000\000\000\000\000\000\000\000 \000\000@@\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\002\000\000\004\004\000 \000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\001\001\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\004\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\016\000\000\000\128(\000\004\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\018\000\002\030( \004\232\151\205\239\224(?\136\b\006\028\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\128\000\128\000\000\000\000\000\001\128\000\000\000\000\000\000\000\000\002\030(\000\004\232\151\205\239\224(?\128\b\006\028\bx\160\000\019\162_7\191\128\160\254\000 \024p\000\000\128\000\000\000\000\000@\000\000\000\000\128\000\000\000\002\000\000\000\000\000\001\000\000\000\000\002\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\001\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\004\000\000\001\000\b\000\000\031}\196\b ~\195\000\001`\227\220\028X\020\028\001\000\000\000\000\000\000\000\168\000\000\000\000\000\000\000\012\130\b\000\016\000\192\018\168\000\003\000\000\000\130\000\000\000\000\000\000\001\128\000\000\000\000\000\000\000\000\000H\000\000\000\000\004\000*\000\000\016\000\000\000\000\003 \130\000\004\0008\004\170\000\000\192\000\000 \128\004\000\000\000\000\000`\016 \000\000\000\000\000\000\000\018\000\000\000\000\001\000\002\000\000\004\000\000\000\b\000H \000\016\002\0065\174\128\0000\000\000\b \001 \128\000@\b\024\214\186\000\000\192\000\000 \128\000\000\000\000\000\000@\b`\000\000\000\000\000\000\000\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\000\000 \000\001\000\b\000\000\128\000 \000\000\b\000\000\128\000\000\000\129\004\b@\002\0000\000\128@\000\002\000\000\000\002\004\016!\000\b\000\192\002\001\000\000\b\000\000\000\b\016@\132\000 \003\000\b\004\000\000 \000\000\000\000\000\000\016\000\000\000\000 \000\000\000\000\000\000\000\000\000\000@\000\000\016\000\128\000\000\133\138\000\0012%\243[\248\002\015`\002\000\135\002\022(\000\004\232\151\205o\224\b=\128\b\002\028\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\003\000\002\004\000\000\024\007h\000\000\000\000\128\002\128\012\000\b\016\000\000`\029\160\000\000\000\002\000\002\000\000\000\000\000\000 \128\004\000\000\000\000\b\000\000\000\000 \000\000\000\000\000\000\000\000\000\002\000\000\000\001\000\000\000\000\000\b\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\194\000\129\000\000F\001\218\000\000\002\000 \000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\002\030(\000$\232\151\205\239\224(?\128\b\014\028\000\200 \128\001\000\014\001;\128\0004\000 \b \003 \130\000\004\0018\004\238\000\000\208\000\128 \128\004\128\000\000\000\000@\002\160\000\001\000\000\000\000\0002\b \000@\003\128N\224\000\r\000\136\002\b\000\200 \128\001\000\014\001;\128\0004\000 \b \003 \130\000\004\0008\004\238\000\000\208\000\128 \128\133\138\000\0010!\227[\248\002\015 \002\000\135\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\000\000\000\000\000\004\000\002\000\000\000\000\000\000\000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\128\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\002\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000A\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\016\000\000\000\000\000\000\000\000\000\000\006\000\007\240\006\003\000\007\195\000\000\000 P\192\000\000\000\000 \000\000\016\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000 \001\000\000\000\000\002\000\000\000\000\000\000\000\000\000\128\004\000\000\000\000\b\000\000\001\000\000 `\000\000\002\016`\000\000\000(\000\000\004\000\000\129\128\000\000\bA\128\000\000\000\160\000 \000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\001\000\000\000\000\002\000\b\000\000\000\000\000\000\000\000\004\000\000\000\000\b\000 \000\000\000\000\000\000\000\000\016\000\000\000\000 \000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\003\000\002\004\000\000\024\007(\000\000\000\000\000\000\000\012\000\b\016\000\000`\029\160\000\000\000\002\000\000\000\128\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000 \000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000 \000\001\000\000\000\000\000\024\004H\000\000\000\000\128\000\000\012\000\000\000\000\000`\017 \000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\128\000\000\000\001\000\000\000\000\000\016\004H\000\002\b\000\128\000\000\000\000\000\000\000\000@\000 \000\000\000\000\002\000\000P\000\000\000\000\001\000D\128\000 \128\b\000\000\000\000\000\000\000\000\004\000\002\000\000\000\128\000 \000\005\000\000\000\000\000\016\004H\000\002\b\000\136\000\000\000\000\000\000\000\000@\000 \000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000 \000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\004\000\000\001\128\000\000\b@\128\000\000\000\160\000\000\016\000\000\006\000\000\000!\006\000\000\000\002\128\000\0026\168\000\004\192\135\141o\224\b<\128(\002\028\000\194\000\129\000\000F\001\218\000\000\002\000\160\000\000\002\000\000\004\004\000 \000\000\000\000\000\000\000\000\000\000\000\000\016\016\000\128\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\004\000\000\000\000\b\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\b\000@\000\000\000\000\128\000\000\012 \b\016\000\004`\029\160\000\000 \002\000\000\0002\b \000@\019\128N\224\000\r\000\b\002\b\000\200 \128\001\000\014\001;\128\0004\002 \b \001\000\000\000\000\000\b\000\000\000\000\000\b\000\000\000\133\138\000\0010!\227[\248\002\015 \"\000\135\000\000\000\000\000\000\000\128\004\000\000\000\000\b\000\000\000\192\000\000\000\000\006\001\018\000\000\000\000 \000\000\005\000\000\000\000\000\016\004H\000\002\b\000\128\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000:\136 \000@\019\128N\224\000\r\000\b\002\b\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000!b\128\000L\bx\214\254\000\131\200\000\128!\192\133\138\000\0010!\227[\248\002\015 \002\000\135\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000 \000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\012\130\b\000\016\000\224\019\184\000\003@\"\000\130\0000\000 @\000\001\128v\128\000\000\000\b\000(\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\004\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000 \000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\016\000\000\000\000\001\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\018\b\000\004\000\129\141k\160\000\012\000\000\002\b\000\000\000\000\000\000\000\000\016\000\000\000\000 \000\128\000\000\000\000\000\000\000\000@\000\000\000\000\128\002\000\000\000\000\000\000\000\000\001\000\000\000\000\002\000\b\000\000\000\000\000\000\000\000\004\000\000\000\000\b\000\001\000\000\000\000\000\000\000\000\016\000\000\000\000 \000\004\000\000\000\000\000\000\000\000@\000\000\000\000\128\000\016\000\000\000\000\000\000\000\001\000\000\000\000\002\000\000@\000\000\000\000\000\000\000\004\000\000\000\000\b\000\001\000\000\000\000\000\000\000\000\016\000\000\000\000 \000\004\000\000\000\000\000\000\004\000@\000\000\000\000\128\000\000\012\130\b\000\016\000\224\019\184\000\003@\002\000\130\000\000\000\000\000\000\000@\004\000\000\000\000\b\000\000\000@\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\128:\136 \000@\019\128N\224\000\r\000\b\002\b\bX\160\000\019\002\0305\191\128 \242\000!(p#j\128\000L\bx\214\254\000\131\200\000\128!\192\000\000\000\000\000\000@\b`\000\000\000\000\000\000\000\016\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000@\000\000\000\000\002\000\000\000\004\000\000\000\000\000\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002@\000\000\000\000\000\000\000\000\000\000\000 \000\000\128\000\002\000\000\000\000\000\000\000\000\000\000\000\000\0004\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\b\000\000\000\b\016@\132\000 \003\b\b\004\000\bx\160\000\019\162_7\191\128\160\254  \024p\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\192\000\000\000\000\000\000\000\000\000\000\001\000\000\128\000\000\000\000\b\000\000\000\000\000\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000H\000\000\000\000\004\000\b\000\000\016\000\000@\000\001 \000\000\000\000\016\000 \000\000@\000\001\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\002\022(\000\004\192\135\141o\224\b<\128\b\002\028\bX\160\000\019\002\0305\191\128 \242\000 \bp!b\128\000L\bx\214\254\000\131\200\b\128!\192\133\138\000\0010!\227[\248\002\015 \002\000\135\000 \000\000\000\000\001\128\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\001 \128\000\000\000\024\000\002\000\000@\000\000\000\000\b\000\000\016\016\000\128\000\000\000\000\000\000\000\000\002\030( \004\232\151\205\239\224(?\136\b\006\028\bx\160\128\019\162_7\191\128\160\254  \024p\000\000\000\000\000\000\000\000\b\000\000\004\000\000\000\000\000\000\000\000\000\000\000\000 \000\000\b\000\000\000\000\000\000\000\000\000\000\000\000\128\000\000 \000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\128\000\000\000\001\000\000\000\000\000\024\000\000\000\000\000\000\000\000\000\004\128\000\000\000\000@\000\128\000\001\000\000\004\000\000\018\000\000\000\000\001\000\006\000\000\004\000\b\016 \000\000\000\000`\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\b\000\000\000\000\000@\000\000\000\000\000\000\000\000\000\000@\000\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\000\000@\000\000\000\000\160\002\016\004\128\000\000\000\000@\001\128\000\001\000\002\004\b\000\018\000\000\000\000\001\000\006\000\000\004\000\b\016\000\000\194\000\129\000\000\006\001\218\000\000\002\000 \000\000\000\000\000\000\000\000\016\000\b\000\000\000\000\000\000\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\0000\128 @\000\001\128v\128\000\000\128\b\000\000\000H\000\000\000\000\004\000\b\000\000\016\000\000\000\000\000\000\128\000\000\000\000\000\002\000\000\128\000\000 \000\004\000\000\000\000\000 \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\b\004\000\002\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\000\000\000\000\000\012 \b\016\000\000`\029\160\000\000 \002\000\000\000\016\000\000\000\000\001\128\000\128\000\000\000\000\000\000\001\000\000\000`\000\000\002\016 \000\000\000(\000\000\004\000\000\129\128\000\000\b@\128\000\000\000\160\000\000\016\000\002\006\000\000\000!\002\000\000\000\002\128\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\001\000\000\000\000\000\b\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \017 \000\000\000\002\000\000\000@\000\000\024\000\000\000\132\024\000\000\000\n\000\000\001@\000 `\000\007\003\018`\000\130\000(\016\b\001\000\000\000\000\000\024\004H\000\002\b\000\128@\000\000\000\000\000\000\000\000\001\000\000\000\000\002\001\000\000\128\000\000\000\000\000\128\000\000\000\000\000\000\000\000\002\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\b\000\000\002\000\000\128\000\004\000\000\000\000\000`\017 \000\000\000\002\000\000\000\000\000\000\000\000\000\000\000\128\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\002\003\000\002\004\000\000\b\007(\000\000\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\002\000\b\000\000\000\000\000\000\000\000\004\000\000\000\000\b\000 \000H\000\000\000\000\004\000\024\000\000\016\000 @\128\001 \000\000\000\000\016\000`\000\000@\000\129\002\000\000\000\000\000\000\000\000\001\000\000\000\000\002\000\000\007\223q\002\b\031\176\192\000X8\247\007\022\005\007\000\194\000\129\000\000\002\001\202\000\000\002\000\000\000\000\000\000\000\000\000\000\016\000\000\000\000\000\000\000\000\000\012 \b\016\000\004`\029\160\000\000 \002\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\b\000\001\000\000\000\000\000\000\000\000\016\000\000\000\000 \000\004\000\000\000\000\000\000\000\000@\000\000\000\000\128\000\016\000\000\000\000\000\000\000\001\000\000\000\000\002\000\000@\000\000\000\000\000\000\000\004\000\000\000\000\b\000\001\000\000\000\000\000\000\000\000\016\000\000\000\000 \000\004\000\000\000\000\012\000\000\000\000\000\000\000\000\000\000\000\004\000\000\000\000\000 \000\000\000\000\000 \000\000\000")
    
  end) (ET) (TI)
  
end

let use_file =
  fun lexer lexbuf ->
    (Obj.magic (MenhirInterpreter.entry 2349 lexer lexbuf) : (
# 1329 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list)
# 64066 "src/reason-parser/reason_parser.ml"
    ))

and toplevel_phrase =
  fun lexer lexbuf ->
    (Obj.magic (MenhirInterpreter.entry 2332 lexer lexbuf) : (
# 1327 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase)
# 64074 "src/reason-parser/reason_parser.ml"
    ))

and parse_pattern =
  fun lexer lexbuf ->
    (Obj.magic (MenhirInterpreter.entry 2328 lexer lexbuf) : (
# 1335 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.pattern)
# 64082 "src/reason-parser/reason_parser.ml"
    ))

and parse_expression =
  fun lexer lexbuf ->
    (Obj.magic (MenhirInterpreter.entry 2324 lexer lexbuf) : (
# 1333 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.expression)
# 64090 "src/reason-parser/reason_parser.ml"
    ))

and parse_core_type =
  fun lexer lexbuf ->
    (Obj.magic (MenhirInterpreter.entry 2320 lexer lexbuf) : (
# 1331 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.core_type)
# 64098 "src/reason-parser/reason_parser.ml"
    ))

and interface =
  fun lexer lexbuf ->
    (Obj.magic (MenhirInterpreter.entry 2316 lexer lexbuf) : (
# 1325 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.signature)
# 64106 "src/reason-parser/reason_parser.ml"
    ))

and implementation =
  fun lexer lexbuf ->
    (Obj.magic (MenhirInterpreter.entry 0 lexer lexbuf) : (
# 1323 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.structure)
# 64114 "src/reason-parser/reason_parser.ml"
    ))

module Incremental = struct
  
  let use_file =
    fun initial_position ->
      (Obj.magic (MenhirInterpreter.start 2349 initial_position) : (
# 1329 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase list)
# 64124 "src/reason-parser/reason_parser.ml"
      ) MenhirInterpreter.checkpoint)
  
  and toplevel_phrase =
    fun initial_position ->
      (Obj.magic (MenhirInterpreter.start 2332 initial_position) : (
# 1327 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.toplevel_phrase)
# 64132 "src/reason-parser/reason_parser.ml"
      ) MenhirInterpreter.checkpoint)
  
  and parse_pattern =
    fun initial_position ->
      (Obj.magic (MenhirInterpreter.start 2328 initial_position) : (
# 1335 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.pattern)
# 64140 "src/reason-parser/reason_parser.ml"
      ) MenhirInterpreter.checkpoint)
  
  and parse_expression =
    fun initial_position ->
      (Obj.magic (MenhirInterpreter.start 2324 initial_position) : (
# 1333 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.expression)
# 64148 "src/reason-parser/reason_parser.ml"
      ) MenhirInterpreter.checkpoint)
  
  and parse_core_type =
    fun initial_position ->
      (Obj.magic (MenhirInterpreter.start 2320 initial_position) : (
# 1331 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.core_type)
# 64156 "src/reason-parser/reason_parser.ml"
      ) MenhirInterpreter.checkpoint)
  
  and interface =
    fun initial_position ->
      (Obj.magic (MenhirInterpreter.start 2316 initial_position) : (
# 1325 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.signature)
# 64164 "src/reason-parser/reason_parser.ml"
      ) MenhirInterpreter.checkpoint)
  
  and implementation =
    fun initial_position ->
      (Obj.magic (MenhirInterpreter.start 0 initial_position) : (
# 1323 "src/reason-parser/reason_parser.mly"
      (Migrate_parsetree.Ast_404.Parsetree.structure)
# 64172 "src/reason-parser/reason_parser.ml"
      ) MenhirInterpreter.checkpoint)
  
end

# 4853 "src/reason-parser/reason_parser.mly"
  

# 64180 "src/reason-parser/reason_parser.ml"

# 269 "<standard.mly>"
  

# 64185 "src/reason-parser/reason_parser.ml"

end
module Reason_declarative_lexer
= struct
#1 "reason_declarative_lexer.ml"
# 68 "src/reason-parser/reason_declarative_lexer.mll"
 
open Lexing
open Reason_parser
open Reason_errors

(* The table of keywords *)

let keyword_table, reverse_keyword_table =
  let create_hashtable n l =
    let t = Hashtbl.create n in
    let rev_t = Hashtbl.create n in
    List.iter (fun (k, v) ->
      Hashtbl.add t k v;
      Hashtbl.add rev_t v k;
    ) l;
    t, rev_t
  in
  create_hashtable 149 [
    "and", AND;
    "as", AS;
    "assert", ASSERT;
    "begin", BEGIN;
    "class", CLASS;
    "constraint", CONSTRAINT;
    "do", DO;
    "done", DONE;
    "downto", DOWNTO;
    "else", ELSE;
    "end", END;
    "exception", EXCEPTION;
    "external", EXTERNAL;
    "false", FALSE;
    "for", FOR;
    "fun", FUN;
    "esfun", ES6_FUN;
    "function", FUNCTION;
    "functor", FUNCTOR;
    "if", IF;
    "in", IN;
    "include", INCLUDE;
    "inherit", INHERIT;
    "initializer", INITIALIZER;
    "lazy", LAZY;
    "let", LET;
    "switch", SWITCH;
    "module", MODULE;
    "pub", PUB;
    "mutable", MUTABLE;
    "new", NEW;
    "nonrec", NONREC;
    "object", OBJECT;
    "of", OF;
    "open", OPEN;
    "or", OR;
(*  "parser", PARSER; *)
    "pri", PRI;
    "rec", REC;
    "sig", SIG;
    "struct", STRUCT;
    "then", THEN;
    "to", TO;
    "true", TRUE;
    "try", TRY;
    "type", TYPE;
    "val", VAL;
    "virtual", VIRTUAL;
    "when", WHEN;
    "while", WHILE;
    "with", WITH;

    "mod", INFIXOP3("mod");
    "land", INFIXOP3("land");
    "lor", INFIXOP3("lor");
    "lxor", INFIXOP3("lxor");
    "lsl", INFIXOP4("lsl");
    "lsr", INFIXOP4("lsr");
    "asr", INFIXOP4("asr")
]

(* The only internal state of the lexer is two scratch buffers.
   They could be allocated everytime they are needed, but
   for better performance (FIXME: does this really matter?)
   they are preallocated.*)

type state = {
  raw_buffer : Buffer.t;
  txt_buffer : Buffer.t;
}

let get_scratch_buffers { raw_buffer; txt_buffer } =
  Buffer.reset raw_buffer;
  Buffer.reset txt_buffer;
  ( raw_buffer, txt_buffer )

let flush_buffer buffer =
  let result = Buffer.contents buffer in
  Buffer.reset buffer;
  result

let make () = {
  raw_buffer = Buffer.create 255;
  txt_buffer = Buffer.create 255;
}

(* Specialize raise_error for lexing errors *)

let raise_error loc error = raise_error (Lexing_error error) loc

let store_lexeme buffer lexbuf =
  Buffer.add_string buffer (Lexing.lexeme lexbuf)

(* To "unlex" a few characters *)
let set_lexeme_length buf n = (
  let open Lexing in
  if n < 0 then
    invalid_arg "set_lexeme_length: offset should be positive";
  if n > buf.lex_curr_pos - buf.lex_start_pos then
    invalid_arg "set_lexeme_length: offset larger than lexeme";
  buf.lex_curr_pos <- buf.lex_start_pos + n;
  buf.lex_curr_p <- {buf.lex_start_p
                     with pos_cnum = buf.lex_abs_pos + buf.lex_curr_pos};
)

(* This cut comment characters of the current buffer.
 * Operators (including "/*" and "//") are lexed with the same rule, and this
 * function cuts the lexeme at the beginning of an operator. *)
let lexeme_without_comment buf = (
  let lexeme = Lexing.lexeme buf in
  let i = ref 0 and len = String.length lexeme - 1 in
  let found = ref (-1) in
  while !i < len && !found = -1 do
    begin match lexeme.[!i], lexeme.[!i+1] with
      | ('/', '*') | ('/', '/') | ('*', '/') ->
        found := !i;
      | _ -> ()
    end;
    incr i
  done;
  match !found with
  | -1 -> lexeme
  | n ->
      set_lexeme_length buf n;
      String.sub lexeme 0 n
)

(* Operators that could conflict with comments (those containing /*, */ and //)
 * are escaped in the source. The lexer removes the escapes so that the
 * identifier looks like OCaml ones.
 * An escape in first position is kept to distinguish "verbatim" operators
 * (\=== for instance). *)
let unescape_operator str =
  if (str <> "" && String.contains_from str 1 '\\') then (
    let b = Buffer.create (String.length str) in
    Buffer.add_char b str.[0];
    for i = 1 to String.length str - 1 do
      let c = str.[i] in
      if c <> '\\' then Buffer.add_char b c
    done;
    Buffer.contents b
  ) else str

let lexeme_operator lexbuf =
  unescape_operator (lexeme_without_comment lexbuf)

(* To translate escape sequences *)

let char_for_backslash = function
  | 'n' -> '\010'
  | 'r' -> '\013'
  | 'b' -> '\008'
  | 't' -> '\009'
  | c   -> c

let char_for_decimal_code lexbuf i =
  let c = 100 * (Char.code(Lexing.lexeme_char lexbuf i) - 48) +
           10 * (Char.code(Lexing.lexeme_char lexbuf (i+1)) - 48) +
                (Char.code(Lexing.lexeme_char lexbuf (i+2)) - 48) in
  if (c < 0 || c > 255) then (
    raise_error
        (Location.curr lexbuf)
        (Illegal_escape (Lexing.lexeme lexbuf));
    'x'
  ) else Char.chr c

let char_for_hexadecimal_code lexbuf i =
  let d1 = Char.code (Lexing.lexeme_char lexbuf i) in
  let val1 = if d1 >= 97 then d1 - 87
             else if d1 >= 65 then d1 - 55
             else d1 - 48
  in
  let d2 = Char.code (Lexing.lexeme_char lexbuf (i+1)) in
  let val2 = if d2 >= 97 then d2 - 87
             else if d2 >= 65 then d2 - 55
             else d2 - 48
  in
  Char.chr (val1 * 16 + val2)

(* To convert integer literals, allowing max_int + 1 (PR#4210) *)

let cvt_int_literal s =
  - int_of_string ("-" ^ s)
let cvt_int32_literal s =
  Int32.neg (Int32.of_string ("-" ^ String.sub s 0 (String.length s - 1)))
let cvt_int64_literal s =
  Int64.neg (Int64.of_string ("-" ^ String.sub s 0 (String.length s - 1)))
let cvt_nativeint_literal s =
  Nativeint.neg (Nativeint.of_string ("-" ^ String.sub s 0
                                                       (String.length s - 1)))

(* Remove underscores from float literals *)

let remove_underscores s =
  let l = String.length s in
  let b = Bytes.create l in
  let rec remove src dst =
    if src >= l then
      if dst >= l then s else Bytes.sub_string b 0 dst
    else
      match s.[src] with
        '_' -> remove (src + 1) dst
      |  c  -> Bytes.set b dst c; remove (src + 1) (dst + 1)
  in remove 0 0

(* Update the current location with file name and line number. *)

let update_loc lexbuf file line absolute chars =
  let pos = lexbuf.lex_curr_p in
  let new_file = match file with
                 | None -> pos.pos_fname
                 | Some s -> s
  in
  lexbuf.lex_curr_p <- { pos with
    pos_fname = new_file;
    pos_lnum = if absolute then line else pos.pos_lnum + line;
    pos_bol = pos.pos_cnum - chars;
  }


# 241 "src/reason-parser/reason_declarative_lexer.ml"
let __ocaml_lex_tables = {
  Lexing.lex_base =
   "\000\000\149\255\150\255\224\000\003\001\038\001\073\001\108\001\
    \143\001\178\001\185\255\213\001\192\255\250\001\091\000\063\002\
    \068\000\071\000\084\000\155\002\219\255\190\002\221\255\222\255\
    \224\255\225\002\064\003\012\001\094\003\238\255\178\003\006\004\
    \090\004\042\005\250\005\202\006\169\007\204\007\239\007\013\008\
    \122\000\254\255\001\000\003\009\038\009\073\009\108\009\143\009\
    \178\009\255\255\005\000\213\009\093\000\248\009\027\010\094\000\
    \062\010\095\000\096\000\097\000\006\000\103\000\129\010\221\010\
    \000\011\067\011\151\011\148\004\235\011\063\012\147\012\231\012\
    \059\013\143\013\227\013\055\014\139\014\223\014\051\015\108\000\
    \135\015\219\015\047\016\131\016\215\016\043\017\127\017\211\017\
    \039\018\118\000\123\018\103\005\237\255\062\003\021\000\237\018\
    \065\019\197\255\011\001\194\255\156\019\108\000\109\000\007\000\
    \236\255\235\255\231\255\242\002\128\000\110\000\234\255\011\002\
    \113\000\233\255\069\006\147\000\232\255\060\007\124\006\181\019\
    \216\000\222\019\001\020\227\255\011\000\012\000\008\001\024\001\
    \016\000\227\255\017\000\036\020\071\020\106\020\141\000\212\255\
    \208\255\209\255\210\255\206\255\141\020\176\020\243\020\071\021\
    \155\021\071\008\245\021\052\022\166\022\193\255\015\001\166\022\
    \002\023\151\000\177\255\200\255\201\255\129\000\181\255\175\255\
    \069\023\184\255\161\023\196\023\231\023\005\024\095\024\157\024\
    \187\255\247\024\026\025\061\025\096\025\182\255\163\025\225\025\
    \059\026\094\026\129\026\164\026\199\026\010\001\012\001\234\026\
    \040\001\046\001\013\027\065\001\075\001\248\255\143\000\079\001\
    \081\001\254\000\254\255\255\255\250\255\100\001\251\255\149\000\
    \249\255\040\011\246\255\247\255\018\000\248\255\064\002\011\027\
    \253\255\200\000\223\000\255\255\254\255\252\255\043\027\134\027\
    \234\000\236\000\139\001\251\255\250\255\249\255\030\007\155\002\
    \252\000\081\003\005\001\080\010\014\001\146\001\199\001\247\255\
    \248\255\249\255\147\001\161\027\255\255\250\255\194\020\091\003\
    \253\255\046\001\148\001\164\001\223\004\252\255\020\023\251\255\
    \174\001\234\001\252\255\185\027\254\255\255\255\181\001\182\001\
    \253\255\214\027\033\001\037\001\069\001\079\001\039\001\080\001\
    \056\001\013\000\255\255";
  Lexing.lex_backtrk =
   "\255\255\255\255\255\255\102\000\097\000\096\000\095\000\086\000\
    \081\000\103\000\255\255\066\000\255\255\069\000\052\000\050\000\
    \048\000\044\000\041\000\089\000\255\255\035\000\255\255\255\255\
    \255\255\029\000\040\000\032\000\064\000\255\255\011\000\011\000\
    \010\000\009\000\008\000\007\000\051\000\005\000\004\000\003\000\
    \002\000\255\255\106\000\106\000\103\000\103\000\099\000\255\255\
    \255\255\255\255\255\255\094\000\255\255\084\000\085\000\255\255\
    \101\000\255\255\255\255\255\255\255\255\255\255\095\000\038\000\
    \006\000\095\000\039\000\072\000\015\000\015\000\013\000\012\000\
    \015\000\012\000\012\000\011\000\013\000\012\000\013\000\255\255\
    \013\000\015\000\014\000\014\000\014\000\011\000\011\000\015\000\
    \013\000\255\255\013\000\065\000\255\255\255\255\060\000\059\000\
    \059\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\024\000\024\000\024\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\027\000\
    \255\255\026\000\025\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\030\000\090\000\037\000\042\000\255\255\
    \255\255\255\255\255\255\255\255\095\000\091\000\095\000\056\000\
    \255\255\255\255\092\000\255\255\255\255\255\255\255\255\095\000\
    \093\000\079\000\255\255\255\255\255\255\053\000\255\255\255\255\
    \095\000\255\255\095\000\095\000\057\000\077\000\095\000\076\000\
    \255\255\067\000\100\000\103\000\103\000\255\255\103\000\075\000\
    \082\000\083\000\098\000\088\000\087\000\255\255\255\255\097\000\
    \255\255\255\255\104\000\255\255\255\255\255\255\007\000\007\000\
    \002\000\255\255\255\255\255\255\255\255\003\000\255\255\002\000\
    \255\255\255\255\255\255\255\255\009\000\255\255\009\000\009\000\
    \255\255\009\000\009\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\008\000\008\000\255\255\255\255\005\000\005\000\
    \255\255\001\000\005\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\003\000\255\255\255\255\003\000\255\255\
    \255\255\255\255\002\000\255\255\255\255\001\000\255\255\255\255\
    \255\255\255\255\255\255";
  Lexing.lex_default =
   "\001\000\000\000\000\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\000\000\255\255\000\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\000\000\255\255\000\000\000\000\
    \000\000\255\255\255\255\101\000\255\255\000\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\000\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\000\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\000\000\255\255\255\255\255\255\
    \255\255\000\000\255\255\000\000\106\000\255\255\255\255\255\255\
    \000\000\000\000\000\000\255\255\255\255\255\255\000\000\255\255\
    \255\255\000\000\255\255\255\255\000\000\125\000\255\255\255\255\
    \255\255\255\255\255\255\000\000\255\255\125\000\126\000\125\000\
    \128\000\000\000\255\255\255\255\255\255\255\255\255\255\000\000\
    \000\000\000\000\000\000\000\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\000\000\255\255\255\255\
    \255\255\255\255\000\000\000\000\000\000\255\255\000\000\000\000\
    \255\255\000\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \000\000\255\255\255\255\255\255\255\255\000\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\189\000\000\000\255\255\255\255\
    \255\255\193\000\000\000\000\000\000\000\255\255\000\000\255\255\
    \000\000\202\000\000\000\000\000\255\255\000\000\216\000\255\255\
    \000\000\255\255\255\255\000\000\000\000\000\000\255\255\255\255\
    \255\255\255\255\255\255\000\000\000\000\000\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\231\000\000\000\
    \000\000\000\000\255\255\237\000\000\000\000\000\255\255\255\255\
    \000\000\255\255\255\255\255\255\255\255\000\000\255\255\000\000\
    \255\255\250\000\000\000\255\255\000\000\000\000\255\255\255\255\
    \000\000\255\255\255\255\255\255\004\001\007\001\255\255\007\001\
    \255\255\255\255\000\000";
  Lexing.lex_trans =
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\040\000\041\000\041\000\040\000\042\000\060\000\049\000\
    \041\000\102\000\050\000\060\000\103\000\123\000\123\000\010\001\
    \124\000\124\000\129\000\129\000\203\000\130\000\130\000\229\000\
    \040\000\008\000\029\000\026\000\006\000\003\000\025\000\027\000\
    \023\000\022\000\021\000\007\000\020\000\019\000\018\000\009\000\
    \031\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\017\000\016\000\015\000\036\000\013\000\037\000\
    \005\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\014\000\043\000\012\000\004\000\039\000\
    \024\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\028\000\011\000\010\000\038\000\139\000\
    \153\000\138\000\134\000\040\000\137\000\136\000\040\000\051\000\
    \046\000\056\000\056\000\044\000\051\000\046\000\044\000\056\000\
    \044\000\006\000\099\000\105\000\104\000\110\000\006\000\156\000\
    \113\000\155\000\040\000\154\000\080\000\080\000\080\000\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\088\000\088\000\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \111\000\111\000\111\000\111\000\111\000\111\000\111\000\111\000\
    \111\000\111\000\116\000\135\000\159\000\158\000\200\000\199\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\157\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\212\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \002\000\186\000\119\000\186\000\186\000\186\000\186\000\119\000\
    \195\000\211\000\186\000\186\000\255\255\186\000\186\000\186\000\
    \255\255\221\000\123\000\220\000\098\000\124\000\102\000\098\000\
    \150\000\103\000\186\000\150\000\186\000\186\000\186\000\186\000\
    \186\000\127\000\123\000\221\000\183\000\124\000\183\000\183\000\
    \183\000\183\000\128\000\098\000\221\000\183\000\183\000\150\000\
    \183\000\183\000\183\000\255\255\178\000\221\000\005\000\241\000\
    \127\000\178\000\126\000\005\000\187\000\183\000\186\000\183\000\
    \183\000\183\000\183\000\183\000\003\001\097\000\004\001\005\000\
    \008\001\005\000\005\000\005\000\005\000\149\000\241\000\005\001\
    \005\000\005\000\183\000\005\000\005\000\005\000\183\000\183\000\
    \183\000\006\001\006\001\009\001\186\000\183\000\186\000\184\000\
    \005\000\183\000\005\000\005\000\005\000\005\000\005\000\000\000\
    \100\000\000\000\006\000\186\000\006\000\006\000\006\000\006\000\
    \186\000\000\000\000\000\006\000\006\000\190\000\006\000\006\000\
    \006\000\192\000\191\000\197\000\000\000\000\000\193\000\183\000\
    \196\000\183\000\182\000\006\000\005\000\006\000\006\000\006\000\
    \006\000\006\000\000\000\000\000\000\000\046\000\199\000\046\000\
    \046\000\046\000\046\000\198\000\000\000\217\000\046\000\178\000\
    \218\000\046\000\180\000\046\000\203\000\233\000\241\000\229\000\
    \248\000\243\000\005\000\000\000\005\000\061\000\046\000\006\000\
    \046\000\179\000\046\000\046\000\046\000\000\000\241\000\000\000\
    \051\000\243\000\051\000\051\000\051\000\051\000\000\000\000\000\
    \233\000\051\000\051\000\248\000\051\000\051\000\051\000\253\000\
    \253\000\000\000\255\000\255\000\000\000\006\000\000\000\006\000\
    \055\000\051\000\046\000\051\000\176\000\051\000\051\000\051\000\
    \000\000\233\000\000\000\044\000\234\000\044\000\044\000\044\000\
    \044\000\000\000\000\000\000\000\044\000\044\000\000\000\044\000\
    \044\000\044\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \046\000\236\000\046\000\052\000\044\000\051\000\044\000\044\000\
    \170\000\044\000\044\000\000\000\253\000\000\000\006\000\254\000\
    \006\000\006\000\006\000\006\000\000\000\000\000\194\000\006\000\
    \006\000\000\000\006\000\006\000\006\000\000\000\000\000\000\000\
    \255\255\000\000\000\000\051\000\255\255\051\000\059\000\006\000\
    \044\000\006\000\006\000\006\000\006\000\006\000\000\000\000\000\
    \255\255\000\000\000\000\006\000\000\000\006\000\006\000\006\000\
    \006\000\000\000\000\000\235\000\006\000\006\000\000\000\006\000\
    \162\000\006\000\000\000\000\000\000\000\000\000\044\000\000\000\
    \044\000\061\000\168\000\006\000\006\000\000\000\160\000\006\000\
    \006\000\006\000\006\000\112\000\112\000\112\000\112\000\112\000\
    \112\000\112\000\112\000\112\000\112\000\255\255\000\000\000\000\
    \000\000\000\000\217\000\255\255\000\000\218\000\000\000\255\255\
    \255\255\169\000\000\000\006\000\000\000\000\000\061\000\000\000\
    \006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \006\000\000\000\006\000\006\000\006\000\006\000\251\000\219\000\
    \000\000\006\000\006\000\000\000\006\000\140\000\142\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\006\000\161\000\
    \006\000\006\000\000\000\006\000\006\000\141\000\006\000\006\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\000\000\061\000\215\000\006\000\143\000\000\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\000\000\006\000\046\000\006\000\046\000\046\000\
    \046\000\046\000\000\000\000\000\000\000\046\000\046\000\232\000\
    \046\000\132\000\046\000\225\000\225\000\225\000\225\000\225\000\
    \225\000\225\000\225\000\225\000\225\000\046\000\000\000\046\000\
    \046\000\133\000\046\000\046\000\000\000\000\000\000\000\044\000\
    \000\000\044\000\044\000\044\000\044\000\000\000\000\000\000\000\
    \056\000\044\000\252\000\044\000\044\000\044\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\055\000\
    \044\000\046\000\044\000\044\000\044\000\044\000\044\000\000\000\
    \000\000\000\000\006\000\000\000\006\000\006\000\006\000\131\000\
    \000\000\000\000\000\000\006\000\006\000\000\000\006\000\006\000\
    \006\000\000\000\000\000\000\000\000\000\000\000\000\000\046\000\
    \000\000\046\000\057\000\006\000\044\000\006\000\006\000\006\000\
    \006\000\006\000\114\000\114\000\114\000\114\000\114\000\114\000\
    \114\000\114\000\114\000\114\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\114\000\114\000\114\000\114\000\114\000\
    \114\000\000\000\044\000\000\000\044\000\061\000\000\000\006\000\
    \255\255\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\118\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\114\000\114\000\114\000\114\000\114\000\
    \114\000\000\000\000\000\000\000\000\000\006\000\000\000\006\000\
    \118\000\119\000\000\000\119\000\119\000\119\000\119\000\000\000\
    \000\000\000\000\119\000\119\000\000\000\119\000\119\000\119\000\
    \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
    \117\000\117\000\119\000\000\000\119\000\121\000\119\000\119\000\
    \119\000\226\000\226\000\226\000\226\000\226\000\226\000\226\000\
    \226\000\226\000\226\000\244\000\244\000\244\000\244\000\244\000\
    \244\000\244\000\244\000\244\000\244\000\000\000\000\000\000\000\
    \000\000\000\000\091\000\000\000\120\000\093\000\119\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\000\000\092\000\000\000\119\000\093\000\119\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\068\000\092\000\000\000\000\000\000\000\000\000\000\000\
    \070\000\000\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\068\000\068\000\068\000\068\000\069\000\
    \068\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\000\000\000\000\000\000\
    \000\000\030\000\000\000\068\000\068\000\068\000\068\000\069\000\
    \068\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\068\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\070\000\000\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\068\000\
    \072\000\068\000\068\000\069\000\068\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\073\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\074\000\071\000\
    \071\000\000\000\000\000\000\000\000\000\030\000\000\000\068\000\
    \072\000\068\000\068\000\069\000\068\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\073\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\074\000\071\000\
    \071\000\032\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\000\000\000\000\000\000\
    \000\000\032\000\000\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\000\000\
    \000\000\000\000\000\000\067\000\000\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\245\000\
    \245\000\245\000\245\000\245\000\245\000\245\000\245\000\245\000\
    \245\000\000\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\000\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\033\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\000\000\000\000\000\000\
    \000\000\033\000\000\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\094\000\000\000\000\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\000\000\000\000\000\000\000\000\095\000\000\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\000\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\034\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\000\000\000\000\000\000\
    \000\000\034\000\000\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\115\000\115\000\115\000\
    \115\000\115\000\115\000\115\000\115\000\115\000\115\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\118\000\115\000\115\000\
    \115\000\115\000\115\000\115\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\118\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\115\000\115\000\
    \115\000\115\000\115\000\115\000\117\000\117\000\117\000\117\000\
    \117\000\117\000\117\000\117\000\117\000\117\000\000\000\000\000\
    \000\000\000\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\000\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\035\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\000\000\000\000\000\000\
    \000\000\035\000\000\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\127\000\123\000\000\000\
    \000\000\124\000\000\000\000\000\000\000\000\000\227\000\227\000\
    \227\000\227\000\227\000\227\000\227\000\227\000\227\000\227\000\
    \000\000\000\000\000\000\000\000\127\000\000\000\126\000\227\000\
    \227\000\227\000\227\000\227\000\227\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\117\000\117\000\117\000\117\000\
    \117\000\117\000\117\000\117\000\117\000\117\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\227\000\
    \227\000\227\000\227\000\227\000\227\000\000\000\000\000\000\000\
    \000\000\000\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\000\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\000\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\006\000\000\000\006\000\006\000\006\000\006\000\
    \000\000\000\000\000\000\006\000\006\000\000\000\006\000\006\000\
    \006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\006\000\000\000\062\000\006\000\063\000\
    \064\000\006\000\000\000\000\000\000\000\051\000\000\000\051\000\
    \051\000\051\000\051\000\000\000\000\000\000\000\051\000\051\000\
    \000\000\051\000\051\000\051\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\061\000\051\000\006\000\
    \051\000\051\000\051\000\051\000\051\000\000\000\000\000\000\000\
    \051\000\000\000\051\000\051\000\051\000\051\000\000\000\000\000\
    \000\000\051\000\051\000\000\000\051\000\051\000\051\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\006\000\000\000\006\000\
    \052\000\051\000\051\000\051\000\051\000\051\000\051\000\051\000\
    \000\000\000\000\000\000\000\000\035\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\255\255\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\000\000\
    \051\000\000\000\051\000\052\000\000\000\051\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \000\000\000\000\000\000\051\000\035\000\051\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\000\000\000\000\000\000\000\000\143\000\000\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\000\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\000\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\049\000\000\000\000\000\
    \050\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\048\000\000\000\000\000\006\000\
    \000\000\006\000\000\000\000\000\000\000\045\000\046\000\000\000\
    \046\000\000\000\044\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\000\
    \006\000\006\000\047\000\005\000\000\000\000\000\000\000\044\000\
    \000\000\044\000\044\000\044\000\044\000\000\000\000\000\000\000\
    \044\000\044\000\000\000\044\000\044\000\044\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \044\000\004\000\044\000\044\000\044\000\044\000\044\000\000\000\
    \000\000\000\000\044\000\000\000\044\000\044\000\044\000\044\000\
    \000\000\000\000\000\000\056\000\044\000\000\000\044\000\044\000\
    \044\000\000\000\000\000\000\000\000\000\000\000\000\000\006\000\
    \000\000\047\000\059\000\044\000\044\000\044\000\044\000\044\000\
    \044\000\044\000\000\000\000\000\000\000\046\000\000\000\046\000\
    \046\000\046\000\046\000\000\000\000\000\000\000\046\000\046\000\
    \000\000\046\000\046\000\046\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\044\000\000\000\044\000\057\000\046\000\044\000\
    \046\000\046\000\046\000\046\000\046\000\000\000\000\000\000\000\
    \051\000\000\000\051\000\051\000\051\000\051\000\000\000\000\000\
    \000\000\051\000\051\000\000\000\051\000\051\000\051\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\044\000\000\000\044\000\
    \055\000\051\000\046\000\051\000\051\000\051\000\051\000\051\000\
    \000\000\000\000\000\000\051\000\000\000\051\000\051\000\051\000\
    \051\000\000\000\000\000\000\000\051\000\051\000\000\000\051\000\
    \051\000\051\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \046\000\000\000\046\000\052\000\051\000\051\000\051\000\053\000\
    \051\000\051\000\051\000\000\000\000\000\000\000\051\000\000\000\
    \051\000\051\000\051\000\051\000\000\000\000\000\000\000\051\000\
    \051\000\000\000\051\000\051\000\051\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\051\000\000\000\051\000\052\000\051\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\000\000\000\000\
    \000\000\051\000\000\000\051\000\051\000\051\000\051\000\000\000\
    \000\000\000\000\051\000\051\000\000\000\051\000\051\000\051\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\051\000\000\000\
    \051\000\052\000\051\000\051\000\051\000\054\000\051\000\051\000\
    \051\000\000\000\000\000\000\000\051\000\000\000\051\000\051\000\
    \051\000\051\000\000\000\000\000\000\000\051\000\051\000\000\000\
    \051\000\051\000\051\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\051\000\000\000\051\000\052\000\051\000\051\000\051\000\
    \051\000\051\000\051\000\051\000\000\000\000\000\000\000\056\000\
    \000\000\056\000\056\000\056\000\056\000\000\000\000\000\000\000\
    \056\000\056\000\000\000\056\000\056\000\056\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\051\000\000\000\051\000\052\000\
    \056\000\051\000\056\000\056\000\056\000\056\000\056\000\000\000\
    \228\000\228\000\228\000\228\000\228\000\228\000\228\000\228\000\
    \228\000\228\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\228\000\228\000\228\000\228\000\228\000\228\000\051\000\
    \000\000\051\000\058\000\000\000\056\000\000\000\000\000\000\000\
    \000\000\000\000\006\000\000\000\006\000\006\000\006\000\006\000\
    \000\000\000\000\000\000\006\000\006\000\000\000\006\000\006\000\
    \006\000\228\000\228\000\228\000\228\000\228\000\228\000\000\000\
    \000\000\000\000\056\000\006\000\056\000\006\000\006\000\006\000\
    \006\000\006\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\000\000\061\000\000\000\006\000\
    \067\000\000\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\000\000\006\000\006\000\006\000\
    \006\000\006\000\006\000\006\000\000\000\000\000\000\000\006\000\
    \006\000\000\000\006\000\006\000\006\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\000\
    \000\000\065\000\006\000\006\000\006\000\006\000\000\000\000\000\
    \000\000\006\000\000\000\006\000\006\000\006\000\006\000\000\000\
    \000\000\000\000\006\000\006\000\000\000\006\000\006\000\006\000\
    \000\000\000\000\203\000\000\000\000\000\204\000\000\000\000\000\
    \000\000\061\000\006\000\006\000\006\000\006\000\006\000\006\000\
    \006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\208\000\000\000\000\000\000\000\000\000\206\000\
    \000\000\000\000\209\000\000\000\000\000\000\000\000\000\210\000\
    \000\000\006\000\000\000\006\000\061\000\000\000\006\000\000\000\
    \000\000\000\000\000\000\000\000\006\000\000\000\006\000\006\000\
    \006\000\006\000\000\000\000\000\000\000\006\000\006\000\000\000\
    \006\000\006\000\006\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\006\000\006\000\006\000\006\000\
    \006\000\006\000\006\000\006\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\000\000\061\000\
    \000\000\006\000\066\000\207\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\006\000\
    \000\000\006\000\000\000\000\000\000\000\066\000\000\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\000\000\000\000\000\000\000\000\066\000\000\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\068\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\000\000\000\000\000\000\
    \205\000\000\000\000\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\000\000\000\000\
    \000\000\000\000\068\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\000\000\
    \000\000\000\000\089\000\000\000\089\000\000\000\000\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\090\000\090\000\090\000\
    \090\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\000\000\000\000\000\000\000\000\068\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\081\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\081\000\081\000\081\000\081\000\
    \087\000\081\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\000\000\000\000\
    \000\000\000\000\070\000\000\000\081\000\081\000\081\000\081\000\
    \087\000\081\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\068\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\000\000\000\000\000\000\000\000\068\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\086\000\086\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\000\000\000\000\
    \000\000\000\000\068\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\085\000\068\000\
    \068\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\000\000\000\000\000\000\000\000\068\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\075\000\075\000\075\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\000\000\000\000\
    \000\000\000\000\068\000\000\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\076\000\000\000\075\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\077\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\000\000\000\000\000\000\000\000\075\000\000\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\077\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\081\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\076\000\076\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\076\000\076\000\076\000\076\000\
    \076\000\076\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\084\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\000\000\000\000\
    \000\000\000\000\076\000\000\000\076\000\076\000\076\000\076\000\
    \076\000\076\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\084\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\068\000\000\000\
    \000\000\000\000\079\000\000\000\079\000\000\000\000\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\078\000\078\000\
    \078\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\000\000\000\000\000\000\000\000\068\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\078\000\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\000\000\000\000\
    \000\000\000\000\078\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\081\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\000\000\000\000\000\000\000\000\080\000\000\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\081\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\000\000\000\000\
    \000\000\000\000\081\000\000\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\000\000\000\000\000\000\000\000\081\000\000\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\068\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\000\000\000\000\
    \000\000\000\000\068\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\081\000\000\000\
    \000\000\000\000\079\000\000\000\079\000\000\000\000\000\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\000\000\000\000\000\000\000\000\081\000\000\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\068\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\085\000\085\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\068\000\068\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\000\000\000\000\
    \000\000\000\000\085\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\068\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\086\000\
    \086\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\000\000\000\000\000\000\000\000\086\000\000\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\081\000\000\000\000\000\000\000\089\000\000\000\
    \089\000\000\000\000\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\088\000\088\000\088\000\088\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\000\000\000\000\
    \000\000\000\000\081\000\000\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\088\000\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\000\000\000\000\000\000\000\000\088\000\000\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\068\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\090\000\090\000\090\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\000\000\000\000\
    \000\000\000\000\090\000\000\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\098\000\000\000\
    \000\000\098\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\098\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\095\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\096\000\000\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\097\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \000\000\000\000\000\000\000\000\095\000\000\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \096\000\000\000\000\000\000\000\000\000\000\000\000\000\096\000\
    \000\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\000\000\000\000\000\000\000\000\
    \096\000\000\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\109\000\000\000\109\000\000\000\
    \000\000\000\000\000\000\109\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\108\000\108\000\108\000\108\000\
    \108\000\108\000\108\000\108\000\108\000\108\000\119\000\000\000\
    \119\000\119\000\119\000\119\000\000\000\000\000\000\000\119\000\
    \119\000\000\000\119\000\119\000\119\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\119\000\
    \000\000\119\000\119\000\119\000\119\000\119\000\000\000\000\000\
    \109\000\000\000\000\000\000\000\000\000\000\000\109\000\119\000\
    \000\000\119\000\119\000\119\000\119\000\000\000\000\000\000\000\
    \119\000\119\000\109\000\119\000\119\000\119\000\109\000\000\000\
    \109\000\120\000\000\000\119\000\107\000\000\000\000\000\000\000\
    \119\000\000\000\122\000\119\000\119\000\119\000\119\000\000\000\
    \000\000\000\000\119\000\000\000\119\000\119\000\119\000\119\000\
    \000\000\000\000\000\000\119\000\119\000\000\000\119\000\119\000\
    \119\000\119\000\000\000\119\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\120\000\119\000\119\000\119\000\119\000\119\000\
    \119\000\119\000\000\000\000\000\000\000\006\000\000\000\006\000\
    \006\000\006\000\006\000\000\000\000\000\000\000\006\000\006\000\
    \000\000\006\000\006\000\006\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\119\000\000\000\119\000\120\000\006\000\119\000\
    \006\000\006\000\006\000\006\000\006\000\000\000\000\000\000\000\
    \046\000\000\000\046\000\046\000\046\000\046\000\000\000\000\000\
    \000\000\046\000\046\000\000\000\046\000\046\000\046\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\119\000\000\000\119\000\
    \061\000\046\000\006\000\046\000\046\000\046\000\046\000\046\000\
    \000\000\000\000\000\000\046\000\000\000\046\000\046\000\046\000\
    \046\000\000\000\000\000\000\000\046\000\046\000\000\000\046\000\
    \046\000\046\000\000\000\000\000\255\255\000\000\000\000\000\000\
    \006\000\000\000\006\000\055\000\046\000\046\000\046\000\046\000\
    \046\000\046\000\046\000\000\000\000\000\000\000\006\000\000\000\
    \006\000\006\000\006\000\006\000\000\000\000\000\000\000\006\000\
    \006\000\000\000\006\000\151\000\006\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\046\000\000\000\046\000\055\000\006\000\
    \046\000\006\000\006\000\006\000\006\000\006\000\000\000\000\000\
    \000\000\006\000\000\000\006\000\006\000\006\000\006\000\000\000\
    \000\000\000\000\006\000\006\000\000\000\006\000\006\000\006\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\046\000\000\000\
    \046\000\061\000\006\000\006\000\006\000\006\000\006\000\006\000\
    \006\000\000\000\246\000\246\000\246\000\246\000\246\000\246\000\
    \246\000\246\000\246\000\246\000\148\000\000\000\000\000\148\000\
    \000\000\000\000\000\000\246\000\246\000\246\000\246\000\246\000\
    \246\000\006\000\000\000\006\000\061\000\000\000\006\000\000\000\
    \000\000\000\000\000\000\148\000\006\000\000\000\006\000\006\000\
    \006\000\006\000\000\000\000\000\000\000\006\000\006\000\000\000\
    \006\000\006\000\006\000\246\000\246\000\246\000\246\000\246\000\
    \246\000\000\000\000\000\000\000\006\000\006\000\006\000\006\000\
    \006\000\146\000\006\000\006\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\000\000\061\000\
    \000\000\006\000\147\000\000\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\143\000\006\000\
    \000\000\006\000\000\000\000\000\000\000\000\000\000\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\000\000\000\000\000\000\000\000\143\000\000\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\144\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\145\000\000\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\000\000\000\000\
    \000\000\000\000\144\000\000\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\006\000\000\000\
    \006\000\006\000\006\000\006\000\000\000\000\000\000\000\006\000\
    \006\000\000\000\006\000\006\000\006\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\006\000\
    \000\000\006\000\006\000\006\000\006\000\006\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\150\000\000\000\000\000\
    \150\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\061\000\000\000\006\000\150\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\147\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\147\000\000\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\000\000\000\000\
    \000\000\006\000\149\000\006\000\000\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\000\000\
    \000\000\000\000\000\000\147\000\000\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\148\000\
    \000\000\000\000\148\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\148\000\006\000\
    \000\000\006\000\006\000\006\000\006\000\000\000\000\000\000\000\
    \006\000\006\000\000\000\006\000\006\000\006\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \006\000\000\000\006\000\006\000\152\000\006\000\006\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\000\000\061\000\000\000\006\000\147\000\000\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\000\000\006\000\006\000\006\000\006\000\006\000\006\000\
    \006\000\000\000\000\000\000\000\006\000\006\000\000\000\006\000\
    \006\000\006\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\006\000\000\000\006\000\006\000\
    \006\000\006\000\006\000\000\000\247\000\247\000\247\000\247\000\
    \247\000\247\000\247\000\247\000\247\000\247\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\247\000\247\000\247\000\
    \247\000\247\000\247\000\000\000\000\000\000\000\061\000\000\000\
    \006\000\000\000\000\000\000\000\000\000\000\000\006\000\000\000\
    \006\000\006\000\006\000\006\000\000\000\000\000\000\000\006\000\
    \006\000\000\000\006\000\006\000\166\000\247\000\247\000\247\000\
    \247\000\247\000\247\000\000\000\000\000\000\000\006\000\006\000\
    \006\000\006\000\006\000\006\000\006\000\006\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \000\000\061\000\000\000\006\000\165\000\000\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \000\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
    \000\000\000\000\000\000\006\000\006\000\000\000\006\000\163\000\
    \006\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\006\000\000\000\006\000\006\000\006\000\
    \006\000\006\000\000\000\000\000\000\000\006\000\000\000\006\000\
    \006\000\006\000\006\000\000\000\000\000\000\000\006\000\006\000\
    \000\000\006\000\164\000\006\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\061\000\006\000\006\000\
    \006\000\006\000\006\000\006\000\006\000\000\000\000\000\000\000\
    \006\000\000\000\006\000\006\000\006\000\006\000\000\000\000\000\
    \000\000\006\000\006\000\000\000\006\000\006\000\006\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\006\000\000\000\006\000\
    \061\000\006\000\006\000\006\000\006\000\006\000\006\000\006\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \006\000\000\000\006\000\061\000\000\000\006\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \000\000\000\000\000\000\006\000\165\000\006\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \006\000\000\000\006\000\006\000\006\000\006\000\000\000\000\000\
    \000\000\006\000\006\000\000\000\006\000\006\000\006\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\006\000\000\000\006\000\006\000\006\000\006\000\006\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\000\000\061\000\000\000\006\000\167\000\000\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\000\000\006\000\000\000\006\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \000\000\000\000\000\000\000\000\167\000\000\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \006\000\000\000\006\000\006\000\006\000\006\000\000\000\000\000\
    \000\000\006\000\006\000\000\000\006\000\006\000\006\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\006\000\000\000\006\000\006\000\006\000\006\000\006\000\
    \000\000\000\000\000\000\044\000\000\000\044\000\044\000\044\000\
    \044\000\000\000\000\000\000\000\044\000\044\000\000\000\044\000\
    \044\000\044\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\061\000\044\000\006\000\171\000\044\000\
    \044\000\044\000\044\000\000\000\000\000\000\000\044\000\000\000\
    \044\000\044\000\044\000\044\000\000\000\000\000\000\000\044\000\
    \044\000\000\000\044\000\044\000\174\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\006\000\000\000\006\000\059\000\044\000\
    \044\000\044\000\044\000\044\000\044\000\044\000\000\000\000\000\
    \000\000\044\000\000\000\044\000\044\000\044\000\044\000\000\000\
    \000\000\000\000\044\000\044\000\000\000\044\000\044\000\044\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\172\000\000\000\
    \044\000\059\000\044\000\044\000\044\000\044\000\044\000\044\000\
    \044\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\044\000\000\000\044\000\059\000\173\000\044\000\000\000\
    \000\000\000\000\000\000\000\000\044\000\000\000\044\000\044\000\
    \044\000\044\000\000\000\000\000\000\000\044\000\044\000\000\000\
    \044\000\044\000\044\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\044\000\044\000\044\000\044\000\
    \044\000\044\000\044\000\044\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\000\000\059\000\
    \000\000\044\000\175\000\000\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\000\000\044\000\
    \000\000\044\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\000\000\000\000\000\000\000\000\
    \175\000\000\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\051\000\000\000\051\000\051\000\
    \051\000\051\000\000\000\000\000\000\000\051\000\051\000\000\000\
    \051\000\051\000\051\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\051\000\000\000\051\000\
    \177\000\051\000\051\000\051\000\000\000\000\000\000\000\051\000\
    \000\000\051\000\051\000\051\000\051\000\000\000\000\000\000\000\
    \051\000\051\000\000\000\051\000\051\000\051\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\052\000\
    \051\000\051\000\051\000\051\000\051\000\051\000\051\000\000\000\
    \000\000\000\000\178\000\000\000\178\000\178\000\178\000\178\000\
    \000\000\000\000\000\000\178\000\178\000\000\000\178\000\178\000\
    \178\000\000\000\000\000\000\000\000\000\000\000\000\000\051\000\
    \000\000\051\000\052\000\178\000\051\000\178\000\178\000\178\000\
    \178\000\178\000\000\000\000\000\000\000\046\000\000\000\046\000\
    \046\000\046\000\046\000\000\000\000\000\000\000\046\000\046\000\
    \000\000\046\000\046\000\046\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\051\000\000\000\051\000\181\000\046\000\178\000\
    \046\000\046\000\046\000\046\000\046\000\000\000\000\000\000\000\
    \046\000\000\000\046\000\046\000\046\000\046\000\000\000\000\000\
    \000\000\046\000\046\000\000\000\046\000\046\000\046\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\178\000\000\000\178\000\
    \055\000\046\000\046\000\046\000\046\000\046\000\046\000\046\000\
    \000\000\000\000\000\000\183\000\000\000\183\000\183\000\183\000\
    \183\000\000\000\000\000\000\000\183\000\183\000\000\000\183\000\
    \183\000\183\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \046\000\000\000\046\000\055\000\183\000\046\000\183\000\183\000\
    \183\000\183\000\183\000\000\000\000\000\000\000\186\000\000\000\
    \186\000\186\000\186\000\186\000\000\000\000\000\000\000\186\000\
    \186\000\000\000\186\000\186\000\186\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\046\000\000\000\046\000\185\000\186\000\
    \183\000\186\000\186\000\186\000\186\000\186\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\183\000\000\000\
    \183\000\187\000\214\000\186\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\000\000\213\000\
    \000\000\186\000\214\000\186\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\224\000\213\000\
    \224\000\000\000\000\000\241\000\000\000\224\000\242\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\223\000\223\000\
    \223\000\223\000\223\000\223\000\223\000\223\000\223\000\223\000\
    \000\000\240\000\000\000\240\000\000\000\000\000\000\000\000\000\
    \240\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\239\000\239\000\239\000\239\000\239\000\239\000\239\000\
    \239\000\239\000\239\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\224\000\000\000\000\000\000\000\000\000\000\000\
    \224\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\224\000\000\000\000\000\000\000\
    \224\000\000\000\224\000\000\000\000\000\240\000\222\000\000\000\
    \000\000\000\000\000\000\240\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\240\000\
    \000\000\000\000\000\000\240\000\000\000\240\000\000\000\000\000\
    \001\001\238\000\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\001\001\001\001\001\001\000\000\001\001\000\001\001\001\
    \001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\000\000\000\000\000\001\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\255\255\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000";
  Lexing.lex_check =
   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\000\000\000\000\042\000\000\000\000\000\042\000\050\000\
    \060\000\103\000\050\000\060\000\103\000\124\000\125\000\009\001\
    \124\000\125\000\128\000\130\000\204\000\128\000\130\000\204\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\016\000\
    \014\000\017\000\018\000\040\000\017\000\017\000\040\000\052\000\
    \055\000\057\000\058\000\059\000\052\000\055\000\057\000\058\000\
    \059\000\061\000\094\000\101\000\102\000\109\000\061\000\014\000\
    \112\000\014\000\040\000\014\000\079\000\079\000\079\000\079\000\
    \079\000\079\000\079\000\079\000\079\000\079\000\089\000\089\000\
    \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
    \108\000\108\000\108\000\108\000\108\000\108\000\108\000\108\000\
    \108\000\108\000\115\000\134\000\153\000\157\000\190\000\199\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\014\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\209\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\003\000\120\000\003\000\003\000\003\000\003\000\120\000\
    \193\000\210\000\003\000\003\000\125\000\003\000\003\000\003\000\
    \128\000\216\000\126\000\217\000\098\000\126\000\027\000\098\000\
    \150\000\027\000\003\000\150\000\003\000\003\000\003\000\003\000\
    \003\000\127\000\127\000\224\000\004\000\127\000\004\000\004\000\
    \004\000\004\000\126\000\098\000\226\000\004\000\004\000\150\000\
    \004\000\004\000\004\000\027\000\181\000\228\000\182\000\241\000\
    \127\000\181\000\127\000\182\000\003\000\004\000\003\000\004\000\
    \004\000\004\000\004\000\004\000\002\001\098\000\003\001\005\000\
    \006\001\005\000\005\000\005\000\005\000\150\000\241\000\004\001\
    \005\000\005\000\184\000\005\000\005\000\005\000\184\000\184\000\
    \185\000\005\001\007\001\008\001\003\000\185\000\003\000\004\000\
    \005\000\004\000\005\000\005\000\005\000\005\000\005\000\255\255\
    \027\000\255\255\006\000\187\000\006\000\006\000\006\000\006\000\
    \187\000\255\255\255\255\006\000\006\000\188\000\006\000\006\000\
    \006\000\191\000\188\000\192\000\255\255\255\255\191\000\004\000\
    \192\000\004\000\005\000\006\000\005\000\006\000\006\000\006\000\
    \006\000\006\000\255\255\255\255\255\255\007\000\197\000\007\000\
    \007\000\007\000\007\000\197\000\255\255\218\000\007\000\007\000\
    \218\000\007\000\007\000\007\000\229\000\234\000\242\000\229\000\
    \234\000\242\000\005\000\255\255\005\000\006\000\007\000\006\000\
    \007\000\007\000\007\000\007\000\007\000\255\255\243\000\255\255\
    \008\000\243\000\008\000\008\000\008\000\008\000\255\255\255\255\
    \248\000\008\000\008\000\248\000\008\000\008\000\008\000\254\000\
    \255\000\255\255\254\000\255\000\255\255\006\000\255\255\006\000\
    \007\000\008\000\007\000\008\000\008\000\008\000\008\000\008\000\
    \255\255\230\000\255\255\009\000\230\000\009\000\009\000\009\000\
    \009\000\255\255\255\255\255\255\009\000\009\000\255\255\009\000\
    \009\000\009\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \007\000\230\000\007\000\008\000\009\000\008\000\009\000\009\000\
    \009\000\009\000\009\000\255\255\249\000\255\255\011\000\249\000\
    \011\000\011\000\011\000\011\000\255\255\255\255\193\000\011\000\
    \011\000\255\255\011\000\011\000\011\000\255\255\255\255\255\255\
    \126\000\255\255\255\255\008\000\027\000\008\000\009\000\011\000\
    \009\000\011\000\011\000\011\000\011\000\011\000\255\255\255\255\
    \127\000\255\255\255\255\013\000\255\255\013\000\013\000\013\000\
    \013\000\255\255\255\255\230\000\013\000\013\000\255\255\013\000\
    \013\000\013\000\255\255\255\255\255\255\255\255\009\000\255\255\
    \009\000\011\000\011\000\011\000\013\000\255\255\013\000\013\000\
    \013\000\013\000\013\000\111\000\111\000\111\000\111\000\111\000\
    \111\000\111\000\111\000\111\000\111\000\004\001\255\255\255\255\
    \255\255\255\255\206\000\188\000\255\255\206\000\255\255\005\001\
    \007\001\011\000\255\255\011\000\255\255\255\255\013\000\255\255\
    \013\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \015\000\255\255\015\000\015\000\015\000\015\000\249\000\206\000\
    \255\255\015\000\015\000\255\255\015\000\015\000\015\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\013\000\013\000\
    \013\000\015\000\255\255\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\255\255\015\000\206\000\015\000\015\000\255\255\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\255\255\015\000\019\000\015\000\019\000\019\000\
    \019\000\019\000\255\255\255\255\255\255\019\000\019\000\230\000\
    \019\000\019\000\019\000\223\000\223\000\223\000\223\000\223\000\
    \223\000\223\000\223\000\223\000\223\000\019\000\255\255\019\000\
    \019\000\019\000\019\000\019\000\255\255\255\255\255\255\021\000\
    \255\255\021\000\021\000\021\000\021\000\255\255\255\255\255\255\
    \021\000\021\000\249\000\021\000\021\000\021\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\019\000\
    \021\000\019\000\021\000\021\000\021\000\021\000\021\000\255\255\
    \255\255\255\255\025\000\255\255\025\000\025\000\025\000\025\000\
    \255\255\255\255\255\255\025\000\025\000\255\255\025\000\025\000\
    \025\000\255\255\255\255\255\255\255\255\255\255\255\255\019\000\
    \255\255\019\000\021\000\025\000\021\000\025\000\025\000\025\000\
    \025\000\025\000\107\000\107\000\107\000\107\000\107\000\107\000\
    \107\000\107\000\107\000\107\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\107\000\107\000\107\000\107\000\107\000\
    \107\000\255\255\021\000\255\255\021\000\025\000\255\255\025\000\
    \206\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\026\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\107\000\107\000\107\000\107\000\107\000\
    \107\000\255\255\255\255\255\255\255\255\025\000\255\255\025\000\
    \026\000\026\000\255\255\026\000\026\000\026\000\026\000\255\255\
    \255\255\255\255\026\000\026\000\255\255\026\000\026\000\026\000\
    \026\000\026\000\026\000\026\000\026\000\026\000\026\000\026\000\
    \026\000\026\000\026\000\255\255\026\000\026\000\026\000\026\000\
    \026\000\225\000\225\000\225\000\225\000\225\000\225\000\225\000\
    \225\000\225\000\225\000\239\000\239\000\239\000\239\000\239\000\
    \239\000\239\000\239\000\239\000\239\000\255\255\255\255\255\255\
    \255\255\255\255\028\000\255\255\026\000\093\000\026\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\093\000\093\000\093\000\093\000\093\000\093\000\093\000\
    \093\000\255\255\093\000\255\255\026\000\028\000\026\000\028\000\
    \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\
    \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\
    \028\000\028\000\028\000\028\000\028\000\028\000\028\000\028\000\
    \028\000\030\000\028\000\255\255\255\255\255\255\255\255\255\255\
    \030\000\255\255\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\255\255\255\255\255\255\
    \255\255\030\000\255\255\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\031\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\031\000\255\255\031\000\031\000\
    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\031\000\
    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
    \031\000\255\255\255\255\255\255\255\255\031\000\255\255\031\000\
    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
    \031\000\031\000\031\000\031\000\031\000\031\000\031\000\031\000\
    \031\000\032\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\255\255\255\255\255\255\
    \255\255\032\000\255\255\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\255\255\
    \255\255\255\255\255\255\067\000\255\255\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\067\000\
    \067\000\067\000\067\000\067\000\067\000\067\000\067\000\244\000\
    \244\000\244\000\244\000\244\000\244\000\244\000\244\000\244\000\
    \244\000\255\255\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\255\255\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\033\000\032\000\032\000\032\000\032\000\032\000\032\000\
    \032\000\032\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\255\255\255\255\255\255\
    \255\255\033\000\255\255\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\091\000\255\255\255\255\
    \091\000\091\000\091\000\091\000\091\000\091\000\091\000\091\000\
    \091\000\091\000\091\000\091\000\091\000\091\000\091\000\091\000\
    \091\000\091\000\091\000\091\000\091\000\091\000\091\000\091\000\
    \091\000\091\000\255\255\255\255\255\255\255\255\091\000\255\255\
    \091\000\091\000\091\000\091\000\091\000\091\000\091\000\091\000\
    \091\000\091\000\091\000\091\000\091\000\091\000\091\000\091\000\
    \091\000\091\000\091\000\091\000\091\000\091\000\091\000\091\000\
    \091\000\091\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\255\255\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\034\000\033\000\033\000\033\000\033\000\033\000\033\000\
    \033\000\033\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\255\255\255\255\255\255\
    \255\255\034\000\255\255\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\114\000\114\000\114\000\
    \114\000\114\000\114\000\114\000\114\000\114\000\114\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\118\000\114\000\114\000\
    \114\000\114\000\114\000\114\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\118\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\114\000\114\000\
    \114\000\114\000\114\000\114\000\118\000\118\000\118\000\118\000\
    \118\000\118\000\118\000\118\000\118\000\118\000\255\255\255\255\
    \255\255\255\255\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\255\255\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\035\000\034\000\034\000\034\000\034\000\034\000\034\000\
    \034\000\034\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\255\255\255\255\255\255\
    \255\255\035\000\255\255\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\117\000\117\000\255\255\
    \255\255\117\000\255\255\255\255\255\255\255\255\222\000\222\000\
    \222\000\222\000\222\000\222\000\222\000\222\000\222\000\222\000\
    \255\255\255\255\255\255\255\255\117\000\255\255\117\000\222\000\
    \222\000\222\000\222\000\222\000\222\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\117\000\117\000\117\000\117\000\
    \117\000\117\000\117\000\117\000\117\000\117\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\222\000\
    \222\000\222\000\222\000\222\000\222\000\255\255\255\255\255\255\
    \255\255\255\255\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\255\255\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\255\255\035\000\035\000\035\000\035\000\035\000\035\000\
    \035\000\035\000\036\000\255\255\036\000\036\000\036\000\036\000\
    \255\255\255\255\255\255\036\000\036\000\255\255\036\000\036\000\
    \036\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\036\000\255\255\036\000\036\000\036\000\
    \036\000\036\000\255\255\255\255\255\255\037\000\255\255\037\000\
    \037\000\037\000\037\000\255\255\255\255\255\255\037\000\037\000\
    \255\255\037\000\037\000\037\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\036\000\037\000\036\000\
    \037\000\037\000\037\000\037\000\037\000\255\255\255\255\255\255\
    \038\000\255\255\038\000\038\000\038\000\038\000\255\255\255\255\
    \255\255\038\000\038\000\255\255\038\000\038\000\038\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\036\000\255\255\036\000\
    \037\000\038\000\037\000\038\000\038\000\038\000\038\000\038\000\
    \255\255\255\255\255\255\255\255\039\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\117\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\255\255\
    \037\000\255\255\037\000\038\000\255\255\038\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \255\255\255\255\255\255\038\000\039\000\038\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\255\255\255\255\255\255\255\255\145\000\255\255\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\145\000\145\000\145\000\145\000\145\000\145\000\
    \145\000\145\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\255\255\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\255\255\039\000\039\000\039\000\
    \039\000\039\000\039\000\039\000\039\000\043\000\255\255\255\255\
    \043\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\043\000\255\255\255\255\043\000\
    \255\255\043\000\255\255\255\255\255\255\043\000\043\000\255\255\
    \043\000\255\255\043\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\043\000\
    \043\000\043\000\043\000\043\000\255\255\255\255\255\255\044\000\
    \255\255\044\000\044\000\044\000\044\000\255\255\255\255\255\255\
    \044\000\044\000\255\255\044\000\044\000\044\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \044\000\043\000\044\000\044\000\044\000\044\000\044\000\255\255\
    \255\255\255\255\045\000\255\255\045\000\045\000\045\000\045\000\
    \255\255\255\255\255\255\045\000\045\000\255\255\045\000\045\000\
    \045\000\255\255\255\255\255\255\255\255\255\255\255\255\043\000\
    \255\255\043\000\044\000\045\000\044\000\045\000\045\000\045\000\
    \045\000\045\000\255\255\255\255\255\255\046\000\255\255\046\000\
    \046\000\046\000\046\000\255\255\255\255\255\255\046\000\046\000\
    \255\255\046\000\046\000\046\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\044\000\255\255\044\000\045\000\046\000\045\000\
    \046\000\046\000\046\000\046\000\046\000\255\255\255\255\255\255\
    \047\000\255\255\047\000\047\000\047\000\047\000\255\255\255\255\
    \255\255\047\000\047\000\255\255\047\000\047\000\047\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\045\000\255\255\045\000\
    \046\000\047\000\046\000\047\000\047\000\047\000\047\000\047\000\
    \255\255\255\255\255\255\048\000\255\255\048\000\048\000\048\000\
    \048\000\255\255\255\255\255\255\048\000\048\000\255\255\048\000\
    \048\000\048\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \046\000\255\255\046\000\047\000\048\000\047\000\048\000\048\000\
    \048\000\048\000\048\000\255\255\255\255\255\255\051\000\255\255\
    \051\000\051\000\051\000\051\000\255\255\255\255\255\255\051\000\
    \051\000\255\255\051\000\051\000\051\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\047\000\255\255\047\000\048\000\051\000\
    \048\000\051\000\051\000\051\000\051\000\051\000\255\255\255\255\
    \255\255\053\000\255\255\053\000\053\000\053\000\053\000\255\255\
    \255\255\255\255\053\000\053\000\255\255\053\000\053\000\053\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\048\000\255\255\
    \048\000\051\000\053\000\051\000\053\000\053\000\053\000\053\000\
    \053\000\255\255\255\255\255\255\054\000\255\255\054\000\054\000\
    \054\000\054\000\255\255\255\255\255\255\054\000\054\000\255\255\
    \054\000\054\000\054\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\051\000\255\255\051\000\053\000\054\000\053\000\054\000\
    \054\000\054\000\054\000\054\000\255\255\255\255\255\255\056\000\
    \255\255\056\000\056\000\056\000\056\000\255\255\255\255\255\255\
    \056\000\056\000\255\255\056\000\056\000\056\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\053\000\255\255\053\000\054\000\
    \056\000\054\000\056\000\056\000\056\000\056\000\056\000\255\255\
    \227\000\227\000\227\000\227\000\227\000\227\000\227\000\227\000\
    \227\000\227\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\227\000\227\000\227\000\227\000\227\000\227\000\054\000\
    \255\255\054\000\056\000\255\255\056\000\255\255\255\255\255\255\
    \255\255\255\255\062\000\255\255\062\000\062\000\062\000\062\000\
    \255\255\255\255\255\255\062\000\062\000\255\255\062\000\062\000\
    \062\000\227\000\227\000\227\000\227\000\227\000\227\000\255\255\
    \255\255\255\255\056\000\062\000\056\000\062\000\062\000\062\000\
    \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\
    \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\
    \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\
    \062\000\062\000\062\000\062\000\255\255\062\000\255\255\062\000\
    \062\000\255\255\062\000\062\000\062\000\062\000\062\000\062\000\
    \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\
    \062\000\062\000\062\000\062\000\062\000\062\000\062\000\062\000\
    \062\000\062\000\062\000\062\000\255\255\062\000\063\000\062\000\
    \063\000\063\000\063\000\063\000\255\255\255\255\255\255\063\000\
    \063\000\255\255\063\000\063\000\063\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\063\000\
    \255\255\063\000\063\000\063\000\063\000\063\000\255\255\255\255\
    \255\255\064\000\255\255\064\000\064\000\064\000\064\000\255\255\
    \255\255\255\255\064\000\064\000\255\255\064\000\064\000\064\000\
    \255\255\255\255\201\000\255\255\255\255\201\000\255\255\255\255\
    \255\255\063\000\064\000\063\000\064\000\064\000\064\000\064\000\
    \064\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\201\000\255\255\255\255\255\255\255\255\201\000\
    \255\255\255\255\201\000\255\255\255\255\255\255\255\255\201\000\
    \255\255\063\000\255\255\063\000\064\000\255\255\064\000\255\255\
    \255\255\255\255\255\255\255\255\065\000\255\255\065\000\065\000\
    \065\000\065\000\255\255\255\255\255\255\065\000\065\000\255\255\
    \065\000\065\000\065\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\064\000\065\000\064\000\065\000\
    \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\
    \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\
    \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\
    \065\000\065\000\065\000\065\000\065\000\065\000\255\255\065\000\
    \255\255\065\000\065\000\201\000\065\000\065\000\065\000\065\000\
    \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\
    \065\000\065\000\065\000\065\000\065\000\065\000\065\000\065\000\
    \065\000\065\000\065\000\065\000\065\000\065\000\066\000\065\000\
    \255\255\065\000\255\255\255\255\255\255\066\000\255\255\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\255\255\255\255\255\255\255\255\066\000\255\255\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\066\000\066\000\066\000\066\000\066\000\066\000\
    \066\000\066\000\068\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\255\255\255\255\255\255\
    \201\000\255\255\255\255\255\255\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\255\255\255\255\
    \255\255\255\255\068\000\255\255\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\068\000\068\000\
    \068\000\068\000\068\000\068\000\068\000\068\000\069\000\255\255\
    \255\255\255\255\069\000\255\255\069\000\255\255\255\255\069\000\
    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
    \069\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
    \069\000\069\000\255\255\255\255\255\255\255\255\069\000\255\255\
    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
    \069\000\069\000\069\000\069\000\069\000\069\000\069\000\069\000\
    \069\000\069\000\070\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\255\255\255\255\
    \255\255\255\255\070\000\255\255\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\071\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\255\255\255\255\255\255\255\255\071\000\255\255\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\071\000\071\000\071\000\071\000\071\000\071\000\
    \071\000\071\000\072\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\072\000\072\000\072\000\072\000\072\000\
    \072\000\072\000\072\000\072\000\072\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\072\000\072\000\072\000\072\000\
    \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\
    \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\
    \072\000\072\000\072\000\072\000\072\000\072\000\255\255\255\255\
    \255\255\255\255\072\000\255\255\072\000\072\000\072\000\072\000\
    \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\
    \072\000\072\000\072\000\072\000\072\000\072\000\072\000\072\000\
    \072\000\072\000\072\000\072\000\072\000\072\000\073\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\073\000\
    \073\000\073\000\073\000\073\000\073\000\073\000\073\000\073\000\
    \073\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \073\000\073\000\073\000\073\000\073\000\073\000\073\000\073\000\
    \073\000\073\000\073\000\073\000\073\000\073\000\073\000\073\000\
    \073\000\073\000\073\000\073\000\073\000\073\000\073\000\073\000\
    \073\000\073\000\255\255\255\255\255\255\255\255\073\000\255\255\
    \073\000\073\000\073\000\073\000\073\000\073\000\073\000\073\000\
    \073\000\073\000\073\000\073\000\073\000\073\000\073\000\073\000\
    \073\000\073\000\073\000\073\000\073\000\073\000\073\000\073\000\
    \073\000\073\000\074\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\074\000\074\000\074\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\074\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\074\000\074\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\074\000\074\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\074\000\074\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\074\000\074\000\255\255\255\255\
    \255\255\255\255\074\000\255\255\074\000\074\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\074\000\074\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\074\000\074\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\074\000\074\000\075\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\075\000\255\255\075\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\255\255\255\255\255\255\255\255\075\000\255\255\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \075\000\075\000\076\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\076\000\076\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\076\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\076\000\255\255\255\255\
    \255\255\255\255\076\000\255\255\076\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\076\000\077\000\255\255\
    \255\255\255\255\077\000\255\255\077\000\255\255\255\255\077\000\
    \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
    \077\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
    \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
    \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
    \077\000\077\000\255\255\255\255\255\255\255\255\077\000\255\255\
    \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
    \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
    \077\000\077\000\077\000\077\000\077\000\077\000\077\000\077\000\
    \077\000\077\000\078\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\078\000\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\255\255\255\255\
    \255\255\255\255\078\000\255\255\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\080\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\080\000\255\255\255\255\255\255\255\255\080\000\255\255\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\080\000\080\000\
    \080\000\080\000\081\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\255\255\255\255\
    \255\255\255\255\081\000\255\255\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\081\000\081\000\
    \081\000\081\000\081\000\081\000\081\000\081\000\082\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\255\255\255\255\255\255\255\255\082\000\255\255\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\082\000\082\000\082\000\082\000\082\000\082\000\
    \082\000\082\000\083\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\255\255\255\255\
    \255\255\255\255\083\000\255\255\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\083\000\083\000\
    \083\000\083\000\083\000\083\000\083\000\083\000\084\000\255\255\
    \255\255\255\255\084\000\255\255\084\000\255\255\255\255\084\000\
    \084\000\084\000\084\000\084\000\084\000\084\000\084\000\084\000\
    \084\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \084\000\084\000\084\000\084\000\084\000\084\000\084\000\084\000\
    \084\000\084\000\084\000\084\000\084\000\084\000\084\000\084\000\
    \084\000\084\000\084\000\084\000\084\000\084\000\084\000\084\000\
    \084\000\084\000\255\255\255\255\255\255\255\255\084\000\255\255\
    \084\000\084\000\084\000\084\000\084\000\084\000\084\000\084\000\
    \084\000\084\000\084\000\084\000\084\000\084\000\084\000\084\000\
    \084\000\084\000\084\000\084\000\084\000\084\000\084\000\084\000\
    \084\000\084\000\085\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\085\000\085\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\085\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\255\255\255\255\
    \255\255\255\255\085\000\255\255\085\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\086\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\086\000\
    \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
    \086\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
    \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
    \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
    \086\000\086\000\255\255\255\255\255\255\255\255\086\000\255\255\
    \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
    \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
    \086\000\086\000\086\000\086\000\086\000\086\000\086\000\086\000\
    \086\000\086\000\087\000\255\255\255\255\255\255\087\000\255\255\
    \087\000\255\255\255\255\087\000\087\000\087\000\087\000\087\000\
    \087\000\087\000\087\000\087\000\087\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\087\000\087\000\087\000\087\000\
    \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
    \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
    \087\000\087\000\087\000\087\000\087\000\087\000\255\255\255\255\
    \255\255\255\255\087\000\255\255\087\000\087\000\087\000\087\000\
    \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
    \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
    \087\000\087\000\087\000\087\000\087\000\087\000\088\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\088\000\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\088\000\255\255\255\255\255\255\255\255\088\000\255\255\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\088\000\088\000\088\000\088\000\088\000\088\000\088\000\
    \088\000\088\000\090\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\090\000\090\000\090\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\090\000\090\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\090\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\090\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\090\000\255\255\255\255\
    \255\255\255\255\090\000\255\255\090\000\090\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\090\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\090\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\090\000\095\000\255\255\
    \255\255\095\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\095\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\095\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\095\000\255\255\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \255\255\255\255\255\255\255\255\095\000\255\255\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \095\000\095\000\095\000\095\000\095\000\095\000\095\000\095\000\
    \096\000\255\255\255\255\255\255\255\255\255\255\255\255\096\000\
    \255\255\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\255\255\255\255\255\255\255\255\
    \096\000\255\255\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\096\000\096\000\096\000\096\000\
    \096\000\096\000\096\000\096\000\100\000\255\255\100\000\255\255\
    \255\255\255\255\255\255\100\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\100\000\100\000\100\000\100\000\
    \100\000\100\000\100\000\100\000\100\000\100\000\119\000\255\255\
    \119\000\119\000\119\000\119\000\255\255\255\255\255\255\119\000\
    \119\000\255\255\119\000\119\000\119\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\119\000\
    \255\255\119\000\119\000\119\000\119\000\119\000\255\255\255\255\
    \100\000\255\255\255\255\255\255\255\255\255\255\100\000\121\000\
    \255\255\121\000\121\000\121\000\121\000\255\255\255\255\255\255\
    \121\000\121\000\100\000\121\000\121\000\121\000\100\000\255\255\
    \100\000\119\000\255\255\119\000\100\000\255\255\255\255\255\255\
    \121\000\255\255\121\000\121\000\121\000\121\000\121\000\255\255\
    \255\255\255\255\122\000\255\255\122\000\122\000\122\000\122\000\
    \255\255\255\255\255\255\122\000\122\000\255\255\122\000\122\000\
    \122\000\119\000\255\255\119\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\121\000\122\000\121\000\122\000\122\000\122\000\
    \122\000\122\000\255\255\255\255\255\255\131\000\255\255\131\000\
    \131\000\131\000\131\000\255\255\255\255\255\255\131\000\131\000\
    \255\255\131\000\131\000\131\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\121\000\255\255\121\000\122\000\131\000\122\000\
    \131\000\131\000\131\000\131\000\131\000\255\255\255\255\255\255\
    \132\000\255\255\132\000\132\000\132\000\132\000\255\255\255\255\
    \255\255\132\000\132\000\255\255\132\000\132\000\132\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\122\000\255\255\122\000\
    \131\000\132\000\131\000\132\000\132\000\132\000\132\000\132\000\
    \255\255\255\255\255\255\133\000\255\255\133\000\133\000\133\000\
    \133\000\255\255\255\255\255\255\133\000\133\000\255\255\133\000\
    \133\000\133\000\255\255\255\255\100\000\255\255\255\255\255\255\
    \131\000\255\255\131\000\132\000\133\000\132\000\133\000\133\000\
    \133\000\133\000\133\000\255\255\255\255\255\255\140\000\255\255\
    \140\000\140\000\140\000\140\000\255\255\255\255\255\255\140\000\
    \140\000\255\255\140\000\140\000\140\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\132\000\255\255\132\000\133\000\140\000\
    \133\000\140\000\140\000\140\000\140\000\140\000\255\255\255\255\
    \255\255\141\000\255\255\141\000\141\000\141\000\141\000\255\255\
    \255\255\255\255\141\000\141\000\255\255\141\000\141\000\141\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\133\000\255\255\
    \133\000\140\000\141\000\140\000\141\000\141\000\141\000\141\000\
    \141\000\255\255\238\000\238\000\238\000\238\000\238\000\238\000\
    \238\000\238\000\238\000\238\000\142\000\255\255\255\255\142\000\
    \255\255\255\255\255\255\238\000\238\000\238\000\238\000\238\000\
    \238\000\140\000\255\255\140\000\141\000\255\255\141\000\255\255\
    \255\255\255\255\255\255\142\000\142\000\255\255\142\000\142\000\
    \142\000\142\000\255\255\255\255\255\255\142\000\142\000\255\255\
    \142\000\142\000\142\000\238\000\238\000\238\000\238\000\238\000\
    \238\000\255\255\255\255\255\255\141\000\142\000\141\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\255\255\142\000\
    \255\255\142\000\142\000\255\255\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\143\000\142\000\
    \255\255\142\000\255\255\255\255\255\255\255\255\255\255\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\255\255\255\255\255\255\255\255\143\000\255\255\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\143\000\143\000\143\000\143\000\143\000\143\000\
    \143\000\143\000\144\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\144\000\255\255\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\255\255\255\255\
    \255\255\255\255\144\000\255\255\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\144\000\144\000\
    \144\000\144\000\144\000\144\000\144\000\144\000\146\000\255\255\
    \146\000\146\000\146\000\146\000\255\255\255\255\255\255\146\000\
    \146\000\255\255\146\000\146\000\146\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\146\000\
    \255\255\146\000\146\000\146\000\146\000\146\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\147\000\255\255\255\255\
    \147\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\146\000\255\255\146\000\147\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\147\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\147\000\255\255\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\255\255\255\255\
    \255\255\146\000\147\000\146\000\255\255\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\255\255\
    \255\255\255\255\255\255\147\000\255\255\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\148\000\
    \255\255\255\255\148\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\148\000\151\000\
    \255\255\151\000\151\000\151\000\151\000\255\255\255\255\255\255\
    \151\000\151\000\255\255\151\000\151\000\151\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \151\000\255\255\151\000\151\000\151\000\151\000\151\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\255\255\151\000\255\255\151\000\148\000\255\255\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\255\255\151\000\152\000\151\000\152\000\152\000\152\000\
    \152\000\255\255\255\255\255\255\152\000\152\000\255\255\152\000\
    \152\000\152\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\152\000\255\255\152\000\152\000\
    \152\000\152\000\152\000\255\255\246\000\246\000\246\000\246\000\
    \246\000\246\000\246\000\246\000\246\000\246\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\246\000\246\000\246\000\
    \246\000\246\000\246\000\255\255\255\255\255\255\152\000\255\255\
    \152\000\255\255\255\255\255\255\255\255\255\255\160\000\255\255\
    \160\000\160\000\160\000\160\000\255\255\255\255\255\255\160\000\
    \160\000\255\255\160\000\160\000\160\000\246\000\246\000\246\000\
    \246\000\246\000\246\000\255\255\255\255\255\255\152\000\160\000\
    \152\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \255\255\160\000\255\255\160\000\160\000\255\255\160\000\160\000\
    \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \160\000\160\000\160\000\160\000\160\000\160\000\160\000\160\000\
    \255\255\160\000\162\000\160\000\162\000\162\000\162\000\162\000\
    \255\255\255\255\255\255\162\000\162\000\255\255\162\000\162\000\
    \162\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\162\000\255\255\162\000\162\000\162\000\
    \162\000\162\000\255\255\255\255\255\255\163\000\255\255\163\000\
    \163\000\163\000\163\000\255\255\255\255\255\255\163\000\163\000\
    \255\255\163\000\163\000\163\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\162\000\163\000\162\000\
    \163\000\163\000\163\000\163\000\163\000\255\255\255\255\255\255\
    \164\000\255\255\164\000\164\000\164\000\164\000\255\255\255\255\
    \255\255\164\000\164\000\255\255\164\000\164\000\164\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\162\000\255\255\162\000\
    \163\000\164\000\163\000\164\000\164\000\164\000\164\000\164\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \163\000\255\255\163\000\164\000\255\255\164\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \255\255\255\255\255\255\164\000\165\000\164\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \165\000\165\000\165\000\165\000\165\000\165\000\165\000\165\000\
    \166\000\255\255\166\000\166\000\166\000\166\000\255\255\255\255\
    \255\255\166\000\166\000\255\255\166\000\166\000\166\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\166\000\255\255\166\000\166\000\166\000\166\000\166\000\
    \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
    \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
    \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
    \166\000\166\000\255\255\166\000\255\255\166\000\166\000\255\255\
    \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
    \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
    \166\000\166\000\166\000\166\000\166\000\166\000\166\000\166\000\
    \166\000\166\000\255\255\166\000\255\255\166\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \255\255\255\255\255\255\255\255\167\000\255\255\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \167\000\167\000\167\000\167\000\167\000\167\000\167\000\167\000\
    \169\000\255\255\169\000\169\000\169\000\169\000\255\255\255\255\
    \255\255\169\000\169\000\255\255\169\000\169\000\169\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\169\000\255\255\169\000\169\000\169\000\169\000\169\000\
    \255\255\255\255\255\255\170\000\255\255\170\000\170\000\170\000\
    \170\000\255\255\255\255\255\255\170\000\170\000\255\255\170\000\
    \170\000\170\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\169\000\170\000\169\000\170\000\170\000\
    \170\000\170\000\170\000\255\255\255\255\255\255\171\000\255\255\
    \171\000\171\000\171\000\171\000\255\255\255\255\255\255\171\000\
    \171\000\255\255\171\000\171\000\171\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\169\000\255\255\169\000\170\000\171\000\
    \170\000\171\000\171\000\171\000\171\000\171\000\255\255\255\255\
    \255\255\172\000\255\255\172\000\172\000\172\000\172\000\255\255\
    \255\255\255\255\172\000\172\000\255\255\172\000\172\000\172\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\170\000\255\255\
    \170\000\171\000\172\000\171\000\172\000\172\000\172\000\172\000\
    \172\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\171\000\255\255\171\000\172\000\172\000\172\000\255\255\
    \255\255\255\255\255\255\255\255\174\000\255\255\174\000\174\000\
    \174\000\174\000\255\255\255\255\255\255\174\000\174\000\255\255\
    \174\000\174\000\174\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\172\000\174\000\172\000\174\000\
    \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
    \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
    \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
    \174\000\174\000\174\000\174\000\174\000\174\000\255\255\174\000\
    \255\255\174\000\174\000\255\255\174\000\174\000\174\000\174\000\
    \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
    \174\000\174\000\174\000\174\000\174\000\174\000\174\000\174\000\
    \174\000\174\000\174\000\174\000\174\000\174\000\255\255\174\000\
    \255\255\174\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\255\255\255\255\255\255\255\255\
    \175\000\255\255\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\175\000\175\000\175\000\175\000\
    \175\000\175\000\175\000\175\000\176\000\255\255\176\000\176\000\
    \176\000\176\000\255\255\255\255\255\255\176\000\176\000\255\255\
    \176\000\176\000\176\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\176\000\255\255\176\000\
    \176\000\176\000\176\000\176\000\255\255\255\255\255\255\177\000\
    \255\255\177\000\177\000\177\000\177\000\255\255\255\255\255\255\
    \177\000\177\000\255\255\177\000\177\000\177\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\176\000\
    \177\000\176\000\177\000\177\000\177\000\177\000\177\000\255\255\
    \255\255\255\255\178\000\255\255\178\000\178\000\178\000\178\000\
    \255\255\255\255\255\255\178\000\178\000\255\255\178\000\178\000\
    \178\000\255\255\255\255\255\255\255\255\255\255\255\255\176\000\
    \255\255\176\000\177\000\178\000\177\000\178\000\178\000\178\000\
    \178\000\178\000\255\255\255\255\255\255\179\000\255\255\179\000\
    \179\000\179\000\179\000\255\255\255\255\255\255\179\000\179\000\
    \255\255\179\000\179\000\179\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\177\000\255\255\177\000\178\000\179\000\178\000\
    \179\000\179\000\179\000\179\000\179\000\255\255\255\255\255\255\
    \180\000\255\255\180\000\180\000\180\000\180\000\255\255\255\255\
    \255\255\180\000\180\000\255\255\180\000\180\000\180\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\178\000\255\255\178\000\
    \179\000\180\000\179\000\180\000\180\000\180\000\180\000\180\000\
    \255\255\255\255\255\255\183\000\255\255\183\000\183\000\183\000\
    \183\000\255\255\255\255\255\255\183\000\183\000\255\255\183\000\
    \183\000\183\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \179\000\255\255\179\000\180\000\183\000\180\000\183\000\183\000\
    \183\000\183\000\183\000\255\255\255\255\255\255\186\000\255\255\
    \186\000\186\000\186\000\186\000\255\255\255\255\255\255\186\000\
    \186\000\255\255\186\000\186\000\186\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\180\000\255\255\180\000\183\000\186\000\
    \183\000\186\000\186\000\186\000\186\000\186\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\183\000\255\255\
    \183\000\186\000\207\000\186\000\207\000\207\000\207\000\207\000\
    \207\000\207\000\207\000\207\000\207\000\207\000\207\000\207\000\
    \207\000\207\000\207\000\207\000\207\000\207\000\207\000\207\000\
    \207\000\207\000\207\000\207\000\207\000\207\000\255\255\207\000\
    \255\255\186\000\214\000\186\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\214\000\214\000\
    \214\000\214\000\214\000\214\000\214\000\214\000\215\000\214\000\
    \215\000\255\255\255\255\235\000\255\255\215\000\235\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\215\000\215\000\
    \215\000\215\000\215\000\215\000\215\000\215\000\215\000\215\000\
    \255\255\235\000\255\255\235\000\255\255\255\255\255\255\255\255\
    \235\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\235\000\235\000\235\000\235\000\235\000\235\000\235\000\
    \235\000\235\000\235\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\215\000\255\255\255\255\255\255\255\255\255\255\
    \215\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\215\000\255\255\255\255\255\255\
    \215\000\255\255\215\000\255\255\255\255\235\000\215\000\255\255\
    \255\255\255\255\255\255\235\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\235\000\
    \255\255\255\255\255\255\235\000\255\255\235\000\255\255\255\255\
    \251\000\235\000\251\000\251\000\251\000\251\000\251\000\251\000\
    \251\000\251\000\251\000\251\000\251\000\251\000\251\000\251\000\
    \251\000\251\000\251\000\251\000\251\000\251\000\251\000\251\000\
    \251\000\251\000\251\000\251\000\255\255\001\001\251\000\001\001\
    \001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\001\
    \001\001\255\255\255\255\001\001\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\235\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255";
  Lexing.lex_base_code =
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\010\000\000\000\000\000\000\000\022\000\034\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\044\000\054\000\000\000\
    \064\000\070\000\085\000\110\000\165\000\140\000\188\000\198\000\
    \220\000\000\000\000\000\000\000\236\000\246\000\078\000\254\000\
    \012\001\022\001\038\001\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\048\001\074\001\000\000\
    \000\000\000\000\000\000\029\000\000\000\000\000\000\000\002\000\
    \000\000\044\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\100\001\000\000\
    \000\000\000\000\000\000\184\001\042\002\056\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\002\000\004\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000";
  Lexing.lex_backtrk_code =
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\018\000\018\000\000\000\000\000\
    \018\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\018\000\000\000\000\000\000\000\000\000\000\000\018\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\064\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000";
  Lexing.lex_default_code =
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\036\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000";
  Lexing.lex_trans_code =
   "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\061\000\061\000\000\000\061\000\000\000\
    \000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\001\000\039\000\000\000\000\000\000\000\
    \000\000\000\000\001\000\000\000\000\000\000\000\000\000\009\000\
    \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
    \004\000\004\000\012\000\012\000\012\000\012\000\012\000\012\000\
    \012\000\012\000\012\000\012\000\015\000\000\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
    \015\000\000\000\004\000\004\000\004\000\004\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \021\000\021\000\000\000\000\000\000\000\004\000\021\000\021\000\
    \021\000\021\000\021\000\021\000\021\000\021\000\021\000\021\000\
    \000\000\004\000\000\000\000\000\000\000\004\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\004\000\004\000\004\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\015\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\015\000\000\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\004\000\004\000\004\000\004\000\
    \000\000\000\000\000\000\000\000\000\000\021\000\000\000\004\000\
    \004\000\004\000\004\000\004\000\004\000\000\000\004\000\004\000\
    \004\000\004\000\004\000\004\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\004\000\000\000\004\000\
    \004\000\004\000\004\000\004\000\004\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \000\000\000\000\000\000\000\000\015\000\000\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\000\000\000\000\
    \000\000\000\000\000\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\021\000\021\000\
    \021\000\021\000\021\000\021\000\021\000\021\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \000\000\000\000\000\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \000\000\000\000\024\000\001\000\000\000\021\000\015\000\015\000\
    \015\000\015\000\015\000\015\000\015\000\015\000\015\000\015\000\
    \012\000\012\000\012\000\012\000\012\000\012\000\012\000\012\000\
    \012\000\012\000\001\000\015\000\000\000\009\000\000\000\000\000\
    \009\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\012\000\012\000\012\000\012\000\012\000\012\000\
    \012\000\012\000\012\000\012\000\009\000\015\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\000\000\
    \000\000\000\000\000\000\053\000\000\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\053\000\000\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\000\000\000\000\000\000\000\000\053\000\
    \000\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\009\000\000\000\000\000\009\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\009\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\000\000\000\000\000\000\
    \000\000\053\000\000\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\053\000\053\000\053\000\
    \053\000\053\000\053\000\053\000\053\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\000\000";
  Lexing.lex_check_code =
   "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\126\000\235\000\242\000\126\000\243\000\255\255\
    \255\255\255\255\255\255\026\000\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\126\000\000\000\127\000\255\255\255\255\255\255\
    \255\255\255\255\026\000\255\255\255\255\255\255\255\255\015\000\
    \000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\
    \000\000\000\000\026\000\026\000\026\000\026\000\026\000\026\000\
    \026\000\026\000\026\000\026\000\030\000\255\255\030\000\030\000\
    \030\000\030\000\030\000\030\000\030\000\030\000\030\000\030\000\
    \031\000\255\255\031\000\031\000\031\000\031\000\031\000\031\000\
    \031\000\031\000\031\000\031\000\069\000\069\000\069\000\069\000\
    \069\000\069\000\069\000\069\000\069\000\069\000\070\000\070\000\
    \070\000\070\000\070\000\070\000\070\000\070\000\070\000\070\000\
    \072\000\072\000\255\255\255\255\255\255\030\000\073\000\073\000\
    \073\000\073\000\073\000\073\000\073\000\073\000\086\000\086\000\
    \255\255\031\000\255\255\255\255\255\255\074\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\074\000\074\000\074\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\070\000\074\000\074\000\
    \074\000\074\000\074\000\074\000\075\000\255\255\075\000\075\000\
    \075\000\075\000\075\000\075\000\075\000\075\000\075\000\075\000\
    \255\255\255\255\255\255\255\255\255\255\086\000\255\255\075\000\
    \075\000\075\000\075\000\075\000\075\000\255\255\074\000\074\000\
    \074\000\074\000\074\000\074\000\077\000\077\000\077\000\077\000\
    \077\000\077\000\077\000\077\000\077\000\077\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\075\000\255\255\075\000\
    \075\000\075\000\075\000\075\000\075\000\076\000\076\000\076\000\
    \076\000\076\000\076\000\076\000\076\000\076\000\076\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\076\000\076\000\
    \076\000\076\000\076\000\076\000\078\000\078\000\078\000\078\000\
    \078\000\078\000\078\000\078\000\078\000\078\000\079\000\079\000\
    \079\000\079\000\079\000\079\000\079\000\079\000\079\000\079\000\
    \126\000\255\255\255\255\255\255\076\000\255\255\076\000\076\000\
    \076\000\076\000\076\000\076\000\080\000\080\000\080\000\080\000\
    \080\000\080\000\080\000\080\000\080\000\080\000\255\255\255\255\
    \255\255\255\255\255\255\078\000\084\000\084\000\084\000\084\000\
    \084\000\084\000\084\000\084\000\084\000\084\000\085\000\085\000\
    \085\000\085\000\085\000\085\000\085\000\085\000\087\000\087\000\
    \087\000\087\000\087\000\087\000\087\000\087\000\087\000\087\000\
    \255\255\255\255\255\255\080\000\088\000\088\000\088\000\088\000\
    \088\000\088\000\088\000\088\000\088\000\088\000\089\000\089\000\
    \089\000\089\000\089\000\089\000\089\000\089\000\089\000\089\000\
    \255\255\255\255\117\000\118\000\255\255\085\000\090\000\090\000\
    \090\000\090\000\090\000\090\000\090\000\090\000\090\000\090\000\
    \117\000\117\000\117\000\117\000\117\000\117\000\117\000\117\000\
    \117\000\117\000\118\000\088\000\255\255\142\000\255\255\255\255\
    \142\000\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\118\000\118\000\118\000\118\000\118\000\118\000\
    \118\000\118\000\118\000\118\000\142\000\090\000\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\255\255\
    \255\255\255\255\255\255\142\000\255\255\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\142\000\
    \142\000\142\000\142\000\142\000\142\000\142\000\142\000\147\000\
    \255\255\255\255\255\255\255\255\255\255\255\255\147\000\255\255\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\255\255\255\255\255\255\255\255\147\000\
    \255\255\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\147\000\147\000\147\000\147\000\147\000\
    \147\000\147\000\147\000\148\000\255\255\255\255\148\000\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\148\000\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\255\255\255\255\255\255\
    \255\255\148\000\255\255\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\148\000\148\000\148\000\
    \148\000\148\000\148\000\148\000\148\000\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\
    \255\255\255\255\255\255";
  Lexing.lex_code =
   "\255\004\255\255\006\255\005\255\255\010\255\255\007\255\255\005\
    \255\255\000\005\255\006\255\255\009\255\008\255\255\003\255\000\
    \004\001\007\255\009\255\255\008\255\009\255\255\000\004\001\007\
    \003\008\002\009\255\011\255\255\000\010\001\011\255\001\255\255\
    \000\001\255";
}

let rec token state lexbuf =
  lexbuf.Lexing.lex_mem <- Array.make 12 (-1); __ocaml_lex_token_rec state lexbuf 0
and __ocaml_lex_token_rec state lexbuf __ocaml_lex_state =
  match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 349 "src/reason-parser/reason_declarative_lexer.mll"
                 (
      raise_error
        (Location.curr lexbuf)
        (Illegal_character (Lexing.lexeme_char lexbuf 0));
      update_loc lexbuf None 1 false 0;
      token state lexbuf
    )
# 2528 "src/reason-parser/reason_declarative_lexer.ml"

  | 1 ->
# 357 "src/reason-parser/reason_declarative_lexer.mll"
    ( update_loc lexbuf None 1 false 0;
      token state lexbuf
    )
# 2535 "src/reason-parser/reason_declarative_lexer.ml"

  | 2 ->
# 361 "src/reason-parser/reason_declarative_lexer.mll"
    ( token state lexbuf )
# 2540 "src/reason-parser/reason_declarative_lexer.ml"

  | 3 ->
# 363 "src/reason-parser/reason_declarative_lexer.mll"
    ( UNDERSCORE )
# 2545 "src/reason-parser/reason_declarative_lexer.ml"

  | 4 ->
# 365 "src/reason-parser/reason_declarative_lexer.mll"
    ( TILDE )
# 2550 "src/reason-parser/reason_declarative_lexer.ml"

  | 5 ->
# 367 "src/reason-parser/reason_declarative_lexer.mll"
    ( QUESTION )
# 2555 "src/reason-parser/reason_declarative_lexer.ml"

  | 6 ->
# 369 "src/reason-parser/reason_declarative_lexer.mll"
    ( set_lexeme_length lexbuf 1; EQUAL )
# 2560 "src/reason-parser/reason_declarative_lexer.ml"

  | 7 ->
# 371 "src/reason-parser/reason_declarative_lexer.mll"
    ( let s = Lexing.lexeme lexbuf in
      try Hashtbl.find keyword_table s
      with Not_found -> LIDENT s
    )
# 2568 "src/reason-parser/reason_declarative_lexer.ml"

  | 8 ->
# 376 "src/reason-parser/reason_declarative_lexer.mll"
    ( Ocaml_util.warn_latin1 lexbuf; LIDENT (Lexing.lexeme lexbuf) )
# 2573 "src/reason-parser/reason_declarative_lexer.ml"

  | 9 ->
# 378 "src/reason-parser/reason_declarative_lexer.mll"
    ( UIDENT(Lexing.lexeme lexbuf) )
# 2578 "src/reason-parser/reason_declarative_lexer.ml"

  | 10 ->
# 380 "src/reason-parser/reason_declarative_lexer.mll"
    ( Ocaml_util.warn_latin1 lexbuf; UIDENT(Lexing.lexeme lexbuf) )
# 2583 "src/reason-parser/reason_declarative_lexer.ml"

  | 11 ->
# 382 "src/reason-parser/reason_declarative_lexer.mll"
    ( INT (Lexing.lexeme lexbuf, None) )
# 2588 "src/reason-parser/reason_declarative_lexer.ml"

  | 12 ->
let
# 383 "src/reason-parser/reason_declarative_lexer.mll"
                    lit
# 2594 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos (lexbuf.Lexing.lex_curr_pos + -1)
and
# 383 "src/reason-parser/reason_declarative_lexer.mll"
                                              modif
# 2599 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_curr_pos + -1) in
# 384 "src/reason-parser/reason_declarative_lexer.mll"
    ( INT (lit, Some modif) )
# 2603 "src/reason-parser/reason_declarative_lexer.ml"

  | 13 ->
# 386 "src/reason-parser/reason_declarative_lexer.mll"
    ( FLOAT (Lexing.lexeme lexbuf, None) )
# 2608 "src/reason-parser/reason_declarative_lexer.ml"

  | 14 ->
let
# 387 "src/reason-parser/reason_declarative_lexer.mll"
                                            lit
# 2614 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos (lexbuf.Lexing.lex_curr_pos + -1)
and
# 387 "src/reason-parser/reason_declarative_lexer.mll"
                                                                      modif
# 2619 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_curr_pos + -1) in
# 388 "src/reason-parser/reason_declarative_lexer.mll"
    ( FLOAT (lit, Some modif) )
# 2623 "src/reason-parser/reason_declarative_lexer.ml"

  | 15 ->
let
# 389 "src/reason-parser/reason_declarative_lexer.mll"
                                            lit
# 2629 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_mem.(0) in
# 390 "src/reason-parser/reason_declarative_lexer.mll"
    ( raise_error
        (Location.curr lexbuf)
        (Invalid_literal (Lexing.lexeme lexbuf));
      FLOAT (lit, None)
    )
# 2637 "src/reason-parser/reason_declarative_lexer.ml"

  | 16 ->
let
# 395 "src/reason-parser/reason_declarative_lexer.mll"
                    lit
# 2643 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_start_pos lexbuf.Lexing.lex_mem.(0) in
# 396 "src/reason-parser/reason_declarative_lexer.mll"
    ( raise_error
        (Location.curr lexbuf)
        (Invalid_literal (Lexing.lexeme lexbuf));
      INT (lit, None)
    )
# 2651 "src/reason-parser/reason_declarative_lexer.ml"

  | 17 ->
# 402 "src/reason-parser/reason_declarative_lexer.mll"
    ( let string_start = lexbuf.lex_start_p in
      let start_loc = Location.curr lexbuf in
      let raw_buffer, txt_buffer = get_scratch_buffers state in
      if not (string raw_buffer (Some txt_buffer) lexbuf) then
        raise_error start_loc Unterminated_string;
      lexbuf.lex_start_p <- string_start;
      let txt = flush_buffer txt_buffer in
      let raw = flush_buffer raw_buffer in
      STRING (txt, Some raw, None)
    )
# 2665 "src/reason-parser/reason_declarative_lexer.ml"

  | 18 ->
let
# 412 "src/reason-parser/reason_declarative_lexer.mll"
                       delim
# 2671 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_start_pos + 1) (lexbuf.Lexing.lex_curr_pos + -1) in
# 413 "src/reason-parser/reason_declarative_lexer.mll"
    ( let string_start = lexbuf.lex_start_p in
      let start_loc = Location.curr lexbuf in
      let raw_buffer, _ = get_scratch_buffers state in
      if not (quoted_string raw_buffer delim lexbuf) then
        raise_error start_loc Unterminated_string;
      lexbuf.lex_start_p <- string_start;
      let txt = flush_buffer raw_buffer in
      STRING (txt, None, Some delim)
    )
# 2683 "src/reason-parser/reason_declarative_lexer.ml"

  | 19 ->
# 423 "src/reason-parser/reason_declarative_lexer.mll"
    ( (* newline can span multiple characters
         (if the newline starts with \13)
         Only the first one is returned, maybe we should warn? *)
      update_loc lexbuf None 1 false 1;
      CHAR (Lexing.lexeme_char lexbuf 1)
    )
# 2693 "src/reason-parser/reason_declarative_lexer.ml"

  | 20 ->
let
# 429 "src/reason-parser/reason_declarative_lexer.mll"
                                        c
# 2699 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 1) in
# 430 "src/reason-parser/reason_declarative_lexer.mll"
    ( CHAR c )
# 2703 "src/reason-parser/reason_declarative_lexer.ml"

  | 21 ->
let
# 431 "src/reason-parser/reason_declarative_lexer.mll"
                                                  c
# 2709 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 2) in
# 432 "src/reason-parser/reason_declarative_lexer.mll"
    ( CHAR (char_for_backslash c) )
# 2713 "src/reason-parser/reason_declarative_lexer.ml"

  | 22 ->
# 434 "src/reason-parser/reason_declarative_lexer.mll"
    ( CHAR (char_for_decimal_code lexbuf 2) )
# 2718 "src/reason-parser/reason_declarative_lexer.ml"

  | 23 ->
# 436 "src/reason-parser/reason_declarative_lexer.mll"
    ( CHAR (char_for_hexadecimal_code lexbuf 3) )
# 2723 "src/reason-parser/reason_declarative_lexer.ml"

  | 24 ->
let
# 437 "src/reason-parser/reason_declarative_lexer.mll"
                     esc
# 2729 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_start_pos + 1) (lexbuf.Lexing.lex_start_pos + 3) in
# 438 "src/reason-parser/reason_declarative_lexer.mll"
    ( raise_error (Location.curr lexbuf) (Illegal_escape esc);
      token state lexbuf
    )
# 2735 "src/reason-parser/reason_declarative_lexer.ml"

  | 25 ->
# 442 "src/reason-parser/reason_declarative_lexer.mll"
    ( (* Allow parsing of foo#=<bar /> *)
      set_lexeme_length lexbuf 2;
      SHARPEQUAL
    )
# 2743 "src/reason-parser/reason_declarative_lexer.ml"

  | 26 ->
# 447 "src/reason-parser/reason_declarative_lexer.mll"
    ( SHARPEQUAL )
# 2748 "src/reason-parser/reason_declarative_lexer.ml"

  | 27 ->
# 449 "src/reason-parser/reason_declarative_lexer.mll"
    ( SHARPOP (lexeme_operator lexbuf) )
# 2753 "src/reason-parser/reason_declarative_lexer.ml"

  | 28 ->
let
# 450 "src/reason-parser/reason_declarative_lexer.mll"
                                   num
# 2759 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) lexbuf.Lexing.lex_mem.(1)
and
# 451 "src/reason-parser/reason_declarative_lexer.mll"
                                           name
# 2764 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme_opt lexbuf lexbuf.Lexing.lex_mem.(3) lexbuf.Lexing.lex_mem.(2) in
# 453 "src/reason-parser/reason_declarative_lexer.mll"
    ( update_loc lexbuf name (int_of_string num) true 0;
      token state lexbuf
    )
# 2770 "src/reason-parser/reason_declarative_lexer.ml"

  | 29 ->
# 456 "src/reason-parser/reason_declarative_lexer.mll"
         ( AMPERSAND )
# 2775 "src/reason-parser/reason_declarative_lexer.ml"

  | 30 ->
# 457 "src/reason-parser/reason_declarative_lexer.mll"
         ( AMPERAMPER )
# 2780 "src/reason-parser/reason_declarative_lexer.ml"

  | 31 ->
# 458 "src/reason-parser/reason_declarative_lexer.mll"
         ( BACKQUOTE )
# 2785 "src/reason-parser/reason_declarative_lexer.ml"

  | 32 ->
# 459 "src/reason-parser/reason_declarative_lexer.mll"
         ( QUOTE )
# 2790 "src/reason-parser/reason_declarative_lexer.ml"

  | 33 ->
# 460 "src/reason-parser/reason_declarative_lexer.mll"
         ( LPAREN )
# 2795 "src/reason-parser/reason_declarative_lexer.ml"

  | 34 ->
# 461 "src/reason-parser/reason_declarative_lexer.mll"
         ( RPAREN )
# 2800 "src/reason-parser/reason_declarative_lexer.ml"

  | 35 ->
# 462 "src/reason-parser/reason_declarative_lexer.mll"
         ( STAR )
# 2805 "src/reason-parser/reason_declarative_lexer.ml"

  | 36 ->
# 463 "src/reason-parser/reason_declarative_lexer.mll"
         ( COMMA )
# 2810 "src/reason-parser/reason_declarative_lexer.ml"

  | 37 ->
# 464 "src/reason-parser/reason_declarative_lexer.mll"
         ( MINUSGREATER )
# 2815 "src/reason-parser/reason_declarative_lexer.ml"

  | 38 ->
# 465 "src/reason-parser/reason_declarative_lexer.mll"
         ( EQUALGREATER )
# 2820 "src/reason-parser/reason_declarative_lexer.ml"

  | 39 ->
# 467 "src/reason-parser/reason_declarative_lexer.mll"
                                                     (
    set_lexeme_length lexbuf 2;
    EQUALGREATER
  )
# 2828 "src/reason-parser/reason_declarative_lexer.ml"

  | 40 ->
# 471 "src/reason-parser/reason_declarative_lexer.mll"
         ( SHARP )
# 2833 "src/reason-parser/reason_declarative_lexer.ml"

  | 41 ->
# 472 "src/reason-parser/reason_declarative_lexer.mll"
         ( DOT )
# 2838 "src/reason-parser/reason_declarative_lexer.ml"

  | 42 ->
# 473 "src/reason-parser/reason_declarative_lexer.mll"
         ( DOTDOT )
# 2843 "src/reason-parser/reason_declarative_lexer.ml"

  | 43 ->
# 474 "src/reason-parser/reason_declarative_lexer.mll"
         ( DOTDOTDOT )
# 2848 "src/reason-parser/reason_declarative_lexer.ml"

  | 44 ->
# 475 "src/reason-parser/reason_declarative_lexer.mll"
         ( COLON )
# 2853 "src/reason-parser/reason_declarative_lexer.ml"

  | 45 ->
# 476 "src/reason-parser/reason_declarative_lexer.mll"
         ( COLONCOLON )
# 2858 "src/reason-parser/reason_declarative_lexer.ml"

  | 46 ->
# 477 "src/reason-parser/reason_declarative_lexer.mll"
         ( COLONEQUAL )
# 2863 "src/reason-parser/reason_declarative_lexer.ml"

  | 47 ->
# 478 "src/reason-parser/reason_declarative_lexer.mll"
         ( COLONGREATER )
# 2868 "src/reason-parser/reason_declarative_lexer.ml"

  | 48 ->
# 479 "src/reason-parser/reason_declarative_lexer.mll"
         ( SEMI )
# 2873 "src/reason-parser/reason_declarative_lexer.ml"

  | 49 ->
# 480 "src/reason-parser/reason_declarative_lexer.mll"
         ( SEMISEMI )
# 2878 "src/reason-parser/reason_declarative_lexer.ml"

  | 50 ->
# 481 "src/reason-parser/reason_declarative_lexer.mll"
         ( LESS )
# 2883 "src/reason-parser/reason_declarative_lexer.ml"

  | 51 ->
# 482 "src/reason-parser/reason_declarative_lexer.mll"
         ( EQUAL )
# 2888 "src/reason-parser/reason_declarative_lexer.ml"

  | 52 ->
# 483 "src/reason-parser/reason_declarative_lexer.mll"
         ( LBRACKET )
# 2893 "src/reason-parser/reason_declarative_lexer.ml"

  | 53 ->
# 484 "src/reason-parser/reason_declarative_lexer.mll"
         ( LBRACKETBAR )
# 2898 "src/reason-parser/reason_declarative_lexer.ml"

  | 54 ->
# 485 "src/reason-parser/reason_declarative_lexer.mll"
         ( LBRACKETLESS )
# 2903 "src/reason-parser/reason_declarative_lexer.ml"

  | 55 ->
# 486 "src/reason-parser/reason_declarative_lexer.mll"
         ( LBRACKETGREATER )
# 2908 "src/reason-parser/reason_declarative_lexer.ml"

  | 56 ->
let
# 487 "src/reason-parser/reason_declarative_lexer.mll"
                                                               tag
# 2914 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_start_pos + 1) lexbuf.Lexing.lex_curr_pos in
# 488 "src/reason-parser/reason_declarative_lexer.mll"
    ( LESSIDENT tag )
# 2918 "src/reason-parser/reason_declarative_lexer.ml"

  | 57 ->
# 489 "src/reason-parser/reason_declarative_lexer.mll"
           ( GREATERDOTDOTDOT )
# 2923 "src/reason-parser/reason_declarative_lexer.ml"

  | 58 ->
# 499 "src/reason-parser/reason_declarative_lexer.mll"
    ( set_lexeme_length lexbuf 2;
      LBRACELESS
    )
# 2930 "src/reason-parser/reason_declarative_lexer.ml"

  | 59 ->
# 503 "src/reason-parser/reason_declarative_lexer.mll"
    ( (* allows parsing of `{<Text` in <Description term={<Text text="Age" />}>
         as correct jsx
       *)
      set_lexeme_length lexbuf 1;
      LBRACE
    )
# 2940 "src/reason-parser/reason_declarative_lexer.ml"

  | 60 ->
# 509 "src/reason-parser/reason_declarative_lexer.mll"
          (
    set_lexeme_length lexbuf 1;
    LBRACE
  )
# 2948 "src/reason-parser/reason_declarative_lexer.ml"

  | 61 ->
# 513 "src/reason-parser/reason_declarative_lexer.mll"
           (
    set_lexeme_length lexbuf 2;
    LBRACELESS
  )
# 2956 "src/reason-parser/reason_declarative_lexer.ml"

  | 62 ->
let
# 517 "src/reason-parser/reason_declarative_lexer.mll"
                                                               tag
# 2962 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) lexbuf.Lexing.lex_mem.(1) in
# 518 "src/reason-parser/reason_declarative_lexer.mll"
    ( LESSSLASHIDENTGREATER tag )
# 2966 "src/reason-parser/reason_declarative_lexer.ml"

  | 63 ->
# 519 "src/reason-parser/reason_declarative_lexer.mll"
         ( RBRACKET )
# 2971 "src/reason-parser/reason_declarative_lexer.ml"

  | 64 ->
# 520 "src/reason-parser/reason_declarative_lexer.mll"
         ( LBRACE )
# 2976 "src/reason-parser/reason_declarative_lexer.ml"

  | 65 ->
# 521 "src/reason-parser/reason_declarative_lexer.mll"
         ( LBRACELESS )
# 2981 "src/reason-parser/reason_declarative_lexer.ml"

  | 66 ->
# 522 "src/reason-parser/reason_declarative_lexer.mll"
         ( BAR )
# 2986 "src/reason-parser/reason_declarative_lexer.ml"

  | 67 ->
# 523 "src/reason-parser/reason_declarative_lexer.mll"
         ( BARBAR )
# 2991 "src/reason-parser/reason_declarative_lexer.ml"

  | 68 ->
# 524 "src/reason-parser/reason_declarative_lexer.mll"
         ( BARRBRACKET )
# 2996 "src/reason-parser/reason_declarative_lexer.ml"

  | 69 ->
# 525 "src/reason-parser/reason_declarative_lexer.mll"
         ( GREATER )
# 3001 "src/reason-parser/reason_declarative_lexer.ml"

  | 70 ->
# 531 "src/reason-parser/reason_declarative_lexer.mll"
         ( RBRACE )
# 3006 "src/reason-parser/reason_declarative_lexer.ml"

  | 71 ->
# 532 "src/reason-parser/reason_declarative_lexer.mll"
         ( GREATERRBRACE )
# 3011 "src/reason-parser/reason_declarative_lexer.ml"

  | 72 ->
# 534 "src/reason-parser/reason_declarative_lexer.mll"
    ( (* allow `let x=<div />;` *)
      set_lexeme_length lexbuf 1;
      EQUAL
    )
# 3019 "src/reason-parser/reason_declarative_lexer.ml"

  | 73 ->
# 539 "src/reason-parser/reason_declarative_lexer.mll"
    ( (* jsx in arrays: [|<div />|]*)
      set_lexeme_length lexbuf 2;
      SLASHGREATER
    )
# 3027 "src/reason-parser/reason_declarative_lexer.ml"

  | 74 ->
# 544 "src/reason-parser/reason_declarative_lexer.mll"
    ( set_lexeme_length lexbuf 2;
      LBRACKETBAR
    )
# 3034 "src/reason-parser/reason_declarative_lexer.ml"

  | 75 ->
# 549 "src/reason-parser/reason_declarative_lexer.mll"
    ( (* allow parsing of <div asd=1></div> *)
      set_lexeme_length lexbuf 2;
      SLASHGREATER
    )
# 3042 "src/reason-parser/reason_declarative_lexer.ml"

  | 76 ->
# 554 "src/reason-parser/reason_declarative_lexer.mll"
    ( (* allow parsing of <div asd=1></div> *)
      set_lexeme_length lexbuf 1;
      GREATER
    )
# 3050 "src/reason-parser/reason_declarative_lexer.ml"

  | 77 ->
# 559 "src/reason-parser/reason_declarative_lexer.mll"
    ( (* allow parsing of <div><span> *)
      set_lexeme_length lexbuf 1;
      GREATER
    )
# 3058 "src/reason-parser/reason_declarative_lexer.ml"

  | 78 ->
# 563 "src/reason-parser/reason_declarative_lexer.mll"
         ( LBRACKETAT )
# 3063 "src/reason-parser/reason_declarative_lexer.ml"

  | 79 ->
# 564 "src/reason-parser/reason_declarative_lexer.mll"
         ( LBRACKETPERCENT )
# 3068 "src/reason-parser/reason_declarative_lexer.ml"

  | 80 ->
# 565 "src/reason-parser/reason_declarative_lexer.mll"
          ( LBRACKETPERCENTPERCENT )
# 3073 "src/reason-parser/reason_declarative_lexer.ml"

  | 81 ->
# 566 "src/reason-parser/reason_declarative_lexer.mll"
         ( BANG )
# 3078 "src/reason-parser/reason_declarative_lexer.ml"

  | 82 ->
# 567 "src/reason-parser/reason_declarative_lexer.mll"
         ( INFIXOP0 "!=" )
# 3083 "src/reason-parser/reason_declarative_lexer.ml"

  | 83 ->
# 568 "src/reason-parser/reason_declarative_lexer.mll"
          ( INFIXOP0 "!==" )
# 3088 "src/reason-parser/reason_declarative_lexer.ml"

  | 84 ->
# 569 "src/reason-parser/reason_declarative_lexer.mll"
           ( INFIXOP0 "!=" )
# 3093 "src/reason-parser/reason_declarative_lexer.ml"

  | 85 ->
# 570 "src/reason-parser/reason_declarative_lexer.mll"
            ( INFIXOP0 "!==" )
# 3098 "src/reason-parser/reason_declarative_lexer.ml"

  | 86 ->
# 571 "src/reason-parser/reason_declarative_lexer.mll"
         ( PLUS )
# 3103 "src/reason-parser/reason_declarative_lexer.ml"

  | 87 ->
# 572 "src/reason-parser/reason_declarative_lexer.mll"
         ( PLUSDOT )
# 3108 "src/reason-parser/reason_declarative_lexer.ml"

  | 88 ->
# 573 "src/reason-parser/reason_declarative_lexer.mll"
         ( PLUSEQ )
# 3113 "src/reason-parser/reason_declarative_lexer.ml"

  | 89 ->
# 574 "src/reason-parser/reason_declarative_lexer.mll"
         ( MINUS )
# 3118 "src/reason-parser/reason_declarative_lexer.ml"

  | 90 ->
# 575 "src/reason-parser/reason_declarative_lexer.mll"
         ( MINUSDOT )
# 3123 "src/reason-parser/reason_declarative_lexer.ml"

  | 91 ->
# 576 "src/reason-parser/reason_declarative_lexer.mll"
         ( LESSGREATER )
# 3128 "src/reason-parser/reason_declarative_lexer.ml"

  | 92 ->
# 577 "src/reason-parser/reason_declarative_lexer.mll"
          ( LESSSLASHGREATER )
# 3133 "src/reason-parser/reason_declarative_lexer.ml"

  | 93 ->
# 578 "src/reason-parser/reason_declarative_lexer.mll"
           ( LESSDOTDOTGREATER )
# 3138 "src/reason-parser/reason_declarative_lexer.ml"

  | 94 ->
# 580 "src/reason-parser/reason_declarative_lexer.mll"
    ( PREFIXOP (lexeme_operator lexbuf) )
# 3143 "src/reason-parser/reason_declarative_lexer.ml"

  | 95 ->
# 582 "src/reason-parser/reason_declarative_lexer.mll"
    ( INFIXOP0 (lexeme_operator lexbuf) )
# 3148 "src/reason-parser/reason_declarative_lexer.ml"

  | 96 ->
# 584 "src/reason-parser/reason_declarative_lexer.mll"
    ( INFIXOP1 (lexeme_operator lexbuf) )
# 3153 "src/reason-parser/reason_declarative_lexer.ml"

  | 97 ->
# 586 "src/reason-parser/reason_declarative_lexer.mll"
    ( match lexeme_without_comment lexbuf with
      | "^." | "^|" ->
        (* ^| is not an infix op in [|a^|] *)
        set_lexeme_length lexbuf
          (if Lexing.lexeme_char lexbuf 0 = '\\' then 2 else 1);
        POSTFIXOP "^"
      | "^" -> POSTFIXOP "^"
      | op -> INFIXOP1 (unescape_operator op)
    )
# 3166 "src/reason-parser/reason_declarative_lexer.ml"

  | 98 ->
# 596 "src/reason-parser/reason_declarative_lexer.mll"
    ( INFIXOP1 (lexeme_operator lexbuf) )
# 3171 "src/reason-parser/reason_declarative_lexer.ml"

  | 99 ->
# 598 "src/reason-parser/reason_declarative_lexer.mll"
    ( INFIXOP2 (lexeme_operator lexbuf) )
# 3176 "src/reason-parser/reason_declarative_lexer.ml"

  | 100 ->
# 600 "src/reason-parser/reason_declarative_lexer.mll"
         ( SLASHGREATER )
# 3181 "src/reason-parser/reason_declarative_lexer.ml"

  | 101 ->
# 611 "src/reason-parser/reason_declarative_lexer.mll"
    ( INFIXOP4 (lexeme_operator lexbuf) )
# 3186 "src/reason-parser/reason_declarative_lexer.ml"

  | 102 ->
# 612 "src/reason-parser/reason_declarative_lexer.mll"
        ( PERCENT )
# 3191 "src/reason-parser/reason_declarative_lexer.ml"

  | 103 ->
# 614 "src/reason-parser/reason_declarative_lexer.mll"
    ( match lexeme_operator lexbuf with
      | "" ->
          (* If the operator is empty, it means the lexeme is beginning
           * by a comment sequence: we let the comment lexer handle
           * the case. *)
          enter_comment state lexbuf
      | op -> INFIXOP3 op )
# 3202 "src/reason-parser/reason_declarative_lexer.ml"

  | 104 ->
# 622 "src/reason-parser/reason_declarative_lexer.mll"
    ( INFIXOP3 (lexeme_operator lexbuf) )
# 3207 "src/reason-parser/reason_declarative_lexer.ml"

  | 105 ->
# 623 "src/reason-parser/reason_declarative_lexer.mll"
        ( EOF )
# 3212 "src/reason-parser/reason_declarative_lexer.ml"

  | 106 ->
# 625 "src/reason-parser/reason_declarative_lexer.mll"
    ( raise_error
        (Location.curr lexbuf)
        (Illegal_character (Lexing.lexeme_char lexbuf 0));
      token state lexbuf
    )
# 3221 "src/reason-parser/reason_declarative_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_token_rec state lexbuf __ocaml_lex_state

and enter_comment state lexbuf =
   __ocaml_lex_enter_comment_rec state lexbuf 188
and __ocaml_lex_enter_comment_rec state lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
let
# 632 "src/reason-parser/reason_declarative_lexer.mll"
                                line
# 3234 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_start_pos + 2) lexbuf.Lexing.lex_curr_pos in
# 633 "src/reason-parser/reason_declarative_lexer.mll"
    ( update_loc lexbuf None 1 false 0;
      let physical_loc = Location.curr lexbuf in
      let location = { physical_loc with
        loc_end = { physical_loc.loc_end with
          (* Don't track trailing `\n` in the location
           * 1| // comment
           * 2| let x = 1;
           * By omitting the `\n` at the end of line 1, the location of the
           * comment spans line 1. Otherwise the comment on line 1 would end
           * on the second line. The printer looks at the closing pos_lnum
           * location to interleave whitespace correct. It needs to align
           * with what we visually see (i.e. it ends on line 1) *)
          pos_lnum = physical_loc.loc_end.pos_lnum - 1;
          pos_cnum = physical_loc.loc_end.pos_cnum + 1;
      }} in
      COMMENT (line, location)
    )
# 3254 "src/reason-parser/reason_declarative_lexer.ml"

  | 1 ->
let
# 650 "src/reason-parser/reason_declarative_lexer.mll"
                            line
# 3260 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_start_pos + 2) lexbuf.Lexing.lex_curr_pos in
# 651 "src/reason-parser/reason_declarative_lexer.mll"
    ( update_loc lexbuf None 1 false 0;
      let physical_loc = Location.curr lexbuf in
      let location = { physical_loc with
        loc_end = { physical_loc.loc_end with
          pos_lnum = physical_loc.loc_end.pos_lnum - 1;
          pos_cnum = physical_loc.loc_end.pos_cnum + 1;
      }} in
      COMMENT (line, location)
    )
# 3272 "src/reason-parser/reason_declarative_lexer.ml"

  | 2 ->
# 661 "src/reason-parser/reason_declarative_lexer.mll"
    ( set_lexeme_length lexbuf 2;
      let loc = Location.curr lexbuf in
      let raw_buffer, _ = get_scratch_buffers state in
      ignore (comment raw_buffer loc loc lexbuf : bool);
      lexbuf.Lexing.lex_start_p <- loc.Location.loc_start;
      let loc_end = lexbuf.Lexing.lex_curr_p in
      COMMENT (flush_buffer raw_buffer,
               {loc with Location.loc_end})
    )
# 3285 "src/reason-parser/reason_declarative_lexer.ml"

  | 3 ->
# 671 "src/reason-parser/reason_declarative_lexer.mll"
    ( let loc = Location.curr lexbuf in
      let raw_buffer, _ = get_scratch_buffers state in
      ignore (comment raw_buffer loc loc lexbuf : bool);
      lexbuf.Lexing.lex_start_p <- loc.Location.loc_start;
      DOCSTRING (flush_buffer raw_buffer)
    )
# 3295 "src/reason-parser/reason_declarative_lexer.ml"

  | 4 ->
# 678 "src/reason-parser/reason_declarative_lexer.mll"
    ( DOCSTRING "" )
# 3300 "src/reason-parser/reason_declarative_lexer.ml"

  | 5 ->
# 680 "src/reason-parser/reason_declarative_lexer.mll"
    ( let loc = Location.curr lexbuf in
      Location.prerr_warning loc Warnings.Comment_start;
      let raw_buffer, _ = get_scratch_buffers state in
      ignore (comment raw_buffer loc loc lexbuf : bool);
      let loc_end = lexbuf.Lexing.lex_curr_p in
      COMMENT (flush_buffer raw_buffer,
               {loc with Location.loc_end})
    )
# 3312 "src/reason-parser/reason_declarative_lexer.ml"

  | 6 ->
# 689 "src/reason-parser/reason_declarative_lexer.mll"
    ( let loc = Location.curr lexbuf in
      Location.prerr_warning loc Warnings.Comment_not_end;
      set_lexeme_length lexbuf 1;
      STAR
    )
# 3321 "src/reason-parser/reason_declarative_lexer.ml"

  | 7 ->
# 694 "src/reason-parser/reason_declarative_lexer.mll"
      ( assert false )
# 3326 "src/reason-parser/reason_declarative_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_enter_comment_rec state lexbuf __ocaml_lex_state

and comment buffer firstloc nestedloc lexbuf =
   __ocaml_lex_comment_rec buffer firstloc nestedloc lexbuf 201
and __ocaml_lex_comment_rec buffer firstloc nestedloc lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 703 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme buffer lexbuf;
      if comment buffer firstloc (Location.curr lexbuf) lexbuf then (
        store_lexeme buffer lexbuf;
        comment buffer firstloc nestedloc lexbuf
      )
      else
        false
    )
# 3345 "src/reason-parser/reason_declarative_lexer.ml"

  | 1 ->
# 712 "src/reason-parser/reason_declarative_lexer.mll"
    ( true )
# 3350 "src/reason-parser/reason_declarative_lexer.ml"

  | 2 ->
# 714 "src/reason-parser/reason_declarative_lexer.mll"
    ( Buffer.add_char buffer '"';
      let string_start = Location.curr lexbuf in
      let terminated_string = string buffer None lexbuf in
      Buffer.add_char buffer '"';
      if terminated_string then
        comment buffer firstloc nestedloc lexbuf
      else (
        raise_error nestedloc
          (Unterminated_string_in_comment (firstloc, string_start));
        false
      )
    )
# 3366 "src/reason-parser/reason_declarative_lexer.ml"

  | 3 ->
let
# 726 "src/reason-parser/reason_declarative_lexer.mll"
                       delim
# 3372 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_start_pos + 1) (lexbuf.Lexing.lex_curr_pos + -1) in
# 727 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme buffer lexbuf;
      let stringloc = Location.curr lexbuf in
      let terminated_string = quoted_string buffer delim lexbuf in
      Buffer.add_char buffer '|';
      Buffer.add_string buffer delim;
      Buffer.add_char buffer '}';
      if terminated_string then
        comment buffer firstloc nestedloc lexbuf
      else (
        raise_error nestedloc
          (Unterminated_string_in_comment (firstloc, stringloc));
        false
      )
    )
# 3389 "src/reason-parser/reason_declarative_lexer.ml"

  | 4 ->
# 742 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme buffer lexbuf;
      comment buffer firstloc nestedloc lexbuf
    )
# 3396 "src/reason-parser/reason_declarative_lexer.ml"

  | 5 ->
# 746 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme buffer lexbuf;
      update_loc lexbuf None 1 false 1;
      comment buffer firstloc nestedloc lexbuf
    )
# 3404 "src/reason-parser/reason_declarative_lexer.ml"

  | 6 ->
# 754 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme buffer lexbuf;
      comment buffer firstloc nestedloc lexbuf
    )
# 3411 "src/reason-parser/reason_declarative_lexer.ml"

  | 7 ->
# 758 "src/reason-parser/reason_declarative_lexer.mll"
    ( raise_error nestedloc (Unterminated_comment firstloc);
      false
    )
# 3418 "src/reason-parser/reason_declarative_lexer.ml"

  | 8 ->
# 762 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme buffer lexbuf;
      update_loc lexbuf None 1 false 0;
      comment buffer firstloc nestedloc lexbuf
    )
# 3426 "src/reason-parser/reason_declarative_lexer.ml"

  | 9 ->
# 767 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme buffer lexbuf;
      comment buffer firstloc nestedloc lexbuf
    )
# 3433 "src/reason-parser/reason_declarative_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_comment_rec buffer firstloc nestedloc lexbuf __ocaml_lex_state

and string rawbuf txtbuf lexbuf =
  lexbuf.Lexing.lex_mem <- Array.make 2 (-1); __ocaml_lex_string_rec rawbuf txtbuf lexbuf 230
and __ocaml_lex_string_rec rawbuf txtbuf lexbuf __ocaml_lex_state =
  match Lexing.new_engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 782 "src/reason-parser/reason_declarative_lexer.mll"
    ( true )
# 3445 "src/reason-parser/reason_declarative_lexer.ml"

  | 1 ->
let
# 783 "src/reason-parser/reason_declarative_lexer.mll"
                                  space
# 3451 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf lexbuf.Lexing.lex_mem.(0) lexbuf.Lexing.lex_curr_pos in
# 784 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme rawbuf lexbuf;
      update_loc lexbuf None 1 false (String.length space);
      string rawbuf txtbuf lexbuf
    )
# 3458 "src/reason-parser/reason_declarative_lexer.ml"

  | 2 ->
let
# 788 "src/reason-parser/reason_declarative_lexer.mll"
                                                 c
# 3464 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme_char lexbuf (lexbuf.Lexing.lex_start_pos + 1) in
# 789 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme rawbuf lexbuf;
      begin match txtbuf with
      | None -> ()
      | Some buf -> Buffer.add_char buf (char_for_backslash c);
      end;
      string rawbuf txtbuf lexbuf
    )
# 3474 "src/reason-parser/reason_declarative_lexer.ml"

  | 3 ->
# 797 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme rawbuf lexbuf;
      begin match txtbuf with
      | None -> ()
      | Some buf -> Buffer.add_char buf (char_for_decimal_code lexbuf 1);
      end;
      string rawbuf txtbuf lexbuf
    )
# 3485 "src/reason-parser/reason_declarative_lexer.ml"

  | 4 ->
# 805 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme rawbuf lexbuf;
      begin match txtbuf with
      | None -> ()
      | Some buf -> Buffer.add_char buf (char_for_hexadecimal_code lexbuf 2);
      end;
      string rawbuf txtbuf lexbuf
    )
# 3496 "src/reason-parser/reason_declarative_lexer.ml"

  | 5 ->
# 813 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme rawbuf lexbuf;
      begin match txtbuf with
      | None -> ()
      | Some buf ->
         store_lexeme buf lexbuf;
         (*  FIXME: Warnings should probably go in Reason_errors
            Should be an error, but we are very lax.
              raise (Error (Illegal_escape (Lexing.lexeme lexbuf),
                        Location.curr lexbuf))
           FIXME Using Location relies too much on compiler internals
          *)
         Location.prerr_warning (Location.curr lexbuf)
           Warnings.Illegal_backslash;
      end;
      string rawbuf txtbuf lexbuf
    )
# 3516 "src/reason-parser/reason_declarative_lexer.ml"

  | 6 ->
# 830 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme rawbuf lexbuf;
      begin match txtbuf with
      | None -> ()
      | Some buf ->
        store_lexeme buf lexbuf;
        Location.prerr_warning (Location.curr lexbuf)
          Warnings.Eol_in_string
      end;
      update_loc lexbuf None 1 false 0;
      string rawbuf txtbuf lexbuf
    )
# 3531 "src/reason-parser/reason_declarative_lexer.ml"

  | 7 ->
# 842 "src/reason-parser/reason_declarative_lexer.mll"
    ( false )
# 3536 "src/reason-parser/reason_declarative_lexer.ml"

  | 8 ->
# 844 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme rawbuf lexbuf;
      begin match txtbuf with
      | None -> ()
      | Some buf -> Buffer.add_char buf (Lexing.lexeme_char lexbuf 0);
      end;
      string rawbuf txtbuf lexbuf
    )
# 3547 "src/reason-parser/reason_declarative_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_string_rec rawbuf txtbuf lexbuf __ocaml_lex_state

and quoted_string buffer delim lexbuf =
   __ocaml_lex_quoted_string_rec buffer delim lexbuf 249
and __ocaml_lex_quoted_string_rec buffer delim lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 863 "src/reason-parser/reason_declarative_lexer.mll"
    ( store_lexeme buffer lexbuf;
      update_loc lexbuf None 1 false 0;
      quoted_string buffer delim lexbuf
    )
# 3562 "src/reason-parser/reason_declarative_lexer.ml"

  | 1 ->
# 868 "src/reason-parser/reason_declarative_lexer.mll"
    ( false )
# 3567 "src/reason-parser/reason_declarative_lexer.ml"

  | 2 ->
let
# 869 "src/reason-parser/reason_declarative_lexer.mll"
                       edelim
# 3573 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme lexbuf (lexbuf.Lexing.lex_start_pos + 1) (lexbuf.Lexing.lex_curr_pos + -1) in
# 870 "src/reason-parser/reason_declarative_lexer.mll"
    ( if delim = edelim then
        true
      else (
        store_lexeme buffer lexbuf;
        quoted_string buffer delim lexbuf
      )
    )
# 3583 "src/reason-parser/reason_declarative_lexer.ml"

  | 3 ->
let
# 877 "src/reason-parser/reason_declarative_lexer.mll"
         c
# 3589 "src/reason-parser/reason_declarative_lexer.ml"
= Lexing.sub_lexeme_char lexbuf lexbuf.Lexing.lex_start_pos in
# 878 "src/reason-parser/reason_declarative_lexer.mll"
    ( Buffer.add_char buffer c;
      quoted_string buffer delim lexbuf
    )
# 3595 "src/reason-parser/reason_declarative_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_quoted_string_rec buffer delim lexbuf __ocaml_lex_state

and skip_sharp_bang lexbuf =
   __ocaml_lex_skip_sharp_bang_rec lexbuf 258
and __ocaml_lex_skip_sharp_bang_rec lexbuf __ocaml_lex_state =
  match Lexing.engine __ocaml_lex_tables __ocaml_lex_state lexbuf with
      | 0 ->
# 884 "src/reason-parser/reason_declarative_lexer.mll"
       ( update_loc lexbuf None 3 false 0 )
# 3607 "src/reason-parser/reason_declarative_lexer.ml"

  | 1 ->
# 886 "src/reason-parser/reason_declarative_lexer.mll"
       ( update_loc lexbuf None 1 false 0 )
# 3612 "src/reason-parser/reason_declarative_lexer.ml"

  | 2 ->
# 887 "src/reason-parser/reason_declarative_lexer.mll"
       ( () )
# 3617 "src/reason-parser/reason_declarative_lexer.ml"

  | __ocaml_lex_state -> lexbuf.Lexing.refill_buff lexbuf;
      __ocaml_lex_skip_sharp_bang_rec lexbuf __ocaml_lex_state

;;


end
module Reason_lexer : sig 
#1 "reason_lexer.mli"
open Reason_parser

type t
type 'a positioned = 'a * Lexing.position * Lexing.position

val init : ?insert_completion_ident:Lexing.position -> Lexing.lexbuf -> t
val token : t -> token positioned
val lexbuf : t -> Lexing.lexbuf

type comment = string * Location.t

(* Some docstrings are not accepted by the parser
   and turned into comments. *)
type invalid_docstrings
val empty_invalid_docstrings : invalid_docstrings
val add_invalid_docstring :
  string -> Lexing.position -> Lexing.position ->
  invalid_docstrings -> invalid_docstrings

val get_comments : t -> invalid_docstrings -> comment list

end = struct
#1 "reason_lexer.ml"
open Reason_parser

type 'a positioned = 'a * Lexing.position * Lexing.position

type t = {
  declarative_lexer_state: Reason_declarative_lexer.state;
  lexbuf: Lexing.lexbuf;
  mutable comments: (string * Location.t) list;
  mutable queued_tokens: token positioned list;
  mutable queued_exn: exn option;
  mutable last_cnum: int;
  mutable completion_ident_offset: int;
  completion_ident_pos: Lexing.position
}

let init ?insert_completion_ident lexbuf =
  let declarative_lexer_state = Reason_declarative_lexer.make () in
  let completion_ident_offset, completion_ident_pos =
    match insert_completion_ident with
    | None -> (min_int, Lexing.dummy_pos)
    | Some pos -> (pos.Lexing.pos_cnum, pos)
  in
  { declarative_lexer_state; lexbuf;
    comments = [];
    queued_tokens = [];
    queued_exn = None;
    last_cnum = -1;
    completion_ident_offset;
    completion_ident_pos;
  }

let lexbuf state = state.lexbuf

let rec token state =
  match
    Reason_declarative_lexer.token
      state.declarative_lexer_state state.lexbuf
  with
  | COMMENT (s, comment_loc) ->
     state.comments <- (s, comment_loc) :: state.comments;
     token state
  | tok -> tok

(* Routines for manipulating lexer state *)

let save_triple lexbuf tok =
  (tok, lexbuf.Lexing.lex_start_p, lexbuf.Lexing.lex_curr_p)

let fake_triple t (_, pos, _) =
  (t, pos, pos)

(* insert ES6_FUN *)

exception Lex_balanced_failed of token positioned list * exn option

let closing_of = function
  | LPAREN -> RPAREN
  | LBRACE -> RBRACE
  | _ -> assert false

let inject_es6_fun = function
  | tok :: acc ->
    tok :: fake_triple ES6_FUN tok :: acc
  | _ -> assert false

let is_triggering_token = function
  | EQUALGREATER | COLON -> true
  | _ -> false

let rec lex_balanced_step state closing acc tok =
  let lexbuf = state.lexbuf in
  let acc = save_triple lexbuf tok :: acc in
  match tok, closing with
  | (RPAREN, RPAREN) | (RBRACE, RBRACE) | (RBRACKET, RBRACKET) ->
    acc
  | ((RPAREN | RBRACE | RBRACKET | EOF), _) ->
    raise (Lex_balanced_failed (acc, None))
  | (( LBRACKET | LBRACKETLESS | LBRACKETGREATER
     | LBRACKETAT
     | LBRACKETPERCENT | LBRACKETPERCENTPERCENT ), _) ->
    lex_balanced state closing (lex_balanced state RBRACKET acc)
  | ((LPAREN | LBRACE), _) ->
    let rparen =
      try lex_balanced state (closing_of tok) []
      with (Lex_balanced_failed (rparen, None)) ->
        raise (Lex_balanced_failed (rparen @ acc, None))
    in
    begin match token state with
    | exception exn ->
      raise (Lex_balanced_failed (rparen @ acc, Some exn))
    | tok' ->
      let acc = if is_triggering_token tok' then inject_es6_fun acc else acc in
      lex_balanced_step state closing (rparen @ acc) tok'
    end
  | ((LIDENT _ | UNDERSCORE), _) ->
    begin match token state with
    | exception exn ->
      raise (Lex_balanced_failed (acc, Some exn))
    | tok' ->
      let acc = if is_triggering_token tok' then inject_es6_fun acc else acc in
      lex_balanced_step state closing acc tok'
    end
  (* `...` with a closing `}` indicates that we're definitely not in an es6_fun
   * Image the following:
   *    true ? (Update({...a, b: 1}), None) : x;
   *    true ? ({...a, b: 1}) : a;
   *    true ? (a, {...a, b: 1}) : a;
   * The lookahead_esfun is triggered initiating the lex_balanced procedure.
   * Since we now "over"-parse spread operators in pattern position (for
   * better errors), the ... pattern in ({...a, b: 1}) is now a valid path.
   * This means that the above expression `({...a, b: 1}) :` is seen as a pattern.
   * I.e. the arguments of an es6 function: (pattern) :type => expr
   * We exit here, to indicate that an expression needs to be parsed instead
   * of a pattern.
   *)
  | (DOTDOTDOT, RBRACE) -> acc
  | _ -> lex_balanced state closing acc

and lex_balanced state closing acc =
  match token state with
  | exception exn ->
    raise (Lex_balanced_failed (acc, Some exn))
  | tok -> lex_balanced_step state closing acc tok

let lookahead_esfun state (tok, _, _ as lparen) =
  match lex_balanced state (closing_of tok) [] with
  | exception (Lex_balanced_failed (tokens, exn)) ->
     state.queued_tokens <- List.rev tokens;
     state.queued_exn <- exn;
     lparen
  | tokens ->
     begin match token state with
     | exception exn ->
        state.queued_tokens <- List.rev tokens;
        state.queued_exn <- Some exn;
        lparen
     | token ->
        let tokens = save_triple state.lexbuf token :: tokens in
        if is_triggering_token token then (
          state.queued_tokens <- lparen :: List.rev tokens;
          fake_triple ES6_FUN lparen
        ) else (
          state.queued_tokens <- List.rev tokens;
          lparen
        )
     end

let token state =
  let lexbuf = state.lexbuf in
  match state.queued_tokens, state.queued_exn with
  | [], Some exn ->
    state.queued_exn <- None;
    raise exn
  | [(LPAREN, _, _) as lparen], None ->
    lookahead_esfun state lparen
  | [(LBRACE, _, _) as lparen], None ->
    lookahead_esfun state lparen
  | [], None ->
    begin match token state with
    | LPAREN | LBRACE as tok ->
        lookahead_esfun state (save_triple state.lexbuf tok)
    | (LIDENT _ | UNDERSCORE) as tok ->
        let tok = save_triple lexbuf tok in
        begin match token state with
        | exception exn ->
           state.queued_exn <- Some exn;
           tok
        | tok' ->
          if is_triggering_token tok' then (
            state.queued_tokens <- [tok; save_triple lexbuf tok'];
            fake_triple ES6_FUN tok
          ) else (
            state.queued_tokens <- [save_triple lexbuf tok'];
            tok
          )
        end
    | token -> save_triple lexbuf token
    end
  | x :: xs, _ ->
    state.queued_tokens <- xs; x

let token state =
  let space_start = state.last_cnum in
  let (token', start_p, curr_p) as token = token state in
  let token_start = start_p.Lexing.pos_cnum in
  let token_stop = curr_p.Lexing.pos_cnum in
  state.last_cnum <- token_stop;
  if state.completion_ident_offset > min_int &&
     space_start <= state.completion_ident_offset &&
     token_stop >= state.completion_ident_offset then (
    match token' with
    | LIDENT _ | UIDENT _
      when token_start <= state.completion_ident_offset ->
      state.completion_ident_offset <- min_int;
      token
    | _ ->
      state.queued_tokens <- token :: state.queued_tokens;
      state.completion_ident_offset <- min_int;
      (LIDENT "_", state.completion_ident_pos, state.completion_ident_pos)
  ) else
    token

type comment = string * Location.t
type invalid_docstrings = comment list

let empty_invalid_docstrings = []

let add_invalid_docstring text loc_start loc_end invalid_docstrings =
  let loc = {Location. loc_start; loc_end; loc_ghost = false} in
  ((text, loc) :: invalid_docstrings)

let get_comments state invalid_docstrings =
  let cnum (_, loc) = loc.Location.loc_start.Lexing.pos_cnum in
  let rec merge_comments acc = function
    | [], xs | xs, [] -> List.rev_append xs acc
    | ((x :: _) as xs), (y :: ys) when cnum x >= cnum y ->
      merge_comments (y :: acc) (xs, ys)
    | x :: xs, ys ->
      merge_comments (x :: acc) (xs, ys)
  in
  merge_comments [] (state.comments, invalid_docstrings)

end
module Reason_heuristics
= struct
#1 "reason_heuristics.ml"
open Migrate_parsetree

let is_punned_labelled_expression e lbl =
  let open Ast_404.Parsetree in
  match e.pexp_desc with
  | Pexp_ident { txt }
  | Pexp_constraint ({pexp_desc = Pexp_ident { txt }}, _)
  | Pexp_coerce ({pexp_desc = Pexp_ident { txt }}, _, _)
    -> txt = Longident.parse lbl
  | _ -> false

(* We manually check the length of `Thing.map(foo, bar, baz`,
 * in `Thing.map(foo, bar, baz, (a) => doStuff(a))`
 * because Easyformat doesn't have a hook to change printing when a list breaks
 *
 * we check if all arguments aside from the final one are either strings or identifiers,
 * where the sum of the string contents and identifier names are less than the print width
 *)
let funAppCallbackExceedsWidth ~printWidth ~args ~funExpr () =
  let open Ast_404.Parsetree in
  let open Ast_404.Asttypes in
  let funLen = begin match funExpr.pexp_desc with
    | Pexp_ident ident ->
       let identList = Longident.flatten ident.txt in
       let lengthOfDots = List.length identList - 1 in
       let len = List.fold_left (fun acc curr ->
         acc + (String.length curr)) lengthOfDots identList in
       len
    | _ -> -1
  end in
  (* eats an argument & substract its length from the printWidth
   * as soon as the print width reaches a sub-zero value,
   * we know the print width is exceeded & returns *)
  let rec aux len = function
    | _ when len < 0 -> true
    | [] -> false
    | arg::args ->
      begin match arg with
      | (label, ({ pexp_desc = Pexp_ident ident } as e)) ->
        let identLen = List.fold_left (fun acc curr ->
          acc + (String.length curr)
        ) len (Longident.flatten ident.txt) in
        begin match label with
        | Nolabel -> aux (len - identLen) args
        | Labelled s when is_punned_labelled_expression e s ->
            aux (len - (identLen + 1)) args
        | Labelled s ->
            aux (len - (identLen + 2 + String.length s)) args
        | Optional s ->
            aux (len - (identLen + 3 + String.length s)) args
        end
      | (label, {pexp_desc = Pexp_constant (Pconst_string (str, _))}) ->
        let strLen = String.length str in
        begin match label with
        | Nolabel -> aux (len - strLen) args
        | Labelled s ->
            aux (len - (strLen + 2 + String.length s)) args
        | Optional s ->
            aux (len - (strLen + 3 + String.length s)) args
        end
      | _ ->
        (* if we encounter a non-string or non-identifier argument exit *)
          true
    end
  in
  aux (printWidth - funLen) args

(*
 * Whether or not an identiier is small enough to justify omitting the
 * trailing comma for single identifier patterns. For single identifier
 * patterns, usually the identifier is not "far right" in the document, and
 * is one of the last things to require breaking. We can omit the trailing comma
 * in these cases because it likely will never render anyways and therefore the
 * space taken up by the trailing comma doesn't disrupt wrapping length calculations.
 *
 * For example, the `X` hardly ever benefits from a trailing comma.
 * | X(y) =>
 *)
let singleTokenPatternOmmitTrail txt = String.length txt < 4

(* Indicates whether an expression can be printed with the uncurried
 * dot notation. At the moment uncurried function application & definition
 * only makes sense in the context of a Pexp_apply or Pexp_fun
 *
 * Examples:
 * [@bs] add(2, 3); -> add(. 2, 3);   (* Pexp_apply *)
 * setTimeout([@bs] () => Js.log("hola"), 1000);  (* Pexp_fun *)
 *  -> setTimeout((.) => Js.log("hola"), 1000);
 *)
let bsExprCanBeUncurried expr =
  match Ast_404.Parsetree.(expr.pexp_desc) with
  | Pexp_fun _
  | Pexp_apply _ -> true
  | _ -> false

let isUnderscoreIdent expr =
  match Ast_404.Parsetree.(expr.pexp_desc) with
  | Pexp_ident ({txt = Lident "_"}) -> true
  | _ -> false

let isPipeFirst e = match Ast_404.Parsetree.(e.pexp_desc) with
  | Pexp_ident({txt = Longident.Lident("|.")}) -> true
  | Pexp_apply(
    {pexp_desc = Pexp_ident({txt = Longident.Lident("|.")})},
      _
    ) -> true
  | _ -> false

let isUnderscoreApplication expr =
  let open Ast_404.Parsetree in
  match expr with
  | {pexp_attributes = []; pexp_desc = Pexp_fun(
        Nolabel,
        None,
        {
          ppat_desc = Ppat_var({txt = "__x"});
          ppat_attributes = []
        },
        _
      )
    } -> true
  | _ -> false

(* <div> {items->Belt.Array.map(ReasonReact.string)->ReasonReact.array} </div>;
 * An application with pipe first inside jsx children requires special treatment.
 * Jsx children don't allow expression application, hence we need the braces
 * preserved in this case. *)
let isPipeFirstWithNonSimpleJSXChild e = match Ast_404.Parsetree.(e.pexp_desc) with
  | Pexp_apply(
    {pexp_desc = Pexp_ident({txt = Longident.Lident("|.")})},
      [Nolabel, {pexp_desc = Pexp_apply(_)}; _]
    ) -> true

  (* Handle <div> {url->a(b, _)} </div>;
   * underscore sugar needs protection *)
  | Pexp_apply(
    {pexp_desc = Pexp_ident({txt = Longident.Lident("|.")})},
      [_; Nolabel, fe]
    ) when isUnderscoreApplication fe -> true
  | _ -> false

end
module Reason_location
= struct
#1 "reason_location.ml"
module Comment = Reason_comment

module Range = struct
  (** [t] represents an interval, including endpoints,
   * delimited by two linenumbers. *)
  type t = {
    lnum_start: int;
    lnum_end: int
  }

  (**
   * make a range delimited by [loc1] and [loc2]
   * 1| let a = 1;
   * 2|
   * 3|
   * 4|
   * 5| let b = 2;
   * If loc1 represents `let a = 1` and loc2 represents `let b = 2`,
   * we get the range: {lnum_start: 2; lnum_end 4}
   *)
  let makeRangeBetween loc1 loc2 = Location.{
    lnum_start = loc1.loc_end.pos_lnum + 1;
    lnum_end = loc2.loc_start.pos_lnum - 1;
  }

  (** check whether [range] contains the [loc] *)
  let containsLoc range loc =
    let open Location in
    range.lnum_start <= loc.loc_start.pos_lnum
    && range.lnum_end >= loc.loc_end.pos_lnum

  (**
   * checks if [range] contains whitespace.
   * When comments are passed, the computation
   * takes the height of the comments into account.
   *
   * Example:
   * 1| let a = 1;
   * 2|
   * 3| /* a multi-
   * 4|   line comment */
   * 5| let b = 1;
   * The range (line 2 - line 4) has whitespace.
   *
   * 1| let a = 1;
   * 2| /* a multi-
   * 3|   line comment */
   * 4| let b = 1;
   * The range (line 2 - line 3) does not have whitespace.
   *)
  let containsWhitespace ?comments ~range () =
    (* compute the amount of lines the comments occupy in the given range *)
    let h = match comments with
    | Some(comments) ->
      List.fold_left (fun acc (curr : Comment.t) ->
        let cl = Comment.location curr in
        let open Location in
        let startLnum = cl.loc_start.pos_lnum in
        let endLnum = cl.loc_end.pos_lnum in
        if containsLoc range cl then
          acc + (endLnum - startLnum + 1)
        else acc
        ) 0 comments
    | None -> 0
    in
    range.lnum_end - range.lnum_start - h >= 0
end

(** compute if there's space (one or more line) between [loc1] and [loc2] *)
let hasSpaceBetween loc1 loc2 =
  Location.(loc1.loc_start.pos_lnum - loc2.loc_end.pos_lnum) > 1


end
module Vendored_easy_format : sig 
#1 "vendored_easy_format.mli"
(**
   Easy_format: indentation made easy.
*)

(**
  This module provides a functional, simplified layer over
  the Format module of the standard library.

  Input data must be first modelled as a tree using 3 kinds of nodes:
  - atoms
  - lists
  - labelled nodes

  Atoms represent any text that is guaranteed to be printed as-is.
  Lists can model any sequence of items such as arrays of data
  or lists of definitions that are labelled with something
  like "int main", "let x =" or "x:".
*)

type wrap =
    [ `Wrap_atoms
    | `Always_wrap
    | `Never_wrap
    | `Force_breaks
    | `Force_breaks_rec
    | `No_breaks ]
(** List wrapping conditions:
    - [`Wrap_atoms]: wrap if the list contains only atoms
    - [`Always_wrap]: always wrap when needed
    - [`Never_wrap]: never wrap,
      i.e. the list is either horizontal or vertical
    - [`Force_breaks]: align vertically,
      i.e. always break line between list items and
      align the left edge of each item.
    - [`Force_breaks_rec]: same as [`Force_breaks] but turns
      any wrappable ancestor node's wrap property ([`Wrap_atoms]
      or [`Always_wrap]) into [`Force_breaks].
    - [`No_breaks]: align horizontally,
      i.e. never break line between list items
*)

type label_break = [
  | `Auto
  | `Always
  | `Always_rec
  | `Never
]
(** When to break the line after a [Label]:
    - [Auto]: break after the label if there's not enough room
    - [Always]: always break after the label
    - [Always_rec]: always break after the label and force breaks in all parent
      lists and labels, similarly to [`Force_breaks_rec] for lists.
    - [Never]: never break after the label
*)

type style_name = string

type style = {
  tag_open : string;
  tag_close : string
}
    (** Pair of opening and closing tags that are inserted around
	text after pretty-printing. *)

type atom_param = {
  atom_style : style_name option; (** Default: [None] *)
}

val atom : atom_param


(** List-formatting parameters.
    Always derive a new set of parameters from an existing record.
    See {!Easy_format.list}.
*)
type list_param = {
  space_after_opening : bool; (** Whether there must be some whitespace
				  after the opening string.
				  Default: [true] *)
  space_after_separator : bool; (** Whether there must be some whitespace
				    after the item separators.
				    Default: [true] *)
  space_before_separator : bool; (** Whether there must be some whitespace
				     before the item separators.
				     Default: [false] *)
  separators_stick_left : bool; (** Whether the separators must
				    stick to the item on the left.
				    Default: [true] *)
  space_before_closing : bool; (** Whether there must be some whitespace
				   before the closing string.
				   Default: [true] *)
  stick_to_label : bool; (** Whether the opening string should be fused
			     with the preceding label.
			     Default: [true] *)
  align_closing : bool; (** Whether the beginning of the
			    closing string must be aligned
			    with the beginning of the opening string
			    (stick_to_label = false) or
			    with the beginning of the label if any
			    (stick_to_label = true).
			    Default: [true] *)
  wrap_body : wrap; (** Defines under which conditions the list body
			may be wrapped, i.e. allow several lines
			and several list items per line.
			Default: [`Wrap_atoms] *)
  indent_body : int; (** Extra indentation of the list body.
			 Default: [2] *)

  list_style : style_name option; (** Default: [None] *)
  opening_style : style_name option; (** Default: [None] *)
  body_style : style_name option; (** Default: [None] *)
  separator_style : style_name option; (** Default: [None] *)
  closing_style : style_name option; (** Default: [None] *)
}

val list : list_param
  (** Default list-formatting parameters, using the default values
      described in the type definition above.

      In order to make code compatible with future versions of the library,
      the record inheritance syntax should be used, e.g.
      [ { list with align_closing = false } ].
      If new record fields are added, the program would still compile
      and work as before.
  *)

(** Label-formatting parameters.
    Always derive a new set of parameters from an existing record.
    See {!Easy_format.label}.
*)
type label_param = {
  label_break: label_break;
    (** Whether to break the line after the label.
        Introduced in version 1.2.0.
        Default: [`Auto] *)

  space_after_label : bool;
    (** Whether there must be some whitespace after the label.
	Default: [true] *)

  indent_after_label : int;
    (** Extra indentation before the item that comes after a label.
	Default: [2]
    *)

  label_style : style_name option;
    (** Default: [None] *)
}

val label : label_param
  (** Default label-formatting parameters, using the default values
      described in the type definition above.

      In order to make code compatible with future versions of the library,
      the record inheritance syntax should be used, e.g.
      [ { label with indent_after_label = 0 } ].
      If new record fields are added, the program would still compile
      and work as before.
 *)



type t =
    Atom of string * atom_param (** Plain string normally
				    without line breaks. *)

  | List of
      (
	string    (* opening *)
	* string  (* separator *)
	* string  (* closing *)
	* list_param
      )
      * t list
	(** [List ((opening, separator, closing, param), nodes)] *)

  | Label of (t * label_param) * t
      (** [Label ((label, param), node)]: labelled node. *)

  | Custom of (Format.formatter -> unit)
      (** User-defined printing function that allows to use the
	  Format module directly if necessary. It is responsible
	  for leaving the formatter in a clean state. *)
(** The type of the tree to be pretty-printed. Each node contains
    its own formatting parameters.

    Detail of a list node
    [List ((opening, separator, closing, param), nodes)]:

    - [opening]: opening string such as ["\{"] ["\["] ["("] ["begin"] [""] etc.
    - [separator]: node separator such as [";"] [","] [""] ["+"] ["|"] etc.
    - [closing]: closing string such as ["\}"] ["\]"] [")"] ["end"] [""] etc.
    - [nodes]: elements of the list.

*)

type escape =
    [ `None
    | `Escape of
	((string -> int -> int -> unit) -> string -> int -> int -> unit)
    | `Escape_string of (string -> string) ]

type styles = (style_name * style) list

(** The regular pretty-printing functions *)
module Pretty :
sig
  val define_styles : Format.formatter -> escape -> styles -> unit
  val to_formatter : Format.formatter -> t -> unit

  val to_buffer : ?escape:escape -> ?styles:styles -> Buffer.t -> t -> unit
  val to_string : ?escape:escape -> ?styles:styles -> t -> string
  val to_channel : ?escape:escape -> ?styles:styles -> out_channel -> t -> unit
  val to_stdout : ?escape:escape -> ?styles:styles -> t -> unit
  val to_stderr : ?escape:escape -> ?styles:styles -> t -> unit
end

(** No spacing or newlines other than those in the input data
    or those produced by [Custom] printing. *)
module Compact :
sig
  val to_buffer : Buffer.t -> t -> unit
  val to_string : t -> string
  val to_channel : out_channel -> t -> unit
  val to_stdout : t -> unit
  val to_stderr : t -> unit
  val to_formatter : Format.formatter -> t -> unit
 end


(**/**)

(** Deprecated. Predefined sets of parameters *)
module Param :
sig
  val list_true : list_param
    (** Deprecated. All boolean fields set to true. indent_body = 2. *)

  val label_true : label_param
    (** Deprecated. All boolean fields set to true. indent_after_label = 2. *)

  val list_false : list_param
    (** Deprecated. All boolean fields set to false. indent_body = 2. *)

  val label_false : label_param
    (** Deprecated. All boolean fields set to false. indent_after_label = 2. *)
end


end = struct
#1 "vendored_easy_format.ml"
open Format

(** Shadow map and split with tailrecursive variants. *)
module List = struct
  include List
  (** Tail recursive of map *)
  let map f l = List.rev_map f l |> List.rev

  (** Tail recursive version of split *)
  let rev_split l =
    let rec inner xs ys = function
      | (x, y) :: xys ->
          inner (x::xs) (y::ys) xys
      | [] -> (xs, ys)
    in
    inner [] [] l

  let split l = rev_split (List.rev l)

end

type wrap = [
  | `Wrap_atoms
  | `Always_wrap
  | `Never_wrap
  | `Force_breaks
  | `Force_breaks_rec
  | `No_breaks
]

type label_break = [
  | `Auto
  | `Always
  | `Always_rec
  | `Never
]

type style_name = string
type style = {
  tag_open : string;
  tag_close : string
}

type atom_param = {
  atom_style : style_name option;
}

let atom = {
  atom_style = None
}

type list_param = {
  space_after_opening : bool;
  space_after_separator : bool;
  space_before_separator : bool;
  separators_stick_left : bool;
  space_before_closing : bool;
  stick_to_label : bool;
  align_closing : bool;
  wrap_body : wrap;
  indent_body : int;
  list_style : style_name option;
  opening_style : style_name option;
  body_style : style_name option;
  separator_style : style_name option;
  closing_style : style_name option;
}

let list = {
  space_after_opening = true;
  space_after_separator = true;
  space_before_separator = false;
  separators_stick_left = true;
  space_before_closing = true;
  stick_to_label = true;
  align_closing = true;
  wrap_body = `Wrap_atoms;
  indent_body = 2;
  list_style = None;
  opening_style = None;
  body_style = None;
  separator_style = None;
  closing_style = None;
}

type label_param = {
  label_break: label_break;
  space_after_label : bool;
  indent_after_label : int;
  label_style : style_name option;
}

let label = {
  label_break = `Auto;
  space_after_label = true;
  indent_after_label = 2;
  label_style = None;
}

type t =
    Atom of string * atom_param
  | List of (string * string * string * list_param) * t list
  | Label of (t * label_param) * t
  | Custom of (formatter -> unit)

type escape =
    [ `None
    | `Escape of
        ((string -> int -> int -> unit) -> string -> int -> int -> unit)
    | `Escape_string of (string -> string) ]

type styles = (style_name * style) list

(*
   Transform a tree starting from the leaves, propagating and merging
   accumulators until reaching the root.
*)
let propagate_from_leaf_to_root
  ~init_acc  (* create initial accumulator for a leaf *)
  ~merge_acc (* merge two accumulators coming from child nodes *)
  ~map_node  (* (node, acc) -> (node, acc) *)
  x =

  let rec aux x =
    match x with
    | Atom _ ->
        let acc = init_acc x in
        map_node x acc
    | List (param, children) ->
        let new_children, accs = List.rev_split (List.rev_map aux children) in
        let acc = List.fold_left merge_acc (init_acc x) accs in
        map_node (List (param, new_children)) acc
    | Label ((x1, param), x2) ->
        let acc0 = init_acc x in
        let new_x1, acc1 = aux x1 in
        let new_x2, acc2 = aux x2 in
        let acc = merge_acc (merge_acc acc0 acc1) acc2 in
        map_node (Label ((new_x1, param), new_x2)) acc
    | Custom _ ->
        let acc = init_acc x in
        map_node x acc
  in
  aux x

(*
   Convert wrappable lists into vertical lists if any of their descendants
   has the attribute wrap_body = `Force_breaks_rec.
*)
let propagate_forced_breaks x =
  (* acc = whether to force breaks in wrappable lists or labels *)
  let init_acc = function
    | List ((_, _, _, { wrap_body = `Force_breaks_rec }), _)
    | Label ((_, { label_break = `Always_rec }), _) -> true
    | Atom _
    | Label _
    | Custom _
    | List _ -> false
  in
  let merge_acc force_breaks1 force_breaks2 =
    force_breaks1 || force_breaks2
  in
  let map_node x force_breaks =
    match x with
    | List ((_, _, _, { wrap_body = `Force_breaks_rec }), _) -> x, true
    | List ((_, _, _, { wrap_body = `Force_breaks }), _) -> x, force_breaks

    | List ((op, sep, cl, ({ wrap_body = (`Wrap_atoms
                                         | `Never_wrap
                                         | `Always_wrap) } as p)),
            children) ->
        if force_breaks then
          let p = { p with wrap_body = `Force_breaks } in
          List ((op, sep, cl, p), children), true
        else
          x, false

    | Label ((a, ({ label_break = `Auto } as lp)), b) ->
        if force_breaks then
          let lp = { lp with label_break = `Always } in
          Label ((a, lp), b), true
        else
          x, false

    | List ((_, _, _, { wrap_body = `No_breaks }), _)
    | Label ((_, { label_break = (`Always | `Always_rec | `Never) }), _)
    | Atom _
    | Custom _ -> x, force_breaks
  in
  let new_x, forced_breaks =
    propagate_from_leaf_to_root
      ~init_acc
      ~merge_acc
      ~map_node
      x
  in
  new_x

module Pretty =
struct
  (*
     Rewrite the tree to be printed.
     Currently, this is used only to handle `Force_breaks_rec.
  *)
  let rewrite x = propagate_forced_breaks x

  (*
    Relies on the fact that mark_open_tag and mark_close_tag
    are called exactly once before calling pp_output_string once.
    It's a reasonable assumption although not guaranteed by the
    documentation of the Format module.
  *)
  let set_escape fmt escape =
    let print0, flush0 = pp_get_formatter_output_functions fmt () in
    let tagf0 = (pp_get_formatter_tag_functions [@warning "-3"]) fmt () in

    let is_tag = ref false in

    let mot tag =
      is_tag := true;
      tagf0.mark_open_tag tag
    in

    let mct tag =
      is_tag := true;
      tagf0.mark_close_tag tag
    in

    let print s p n =
      if !is_tag then
        (print0 s p n;
         is_tag := false)
      else
        escape print0 s p n
    in

    let tagf = {
      tagf0 with
        mark_open_tag = mot;
        mark_close_tag = mct
    }
    in
    pp_set_formatter_output_functions fmt print flush0;
    (pp_set_formatter_tag_functions [@warning "-3"]) fmt tagf


  let set_escape_string fmt esc =
    let escape print s p n =
      let s0 = String.sub s p n in
      let s1 = esc s0 in
      print s1 0 (String.length s1)
    in
    set_escape fmt escape


  let define_styles fmt escape l =
    if l <> [] then (
      pp_set_tags fmt true;
      let tbl1 = Hashtbl.create (2 * List.length l) in
      let tbl2 = Hashtbl.create (2 * List.length l) in
      List.iter (
        fun (style_name, style) ->
          Hashtbl.add tbl1 style_name style.tag_open;
          Hashtbl.add tbl2 style_name style.tag_close
      ) l;
      let mark_open_tag style_name =
        try Hashtbl.find tbl1 style_name
        with Not_found -> ""
      in
      let mark_close_tag style_name =
        try Hashtbl.find tbl2 style_name
        with Not_found -> ""
      in

      let tagf = {
        ((pp_get_formatter_tag_functions [@warning "-3"]) fmt ()) with
          mark_open_tag = mark_open_tag;
          mark_close_tag = mark_close_tag
      }
      in
      (pp_set_formatter_tag_functions [@warning "-3"]) fmt tagf
    );

    (match escape with
         `None -> ()
       | `Escape esc -> set_escape fmt esc
       | `Escape_string esc -> set_escape_string fmt esc)


  let pp_open_xbox fmt p indent =
    match p.wrap_body with
	`Always_wrap
      | `Never_wrap
      | `Wrap_atoms -> pp_open_hvbox fmt indent
      | `Force_breaks
      | `Force_breaks_rec -> pp_open_vbox fmt indent
      | `No_breaks -> pp_open_hbox fmt ()

  let extra_box p l =
    let wrap =
      match p.wrap_body with
          `Always_wrap -> true
        | `Never_wrap
        | `Force_breaks
        | `Force_breaks_rec
        | `No_breaks -> false
        | `Wrap_atoms ->
            List.for_all (function Atom _ -> true | _ -> false) l
    in
    if wrap then
      ((fun fmt -> pp_open_hovbox fmt 0),
       (fun fmt -> pp_close_box fmt ()))
    else
      ((fun fmt -> ()),
       (fun fmt -> ()))


  let pp_open_nonaligned_box fmt p indent l =
    match p.wrap_body with
        `Always_wrap -> pp_open_hovbox fmt indent
      | `Never_wrap -> pp_open_hvbox fmt indent
      | `Wrap_atoms ->
          if List.for_all (function Atom _ -> true | _ -> false) l then
            pp_open_hovbox fmt indent
          else
            pp_open_hvbox fmt indent
      | `Force_breaks
      | `Force_breaks_rec -> pp_open_vbox fmt indent
      | `No_breaks -> pp_open_hbox fmt ()


  let open_tag fmt = function
      None -> ()
    | Some s -> (pp_open_tag [@warning "-3"]) fmt s

  let close_tag fmt = function
      None -> ()
    | Some _ -> (pp_close_tag [@warning "-3"]) fmt ()

  let tag_string fmt o s =
    match o with
        None -> pp_print_string fmt s
      | Some tag ->
          (pp_open_tag [@warning "-3"]) fmt tag;
          pp_print_string fmt s;
          (pp_close_tag [@warning "-3"]) fmt ()

  let rec fprint_t fmt = function
      Atom (s, p) ->
        tag_string fmt p.atom_style s;

    | List ((_, _, _, p) as param, l) ->
        open_tag fmt p.list_style;
        if p.align_closing then
          fprint_list fmt None param l
        else
          fprint_list2 fmt param l;
        close_tag fmt p.list_style

    | Label (label, x) -> fprint_pair fmt label x
    | Custom f -> f fmt

  and fprint_list_body_stick_left fmt p sep hd tl =
    open_tag fmt p.body_style;
    fprint_t fmt hd;
    List.iter (
      fun x ->
        if p.space_before_separator then
          pp_print_string fmt " ";
        tag_string fmt p.separator_style sep;
        if p.space_after_separator then
          pp_print_space fmt ()
        else
          pp_print_cut fmt ();
        fprint_t fmt x
    ) tl;
    close_tag fmt p.body_style

  and fprint_list_body_stick_right fmt p sep hd tl =
    open_tag fmt p.body_style;
    fprint_t fmt hd;
    List.iter (
      fun x ->
        if p.space_before_separator then
          pp_print_space fmt ()
        else
          pp_print_cut fmt ();
        tag_string fmt p.separator_style sep;
        if p.space_after_separator then
          pp_print_string fmt " ";
        fprint_t fmt x
    ) tl;
    close_tag fmt p.body_style

  and fprint_opt_label fmt = function
      None -> ()
    | Some (lab, lp) ->
        open_tag fmt lp.label_style;
        fprint_t fmt lab;
        close_tag fmt lp.label_style;
        if lp.space_after_label then
          pp_print_string fmt " "

  (* Either horizontal or vertical list *)
  and fprint_list fmt label ((op, sep, cl, p) as param) = function
      [] ->
        fprint_opt_label fmt label;
        tag_string fmt p.opening_style op;
        if p.space_after_opening || p.space_before_closing then
          pp_print_string fmt " ";
        tag_string fmt p.closing_style cl

    | hd :: tl as l ->

        if tl = [] || p.separators_stick_left then
          fprint_list_stick_left fmt label param hd tl l
        else
          fprint_list_stick_right fmt label param hd tl l


  and fprint_list_stick_left fmt label (op, sep, cl, p) hd tl l =
    let indent = p.indent_body in
    pp_open_xbox fmt p indent;
    fprint_opt_label fmt label;

    tag_string fmt p.opening_style op;

    if p.space_after_opening then
      pp_print_space fmt ()
    else
      pp_print_cut fmt ();

    let open_extra, close_extra = extra_box p l in
    open_extra fmt;
    fprint_list_body_stick_left fmt p sep hd tl;
    close_extra fmt;

    if p.space_before_closing then
      pp_print_break fmt 1 (-indent)
    else
      pp_print_break fmt 0 (-indent);
    tag_string fmt p.closing_style cl;
    pp_close_box fmt ()

  and fprint_list_stick_right fmt label (op, sep, cl, p) hd tl l =
    let base_indent = p.indent_body in
    let sep_indent =
      String.length sep + (if p.space_after_separator then 1 else 0)
    in
    let indent = base_indent + sep_indent in

    pp_open_xbox fmt p indent;
    fprint_opt_label fmt label;

    tag_string fmt p.opening_style op;

    if p.space_after_opening then
      pp_print_space fmt ()
    else
      pp_print_cut fmt ();

    let open_extra, close_extra = extra_box p l in
    open_extra fmt;

    fprint_t fmt hd;
    List.iter (
      fun x ->
        if p.space_before_separator then
          pp_print_break fmt 1 (-sep_indent)
        else
          pp_print_break fmt 0 (-sep_indent);
        tag_string fmt p.separator_style sep;
        if p.space_after_separator then
          pp_print_string fmt " ";
        fprint_t fmt x
    ) tl;

    close_extra fmt;

    if p.space_before_closing then
      pp_print_break fmt 1 (-indent)
    else
      pp_print_break fmt 0 (-indent);
    tag_string fmt p.closing_style cl;
    pp_close_box fmt ()



  (* align_closing = false *)
  and fprint_list2 fmt (op, sep, cl, p) = function
      [] ->
        tag_string fmt p.opening_style op;
        if p.space_after_opening || p.space_before_closing then
          pp_print_string fmt " ";
        tag_string fmt p.closing_style cl

    | hd :: tl as l ->
        tag_string fmt p.opening_style op;
        if p.space_after_opening then
          pp_print_string fmt " ";

        pp_open_nonaligned_box fmt p 0 l ;
        if p.separators_stick_left then
          fprint_list_body_stick_left fmt p sep hd tl
        else
          fprint_list_body_stick_right fmt p sep hd tl;
        pp_close_box fmt ();

        if p.space_before_closing then
          pp_print_string fmt " ";
        tag_string fmt p.closing_style cl


  (* Printing a label:value pair.

     The opening bracket stays on the same line as the key, no matter what,
     and the closing bracket is either on the same line
     or vertically aligned with the beginning of the key.
  *)
  and fprint_pair fmt ((lab, lp) as label) x =
    match x with
        List ((op, sep, cl, p), l) when p.stick_to_label && p.align_closing ->
          fprint_list fmt (Some label) (op, sep, cl, p) l

      | _ ->
          let indent = lp.indent_after_label in
          pp_open_hvbox fmt 0;

          open_tag fmt lp.label_style;
          fprint_t fmt lab;
          close_tag fmt lp.label_style;

          (match lp.label_break with
           | `Auto ->
               if lp.space_after_label then
                 pp_print_break fmt 1 indent
               else
                 pp_print_break fmt 0 indent
           | `Always
           | `Always_rec ->
               pp_force_newline fmt ();
               pp_print_string fmt (String.make indent ' ')
           | `Never ->
               if lp.space_after_label then
                 pp_print_char fmt ' '
               else
                 ()
          );
          fprint_t fmt x;
          pp_close_box fmt ()

  let to_formatter fmt x =
    let x = rewrite x in
    fprint_t fmt x;
    pp_print_flush fmt ()

  let to_buffer ?(escape = `None) ?(styles = []) buf x =
    let fmt = Format.formatter_of_buffer buf in
    define_styles fmt escape styles;
    to_formatter fmt x

  let to_string ?escape ?styles x =
    let buf = Buffer.create 500 in
    to_buffer ?escape ?styles buf x;
    Buffer.contents buf

  let to_channel ?(escape = `None) ?(styles = []) oc x =
    let fmt = formatter_of_out_channel oc in
    define_styles fmt escape styles;
    to_formatter fmt x

  let to_stdout ?escape ?styles x = to_channel ?escape ?styles stdout x
  let to_stderr ?escape ?styles x = to_channel ?escape ?styles stderr x

end




module Compact =
struct
  open Printf

  let rec fprint_t buf = function
      Atom (s, _) -> Buffer.add_string buf s
    | List (param, l) -> fprint_list buf param l
    | Label (label, x) -> fprint_pair buf label x
    | Custom f ->
        (* Will most likely not be compact *)
        let fmt = formatter_of_buffer buf in
        f fmt;
        pp_print_flush fmt ()

  and fprint_list buf (op, sep, cl, _) = function
      [] -> bprintf buf "%s%s" op cl
    | x :: tl ->
        Buffer.add_string buf op;
        fprint_t buf x;
        List.iter (
          fun x ->
            Buffer.add_string buf sep;
            fprint_t buf x
        ) tl;
        Buffer.add_string buf cl

  and fprint_pair buf (label, _) x =
    fprint_t buf label;
    fprint_t buf x


  let to_buffer buf x = fprint_t buf x

  let to_string x =
    let buf = Buffer.create 500 in
    to_buffer buf x;
    Buffer.contents buf

  let to_formatter fmt x =
    let s = to_string x in
    Format.fprintf fmt "%s" s;
    pp_print_flush fmt ()

  let to_channel oc x =
    let buf = Buffer.create 500 in
    to_buffer buf x;
    Buffer.output_buffer oc buf

  let to_stdout x = to_channel stdout x
  let to_stderr x = to_channel stderr x
end




(* Obsolete *)
module Param =
struct
  let list_true = {
    space_after_opening = true;
    space_after_separator = true;
    space_before_separator = true;
    separators_stick_left = true;
    space_before_closing = true;
    stick_to_label = true;
    align_closing = true;
    wrap_body = `Wrap_atoms;
    indent_body = 2;
    list_style = None;
    opening_style = None;
    body_style = None;
    separator_style = None;
    closing_style = None;
  }

  let list_false = {
    space_after_opening = false;
    space_after_separator = false;
    space_before_separator = false;
    separators_stick_left = false;
    space_before_closing = false;
    stick_to_label = false;
    align_closing = false;
    wrap_body = `Wrap_atoms;
    indent_body = 2;
    list_style = None;
    opening_style = None;
    body_style = None;
    separator_style = None;
    closing_style = None;
  }

  let label_true = {
    label_break = `Auto;
    space_after_label = true;
    indent_after_label = 2;
    label_style = None;
  }

  let label_false = {
    label_break = `Auto;
    space_after_label = false;
    indent_after_label = 2;
    label_style = None;
  }
end

end
module Reason_layout
= struct
#1 "reason_layout.ml"
module Easy_format = Vendored_easy_format
module Comment = Reason_comment
module Range = Reason_location.Range

type break_criterion =
  | Never
  | IfNeed
  | Always
  (* Always_rec not only will break, it will break recursively up to the root *)
  | Always_rec

(*
 Modeling separators:
  Special ability to render the final separator distinctly. This is so we can
  replace them when they do/don't occur next to newlines.

    If sepLeft:true
    {
      final item1
      sep   item2
      sep   item3
    }

    If sepLeft:false
    {
      item1 sep
      item2 sep
      item3 final
    }
*)
(* You can't determine the final separator unless you specify a separator *)
type separator =
  | NoSep
  | Sep of string
  | SepFinal of string * string

(**
 * Module concerning info to correctly interleave whitespace above a layout node.
 *)
module WhitespaceRegion = struct
  type t = {
    (* range of the region *)
    range: Range.t;
    (* inserted comments into the whitespace region *)
    comments: Comment.t list;
    (* amount of newlines to be interleaved *)
    newlines: int;
  }

  let make ~range ~newlines () = {
    range;
    comments = [];
    newlines;
  }

  let newlines t = t.newlines
  let range t = t.range
  let comments t = t.comments

  let addComment t comment = { t with
    comments = comment::t.comments
  }

  let modifyNewlines t newNewlines = { t with
    newlines = newNewlines
  }
end

(**
 * These represent "intent to format" the AST, with some parts being annotated
 * with original source location. The benefit of tracking this in an
 * intermediate structure, is that we can then interleave comments throughout
 * the tree before generating the final representation. That prevents the
 * formatting code from having to thread comments everywhere.
 *
 * The final representation is rendered using Easy_format.
 *)
type t =
  | SourceMap of Location.t * t (* a layout with location info *)
  | Sequence of config * (t list)
  | Label of (Easy_format.t -> Easy_format.t -> Easy_format.t) * t * t
  | Easy of Easy_format.t
  (* Extra variant representing "intent to interleave whitespace" above a
   * layout node. Why the extra representation?
   * Since comments get interleaved after formatting the ast,
   * the inserting of actual newlines has to happen after the comments
   * have been formatted/inserted. *)
  | Whitespace of WhitespaceRegion.t * t

and config = {
  break: break_criterion;
  (* Break setting that becomes activated if a comment becomes interleaved into
   * this list. Typically, if not specified, the behavior from [break] will be
   * used.
   *)
  wrap: string * string;
  inline: bool * bool;
  sep: separator;
  indent: int;
  sepLeft: bool;
  preSpace: bool;
  (* Really means space_after_separator *)
  postSpace: bool;
  pad: bool * bool;
  (* A function, because the system might rearrange your previous settings, and
   * a function allows you to not be locked into some configuration that is made
   * out of date by the formatting system (suppose it removes the separator
   * token etc.) Having a function allows you to instruct our formatter how to
   * extend the "freshest" notion of the list config when comments are
   * interleaved. *)
  listConfigIfCommentsInterleaved: (config -> config) option;

  (* Formatting to use if an item in a list had an end-of-line comment appended *)
  listConfigIfEolCommentsInterleaved: (config -> config) option;
}

let string_of_easy = function
  | Easy_format.Atom (s,_) -> s
  | Easy_format.List (_,_) -> "list"
  | Easy_format.Label (_,_) -> "label"
  | Easy_format.Custom _ -> "custom"

let indent_more indent = "  " ^ indent

let dump_easy ppf easy =
  let printf fmt = Format.fprintf ppf fmt in
  let rec traverse indent = function
    | Easy_format.Atom (s,_) ->
      printf "%s Atom:'%s'\n" indent s
    | Easy_format.List ((opening, sep, closing, config), items) ->
      let break = (match config.wrap_body with
          | `No_breaks -> "No_breaks"
          | `Wrap_atoms -> "Wrap_atoms"
          | `Never_wrap -> "Never_wrap"
          | `Force_breaks -> "Force_breaks"
          | `Force_breaks_rec -> "Force_breaks_rec"
          | `Always_wrap -> "Always_wrap") in
      printf "%s List: open %s close %s sep %s break %s \n"
        indent opening closing sep break;
      let _ = List.map (traverse (indent_more indent)) items in
      ()
    | Easy_format.Label ((left, config), right) ->
      let break = match config.label_break with
        | `Never -> "Never"
        | `Always_rec -> "Always_rec"
        | `Auto -> "Auto"
        | `Always -> "Always" in
      printf "%s Label (break = %s): \n" indent break;
      printf "  %s left \n" indent;
      let indent' = indent_more indent in
      traverse indent' left;
      printf "  %s right \n" indent;
      traverse indent' right;
    | Easy_format.Custom _ ->
      printf "custom \n"
  in
  traverse "" easy

let dump ppf layout =
  let printf fmt = Format.fprintf ppf fmt in
  let rec traverse indent = function
    | SourceMap (loc, layout) ->
      printf "%s SourceMap [(%d:%d)-(%d:%d)]\n" indent
        loc.loc_start.Lexing.pos_lnum
        (loc.loc_start.Lexing.pos_cnum - loc.loc_start.Lexing.pos_bol)
        loc.loc_end.Lexing.pos_lnum
        (loc.loc_end.Lexing.pos_cnum - loc.loc_end.Lexing.pos_bol);
      traverse (indent_more indent) layout
    | Sequence (config, layout_list) ->
      let break = match config.break with
        | Never  -> "Never"
        | IfNeed  -> "if need"
        | Always  -> "Always"
        | Always_rec  -> "Always_rec" in
      let sep = match config.sep with
        | NoSep -> "NoSep"
        | Sep s -> "Sep '" ^ s ^ "'"
        | SepFinal (s, finalSep) -> "SepFinal ('" ^ s ^ "', '" ^ finalSep ^ "')" in
      printf "%s Sequence of %d, sep: %s, stick_to_left: %s break: %s\n"
        indent (List.length layout_list) sep (string_of_bool config.sepLeft) break;
      List.iter (traverse (indent_more indent)) layout_list
    | Label (_, left, right) ->
      printf "%s Label: \n" indent;
      printf "  %s left \n" indent;
      let indent' = indent_more (indent_more indent) in
      traverse indent' left;
      printf "  %s right \n" indent;
      traverse indent' right;
    | Easy e ->
      printf "%s Easy: '%s' \n" indent (string_of_easy e)
    | Whitespace (region, sublayout) ->
      let open WhitespaceRegion in
      printf" %s Whitespace (%d) [%d %d]:\n" indent region.newlines region.range.lnum_start region.range.lnum_end;
      (traverse (indent_more indent) sublayout)
  in
  traverse "" layout

let source_map ?(loc=Location.none) layout =
  if loc = Location.none then layout
  else SourceMap (loc, layout)

let default_list_settings = {
  Easy_format.space_after_opening = false;
  space_after_separator = false;
  space_before_separator = false;
  separators_stick_left = true;
  space_before_closing = false;
  stick_to_label = true;
  align_closing = true;
  wrap_body = `No_breaks;
  indent_body = 0;
  list_style = Some "list";
  opening_style = None;
  body_style = None;
  separator_style = None;
  closing_style = None;
}

let easy_settings_from_config
    { break; wrap; inline; indent; preSpace; postSpace; pad; sep } =
  (* TODO: Stop handling separators in Easy_format since we handle most of
      them before Easy_format anyways. There's just some that we still rely on
      Easy_format for. Easy_format's sep wasn't powerful enough.
  *)
  let (opn, cls) = wrap in
  let (padOpn, padCls) = pad in
  let (inlineStart, inlineEnd) = inline in
  let sepStr = match sep with NoSep -> "" | Sep s | SepFinal(s, _) -> s in
  (opn, sepStr, cls,
   { default_list_settings with
     Easy_format.
     wrap_body = (match break with
         | Never -> `No_breaks
         (* Yes, `Never_wrap is a horrible name - really means "if needed". *)
         | IfNeed -> `Never_wrap
         | Always -> `Force_breaks
         | Always_rec -> `Force_breaks_rec
       );
     indent_body = indent;
     space_after_separator = postSpace;
     space_before_separator = preSpace;
     space_after_opening = padOpn;
     space_before_closing = padCls;
     stick_to_label = inlineStart;
     align_closing = not inlineEnd;
   })

let to_easy_format layout =
  let rec traverse = function
    | Sequence (config, sublayouts) ->
      let items = List.map traverse sublayouts in
      Easy_format.List (easy_settings_from_config config, items)
    | Label (labelFormatter, left, right) ->
      labelFormatter (traverse left) (traverse right)
    | SourceMap (_, subLayout) ->
      traverse subLayout
    | Easy e -> e
    | Whitespace (_, subLayout) ->
      traverse subLayout
  in
  traverse layout

(** [getLocFromLayout] recursively takes the unioned location of its children,
 *  and returns the max one *)
let get_location layout =
  let union loc1 loc2 =
    match (loc1, loc2) with
    | None, _ -> loc2
    | _, None -> loc1
    | Some loc1, Some loc2  ->
      Some {loc1 with Location.loc_end = loc2.Location.loc_end}
  in
  let rec traverse = function
    | Sequence (_, subLayouts) ->
      let locs = List.map traverse subLayouts in
      List.fold_left union None locs
    | Label (_, left, right) ->
      union (traverse left) (traverse right)
    | SourceMap (loc, _) -> Some loc
    | Whitespace(_, sub) -> traverse sub
    | _ -> None
  in
  traverse layout

let is_before ~location layout =
  match get_location layout with
  | None -> true
  | Some loc -> Reason_syntax_util.location_is_before loc location

let contains_location layout ~location =
  match get_location layout with
  | None -> false
  | Some layout_loc -> Reason_syntax_util.location_contains layout_loc location

end
module Reason_pprint_ast : sig 
#1 "reason_pprint_ast.mli"
open Migrate_parsetree.Ast_404.Parsetree

val configure :
  width:int ->
  assumeExplicitArity:bool -> constructorLists:string list -> unit

val createFormatter : unit ->
  <
    case_list : Format.formatter -> case list -> unit;
    core_type : Format.formatter -> core_type -> unit;
    expression : Format.formatter -> expression -> unit;
    pattern : Format.formatter -> pattern -> unit;
    signature : Reason_comment.t list -> Format.formatter -> signature -> unit;
    structure : Reason_comment.t list -> Format.formatter -> structure -> unit;
    toplevel_phrase : Format.formatter -> toplevel_phrase -> unit;
  >

end = struct
#1 "reason_pprint_ast.ml"
(*
 * Copyright (c) 2015-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *  Forked from OCaml, which is provided under the license below:
 *
 *  Xavier Leroy, projet Cristal, INRIA Rocquencourt
 *
 *  Copyright © 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Inria
 *
 *  Permission is hereby granted, free of charge, to the Licensee obtaining a
 *  copy of this software and associated documentation files (the "Software"),
 *  to deal in the Software without restriction, including without limitation
 *  the rights to use, copy, modify, merge, publish, distribute, sublicense
 *  under any license of the Licensee's choice, and/or sell copies of the
 *  Software, subject to the following conditions:
 *
 *  1.	Redistributions of source code must retain the above copyright notice
 *  and the following disclaimer.
 *  2.	Redistributions in binary form must reproduce the above copyright
 *  notice, the following disclaimer in the documentation and/or other
 *  materials provided with the distribution.
 *  3.	All advertising materials mentioning features or use of the Software
 *  must display the following acknowledgement: This product includes all or
 *  parts of the Caml system developed by Inria and its contributors.
 *  4.	Other than specified in clause 3, neither the name of Inria nor the
 *  names of its contributors may be used to endorse or promote products
 *  derived from the Software without specific prior written permission.
 *
 *  Disclaimer
 *
 *  This software is provided by Inria and contributors “as is” and any express
 *  or implied warranties, including, but not limited to, the implied
 *  warranties of merchantability and fitness for a particular purpose are
 *  disclaimed. in no event shall Inria or its contributors be liable for any
 *  direct, indirect, incidental, special, exemplary, or consequential damages
 *  (including, but not limited to, procurement of substitute goods or
 *  services; loss of use, data, or profits; or business interruption) however
 *  caused and on any theory of liability, whether in contract, strict
 *  liability, or tort (including negligence or otherwise) arising in any way
 *  out of the use of this software, even if advised of the possibility of such
 *  damage.
 *
 *)

(* TODO more fine-grained precedence pretty-printing *)

module Easy_format = Vendored_easy_format

open Migrate_parsetree
open Ast_404
open Asttypes
open Location
open Longident
open Parsetree
open Easy_format
open Reason_syntax_util
open Reason_attributes

module Comment = Reason_comment
module Layout = Reason_layout
module WhitespaceRegion = Layout.WhitespaceRegion
module Range = Reason_location.Range

let source_map = Layout.source_map

exception NotPossible of string

let commaTrail = Layout.SepFinal (",", Reason_syntax_util.TrailingCommaMarker.string)
let commaSep = Layout.Sep (",")

type ruleInfoData = {
  reducePrecedence: precedence;
  shiftPrecedence: precedence;
}

and ruleCategory =
  (* Printing will be parsed with very high precedence, so not much need to
     worry about ensuring it will reduce correctly. In short, you can put
     `FunctionApplication` content anywhere around an infix identifier without
     wrapping in parens. For example `myFunc x y z` or `if x {y} else {z}`
     The layout is kept in list form only to allow for elegant wrapping rules
     to take into consideration the *number* of high precedence parsed items. *)
  | FunctionApplication of Layout.t list
  (* Care should be taken to ensure the rule that caused it to be parsed will
     reduce again on the printed output - context should carefully consider
     wrapping in parens according to the ruleInfoData. *)
  | SpecificInfixPrecedence of ruleInfoData * resolvedRule
  (* Not safe to include anywhere between infix operators without wrapping in
     parens. This describes expressions like `fun x => x` which doesn't fit into
     our simplistic algorithm for printing function applications separated by infix.

     It might be possible to include these in between infix, but there are
     tricky rules to determining when these must be guarded by parens (it
     depends highly on context that is hard to reason about). It's so nuanced
     that it's easier just to always wrap them in parens.  *)
  | PotentiallyLowPrecedence of Layout.t
  (* Simple means it is clearly one token (such as (anything) or [anything] or identifier *)
  | Simple of Layout.t

(* Represents a ruleCategory where the precedence has been resolved.
 * The precedence of a ruleCategory gets resolved in `ensureExpression` or
 * `ensureContainingRule`. The result is either a plain Layout.t (where
 * parens probably have been applied) or an InfixTree containing the operator and
 * a left & right resolvedRule. The latter indicates that the precedence has been resolved,
 * but the actual formatting is deferred to a later stadium.
 * Think `let x = foo |> f |> z |>`, which requires a certain formatting style when
 * things break over multiple lines. *)
and resolvedRule =
  | LayoutNode of Layout.t
  | InfixTree of string * resolvedRule * resolvedRule

and associativity =
  | Right
  | Nonassoc
  | Left

and precedenceEntryType =
  | TokenPrecedence
  | CustomPrecedence

and precedence =
  | Token of string
  | Custom of string

(* Describes the "fixity" of a token, and stores its *printed* representation
   should it be rendered as infix/prefix (This rendering may be different than
   how it is stored in the AST). *)
and tokenFixity =
  (* Such as !simple_expr and ~!simple_expr. These function applications are
     considered *almost* "simple" because they may be allowed anywhere a simple
     expression is accepted, except for when on the left hand side of a
     dot/send. *)
  | AlmostSimplePrefix of string
  | UnaryPlusPrefix of string
  | UnaryMinusPrefix of string
  | UnaryNotPrefix of string
  | UnaryPostfix of string
  | Infix of string
  | Normal

(* Type which represents a resolvedRule's InfixTree flattened *)
type infixChain =
  | InfixToken of string
  | Layout of Layout.t

(* Helpers for dealing with extension nodes (%expr) *)

let expression_extension_sugar x =
  if x.pexp_attributes != [] then None
  else match x.pexp_desc with
    | Pexp_extension (name, PStr [{pstr_desc = Pstr_eval(expr, [])}])
      when name.txt <> "bs.obj" ->
      Some (name, expr)
    | _ -> None

let expression_immediate_extension_sugar x =
  match expression_extension_sugar x with
  | None -> (None, x)
  | Some (name, expr) ->
    match expr.pexp_desc with
    | Pexp_for _ | Pexp_while _ | Pexp_ifthenelse _
    | Pexp_function _ | Pexp_newtype _
    | Pexp_try _ | Pexp_match _ ->
      (Some name, expr)
    | _ -> (None, x)

let expression_not_immediate_extension_sugar x =
  match expression_immediate_extension_sugar x with
  | (Some _, _) -> None
  | (None, _) -> expression_extension_sugar x

let add_extension_sugar keyword = function
  | None -> keyword
  | Some str -> keyword ^ "%" ^ str.txt

let string_equal : string -> string -> bool = (=)

let longident_same l1 l2 =
  let rec equal l1 l2 =
    match l1, l2 with
    | Lident l1, Lident l2 -> string_equal l1 l2
    | Ldot (path1, l1), Ldot (path2, l2) ->
      equal path1 path2 && string_equal l1 l2
    | Lapply (l11, l12), Lapply (l21, l22) ->
      equal l11 l21 && equal l12 l22
    | _ -> false
  in
  equal l1.txt l2.txt

(* A variant of List.for_all2 that returns false instead of failing on lists
   of different size *)
let for_all2' pred l1 l2 =
  List.length l1 = List.length l2 &&
  List.for_all2 pred l1 l2

(*
   Checks to see if two types are the same modulo the process of varification
   which turns abstract types into type variables of the same name.
   For example, [same_ast_modulo_varification] would consider (a => b) and ('a
   => 'b) to have the same ast. This is useful in recovering syntactic sugar
   for explicit polymorphic types with locally abstract types.

   Does not compare attributes, or extensions intentionally.

   TODO: This has one more issue: We need to compare only accepting t1's type
   variables, to be considered compatible with t2's type constructors - not the
   other way around.
 *)
let same_ast_modulo_varification_and_extensions t1 t2 =
  let rec loop t1 t2 = match (t1.ptyp_desc, t2.ptyp_desc) with
    (* Importantly, cover the case where type constructors (of the form [a])
       are converted to type vars of the form ['a].
     *)
    | (Ptyp_constr({txt=Lident s1}, []), Ptyp_var s2) -> string_equal s1 s2
    (* Now cover the case where type variables (of the form ['a]) are
       converted to type constructors of the form [a].
     *)
    | (Ptyp_var s1, Ptyp_constr({txt=Lident s2}, [])) -> string_equal s1 s2
    (* Now cover the typical case *)
    | (Ptyp_constr(longident1, lst1), Ptyp_constr(longident2, lst2))  ->
      longident_same longident1 longident2 &&
      for_all2' loop lst1 lst2
    | (Ptyp_any, Ptyp_any) -> true
    | (Ptyp_var x1, Ptyp_var x2) -> string_equal x1 x2
    | (Ptyp_arrow (label1, core_type1, core_type1'), Ptyp_arrow (label2, core_type2, core_type2')) ->
      begin
         match label1, label2 with
         | Nolabel, Nolabel -> true
         | Labelled s1, Labelled s2 -> string_equal s1 s2
         | Optional s1, Optional s2 -> string_equal s1 s2
         | _ -> false
      end &&
      loop core_type1 core_type2 &&
      loop core_type1' core_type2'
    | (Ptyp_tuple lst1, Ptyp_tuple lst2) -> for_all2' loop lst1 lst2
    | (Ptyp_object (lst1, o1), Ptyp_object (lst2, o2)) ->
      let tester = fun (s1, _, t1) (s2, _, t2) ->
        string_equal s1 s2 &&
        loop t1 t2
      in
      for_all2' tester lst1 lst2 && o1 = o2
    | (Ptyp_class (longident1, lst1), Ptyp_class (longident2, lst2)) ->
      longident_same longident1 longident2 &&
      for_all2' loop lst1 lst2
    | (Ptyp_alias(core_type1, string1), Ptyp_alias(core_type2, string2)) ->
      loop core_type1 core_type2 &&
      string_equal string1 string2
    | (Ptyp_variant(row_field_list1, flag1, lbl_lst_option1), Ptyp_variant(row_field_list2, flag2, lbl_lst_option2)) ->
      for_all2' rowFieldEqual row_field_list1 row_field_list2 &&
      flag1 = flag2 &&
      lbl_lst_option1 = lbl_lst_option2
    | (Ptyp_poly (string_lst1, core_type1), Ptyp_poly (string_lst2, core_type2))->
      for_all2' string_equal string_lst1 string_lst2 &&
      loop core_type1 core_type2
    | (Ptyp_package(longident1, lst1), Ptyp_package (longident2, lst2)) ->
      longident_same longident1 longident2 &&
      for_all2' testPackageType lst1 lst2
    | (Ptyp_extension (s1, _), Ptyp_extension (s2, _)) ->
      string_equal s1.txt s2.txt
    | _ -> false
  and testPackageType (lblLongIdent1, ct1) (lblLongIdent2, ct2) =
    longident_same lblLongIdent1 lblLongIdent2 &&
    loop ct1 ct2
  and rowFieldEqual f1 f2 = match (f1, f2) with
    | ((Rtag(label1, _, flag1, lst1)), (Rtag (label2, _, flag2, lst2))) ->
      string_equal label1 label2 &&
      flag1 = flag2 &&
      for_all2' loop lst1 lst2
    | (Rinherit t1, Rinherit t2) -> loop t1 t2
    | _ -> false
  in
  loop t1 t2

let expandLocation pos ~expand:(startPos, endPos) =
  { pos with
    loc_start = {
      pos.loc_start with
        Lexing.pos_cnum = pos.loc_start.Lexing.pos_cnum + startPos
    };
    loc_end = {
      pos.loc_end with
        Lexing.pos_cnum = pos.loc_end.Lexing.pos_cnum + endPos
    }
  }

(* Computes the location of the attribute with the lowest line number
 * that isn't ghost. Useful to determine the start location of an item
 * in the parsetree that has attributes.
 * If there are no valid attributes, defaults to the passed location.
 * 1| [@attr]           --> notice how the "start" is determined
 * 2| let f = ...           by the attr on line 1, not the lnum of the `let`
 *)
let rec firstAttrLoc loc = function
  | ((attrLoc, _) : Ast_404.Parsetree.attribute) ::attrs ->
      if attrLoc.loc.loc_start.pos_lnum < loc.loc_start.pos_lnum
         && not attrLoc.loc.loc_ghost
      then
        firstAttrLoc attrLoc.loc attrs
      else
        firstAttrLoc loc attrs
  | [] -> loc

let extractLocationFromValBindList expr vbs =
  let rec extract loc = function
    | x::xs ->
        let {pvb_expr} = x in
        let loc = {loc with loc_end = pvb_expr.pexp_loc.loc_end} in
        extract loc xs
    | [] -> loc
  in
  let loc = match vbs with
    | x::xs ->
        let {pvb_pat; pvb_expr} = x in
        let loc = {pvb_pat.ppat_loc with loc_end = pvb_expr.pexp_loc.loc_end} in
        extract loc xs
    | [] -> expr.pexp_loc
  in
  { loc with loc_start = expr.pexp_loc.loc_start }

let extractLocValBinding {pvb_pat; pvb_expr; pvb_attributes;} =
  let estimatedLoc = firstAttrLoc pvb_pat.ppat_loc pvb_attributes in
  {estimatedLoc with loc_end = pvb_expr.pexp_loc.loc_end}

let extractLocModuleBinding {pmb_expr; pmb_attributes} =
  let estimatedLoc = firstAttrLoc pmb_expr.pmod_loc pmb_attributes in
  {estimatedLoc with loc_end = pmb_expr.pmod_loc.loc_end}

let extractLocModDecl {pmd_type; pmd_attributes} =
  let estimatedLoc = firstAttrLoc pmd_type.pmty_loc pmd_attributes in
  {estimatedLoc with loc_end = pmd_type.pmty_loc.loc_end}

let rec sequentialIfBlocks x =
  match x with
    | Some ({pexp_desc=Pexp_ifthenelse (e1, e2, els)}) -> (
       let (nestedIfs, finalExpression) = (sequentialIfBlocks els) in
       ((e1, e2)::nestedIfs, finalExpression)
      )
    | Some e -> ([], Some e)
    | None -> ([], None)

(*
  TODO: IDE integration beginning with Vim:

  - Create recovering version of parser that creates regions of "unknown"
    content in between let sequence bindings (anything between semicolons,
    really).
  - Use Easy_format's "style" features to tag each known node.
  - Turn those style annotations into editor highlight commands.
  - Editors have a set of keys that retrigger the parsing/rehighlighting
    process (typically newline/semi/close-brace).
  - On every parsing/rehighlighting, this pretty printer can be used to
    determine the highlighting of recovered regions, and the editor plugin can
    relegate highlighting of malformed regions to the editor which mostly does
    so based on token patterns.

*)

(*
     @avoidSingleTokenWrapping

  +-----------------------------+
  |+------+                     |     Another label
  || let ( \                    |
  ||    a  | Label              |
  ||    o  |                    |     The thing to the right of any label must be a
  ||    p _+ label RHS          |     list in order for it to wrap correctly. Lists
  ||  ): /   v                  |     will wrap if they need to/can. NON-lists will
  |+--+ sixteenTuple = echoTuple|(    wrap (indented) even though they're no lists!
  +---/ 0,\---------------------+     To prevent a single item from wrapping, make
        0,                            an unbreakable list via ensureSingleTokenSticksToLabel.
        0
      );                              In general, the best approach for indenting
                                      let bindings is to keep building up labels from
                                      the "let", always ensuring things that you want
                                      to wrap will either be lists or guarded in
                                      [ensureSingleTokenSticksToLabel].
                                      If you must join several lists together (via =)
                                      (or colon), ensure that joining is done via
                                      [makeList] (which won't break), and that new
                                      list is always appended to the left
                                      hand side of the label. (So that the right hand
                                      side may always be the untouched list that you want
                                      to wrap with aligned closing).
                                      Always make sure rhs of the label are the

                                      Creating nested labels will preserve the original
                                      indent location ("let" in this
                                      case) as long as that nesting is
                                      done on the left hand side of the labels.

*)

(*
    Table 2.1. Precedence and associativity.
    Precedence from highest to lowest: From RWOC, modified to include !=
    ---------------------------------------

    Operator prefix	Associativity
    !..., ?..., ~...	                              Prefix
    ., .(, .[	-
    function application, constructor, assert, lazy	Left associative
    -, -.                                           Prefix
    **..., lsl, lsr, asr                            Right associative
    *..., /..., %..., mod, land, lor, lxor          Left associative
    +..., -...                                      Left associative
    ::                                              Right associative
    @..., ^...                                      Right associative
---
    !=                                              Left associative (INFIXOP0 listed first in lexer)
    =..., <..., >..., |..., &..., $...              Left associative (INFIXOP0)
    =, <, >                                         Left associative (IN SAME row as INFIXOP0 listed after)
---
    &, &&                                           Right associative
    or, ||                                          Right associative
    ,                                               -
    :=, =                                         	Right associative
    if                                              -
    ;                                               Right associative


   Note: It would be much better if &... and |... were in separate precedence
   groups just as & and | are. This way, we could encourage custom infix
   operators to use one of the two precedences and no one would be confused as
   to precedence (leading &, | are intuitive). Two precedence classes for the
   majority of infix operators is totally sufficient.

   TODO: Free up the (&) operator from pervasives so it can be reused for
   something very common such as string concatenation or list appending.

   let x = tail & head;
 *)

(* "Almost Simple Prefix" function applications parse with the rule:

   `PREFIXOP simple_expr %prec below_DOT_AND_SHARP`, which in turn is almost
   considered a "simple expression" (it's acceptable anywhere a simple
   expression is except in a couple of edge cases.

   "Unary Prefix" function applications parse with the rule:

   `MINUS epxr %prec prec_unary_minus`, which in turn is considered an
   "expression" (not simple). All unary operators are mapped into an identifier
   beginning with "~".

   TODO: Migrate all "almost simple prefix" to "unsary prefix". When `!`
   becomes "not", then it will make more sense that !myFunc (arg) is parsed as
   !(myFunc arg) instead of (!myFunc) arg.

 *)
let almost_simple_prefix_symbols  = [ '!'; '?'; '~'] ;;
(* Subset of prefix symbols that have special "unary precedence" *)
let unary_minus_prefix_symbols  = [ "~-"; "~-."] ;;
let unary_plus_prefix_symbols  = ["~+"; "~+." ] ;;
let infix_symbols = [ '='; '<'; '>'; '@'; '^'; '|'; '&'; '+'; '-'; '*'; '/';
                      '$'; '%'; '\\'; '#' ]

let special_infix_strings =
  ["asr"; "land"; "lor"; "lsl"; "lsr"; "lxor"; "mod"; "or"; ":="; "!="; "!=="]

let updateToken = "="
let sharpOpEqualToken = "#="
let pipeFirstToken = "->"
let requireIndentFor = [updateToken; ":="]

let namedArgSym = "~"

let requireNoSpaceFor tok =
  tok = pipeFirstToken || (tok.[0] = '#' && tok <> "#=")

let funToken = "fun"

let getPrintableUnaryIdent s =
  if List.mem s unary_minus_prefix_symbols ||
     List.mem s unary_plus_prefix_symbols
  then String.sub s 1 (String.length s -1)
  else s

(* determines if the string is an infix string.
   checks backwards, first allowing a renaming postfix ("_102") which
   may have resulted from Pexp -> Texp -> Pexp translation, then checking
   if all the characters in the beginning of the string are valid infix
   characters. *)
let printedStringAndFixity = function
  | s when List.mem s special_infix_strings -> Infix s
  | "^" -> UnaryPostfix "^"
  | s when List.mem s.[0] infix_symbols -> Infix s
  (* Correctness under assumption that unary operators are stored in AST with
     leading "~" *)
  | s when List.mem s.[0] almost_simple_prefix_symbols &&
           not (List.mem s special_infix_strings) &&
           not (s = "?") -> (
      (* What *kind* of prefix fixity? *)
      if List.mem s unary_plus_prefix_symbols then
        UnaryPlusPrefix (getPrintableUnaryIdent s)
      else if List.mem s unary_minus_prefix_symbols then
        UnaryMinusPrefix (getPrintableUnaryIdent s)
      else if s = "!" then
        UnaryNotPrefix s
      else
        AlmostSimplePrefix s
  )
  | _ -> Normal


(* Also, this doesn't account for != and !== being infixop!!! *)
let isSimplePrefixToken s = match printedStringAndFixity s with
  | AlmostSimplePrefix _ | UnaryPostfix "^" -> true
  | _ -> false


(* Convenient bank of information that represents the parser's precedence
   rankings.  Each instance describes a precedence table entry. The function
   tests either a token string encountered by the parser, or (in the case of
   `CustomPrecedence`) the string name of a custom rule precedence declared
   using %prec *)
let rules = [
  [
    (TokenPrecedence, (fun s -> (Left, s = pipeFirstToken)));
    (TokenPrecedence, (fun s -> (Left, s.[0] = '#' &&
                                       s <> sharpOpEqualToken &&
                                       s <> "#")));
    (TokenPrecedence, (fun s -> (Left, s = ".")));
    (CustomPrecedence, (fun s -> (Left, s = "prec_lbracket")));
  ];
  [
    (CustomPrecedence, (fun s -> (Nonassoc, s = "prec_functionAppl")));
  ];
  [
    (TokenPrecedence, (fun s -> (Right, isSimplePrefixToken s)));
  ];
  [
    (TokenPrecedence, (fun s -> (Left, s = sharpOpEqualToken)));
  ];
  [
    (CustomPrecedence, (fun s -> (Nonassoc, s = "prec_unary")));
  ];
  (* Note the special case for "*\*", BARBAR, and LESSMINUS, AMPERSAND(s) *)
  [
    (TokenPrecedence, (fun s -> (Right, s = "**")));
    (TokenPrecedence, (fun s -> (Right, String.length s > 1 && s.[0] == '*' && s.[1] == '\\' && s.[2] == '*')));
    (TokenPrecedence, (fun s -> (Right, s = "lsl")));
    (TokenPrecedence, (fun s -> (Right, s = "lsr")));
    (TokenPrecedence, (fun s -> (Right, s = "asr")));
  ];
  [
    (TokenPrecedence, (fun s -> (Left, s.[0] == '*' && (String.length s == 1 || s != "*\\*"))));
    (TokenPrecedence, (fun s -> (Left, s.[0] == '/')));
    (TokenPrecedence, (fun s -> (Left, s.[0] == '%' )));
    (TokenPrecedence, (fun s -> (Left, s = "mod" )));
    (TokenPrecedence, (fun s -> (Left, s = "land" )));
    (TokenPrecedence, (fun s -> (Left, s = "lor" )));
    (TokenPrecedence, (fun s -> (Left, s = "lxor" )));
  ];
  [
    (* Even though these use the same *tokens* as unary plus/minus at parse
       time, when unparsing infix -/+, the CustomPrecedence rule would be
       incorrect to use, and instead we need a rule that models what infix
       parsing would use - just the regular token precedence without a custom
       precedence. *)
    (TokenPrecedence,
    (fun s -> (
      Left,
      if String.length s > 1 && s.[0] == '+' && s.[1] == '+' then
        (*
          Explicitly call this out as false because the other ++ case below
          should have higher *lexing* priority. ++operator_chars* is considered an
          entirely different token than +(non_plus_operator_chars)*
        *)
        false
      else
        s.[0] == '+'
    )));
    (TokenPrecedence, (fun s -> (Left, s.[0] == '-' && s <> pipeFirstToken)));
    (TokenPrecedence, (fun s -> (Left, s = "!" )));
  ];
  [
    (TokenPrecedence, (fun s -> (Right, s = "::")));
  ];
  [
    (TokenPrecedence, (fun s -> (Right, s.[0] == '@')));
    (TokenPrecedence, (fun s -> (Right, s.[0] == '^')));
    (TokenPrecedence, (fun s -> (Right, String.length s > 1 && s.[0] == '+' && s.[1] == '+')));
  ];
  [
    (TokenPrecedence, (fun s -> (Left, s.[0] == '=' && not (s = "=") && not (s = "=>"))));
    (TokenPrecedence, (fun s -> (Left, s.[0] == '<' && not (s = "<"))));
    (TokenPrecedence, (fun s -> (Left, s.[0] == '>' && not (s = ">"))));
    (TokenPrecedence, (fun s -> (Left, s = "!=")));  (* Not preset in the RWO table! *)
    (TokenPrecedence, (fun s -> (Left, s = "!==")));  (* Not preset in the RWO table! *)
    (TokenPrecedence, (fun s -> (Left, s = "==")));
    (TokenPrecedence, (fun s -> (Left, s = "===")));
    (TokenPrecedence, (fun s -> (Left, s = "<")));
    (TokenPrecedence, (fun s -> (Left, s = ">")));
    (TokenPrecedence, (fun s -> (Left, s.[0] == '|' && not (s = "||"))));
    (TokenPrecedence, (fun s -> (Left, s.[0] == '&' && not (s = "&") && not (s = "&&"))));
    (TokenPrecedence, (fun s -> (Left, s.[0] == '$')));
  ];
  [
    (CustomPrecedence, (fun s -> (Left, s = funToken)));
  ];
  [
    (TokenPrecedence, (fun s -> (Right, s = "&")));
    (TokenPrecedence, (fun s -> (Right, s = "&&")));
  ];
  [
    (TokenPrecedence, (fun s -> (Right, s = "or")));
    (TokenPrecedence, (fun s -> (Right, s = "||")));
  ];
  [
    (* The Left shouldn't ever matter in practice. Should never get in a
       situation with two consecutive infix ? - the colon saves us. *)
    (TokenPrecedence, (fun s -> (Left, s = "?")));
  ];
  [
    (TokenPrecedence, (fun s -> (Right, s = ":=")));
  ];
  [
    (TokenPrecedence, (fun s -> (Right, s = updateToken)));
  ];
  (* It's important to account for ternary ":" being lower precedence than "?" *)
  [
    (TokenPrecedence, (fun s -> (Right, s = ":")))
  ];
  [
    (TokenPrecedence, (fun s -> (Nonassoc, s = "=>")));
  ];
]

(* remove all prefixing backslashes, e.g. \=== becomes === *)
let without_prefixed_backslashes str =
  if str = "" then str
  else if String.get str 0 = '\\' then String.sub str 1 (String.length str - 1)
  else str

let indexOfFirstMatch ~prec lst =
  let rec aux n = function
    | [] -> None
    | [] :: tl -> aux (n + 1) tl
    | ((kind, tester) :: hdTl) :: tl ->
      match prec, kind with
      | Token str, TokenPrecedence | Custom str, CustomPrecedence ->
        let associativity, foundMatch = tester str in
        if foundMatch
        then Some (associativity, n)
        else aux n (hdTl::tl)
      | _ -> aux n (hdTl::tl)
  in
  aux 0 lst

(* Assuming it's an infix function application. *)
let precedenceInfo ~prec =
  (* Removes prefixed backslashes in order to do proper conversion *)
  let prec = match prec with
    | Token str -> Token (without_prefixed_backslashes str)
    | Custom _ -> prec
  in
  indexOfFirstMatch ~prec rules

let isLeftAssociative ~prec = match precedenceInfo ~prec with
  | None -> false
  | Some (Left, _) -> true
  | Some (Right, _) -> false
  | Some (Nonassoc, _) -> false

let isRightAssociative ~prec = match precedenceInfo ~prec with
  | None -> false
  | Some (Right, _) -> true
  | Some (Left, _) -> false
  | Some (Nonassoc, _) -> false

let higherPrecedenceThan c1 c2 =
  match ((precedenceInfo ~prec:c1), (precedenceInfo ~prec:c2)) with
  | (_, None)
  | (None, _) ->
    let (str1, str2) = match (c1, c2) with
      | (Token s1, Token s2) -> ("Token " ^ s1, "Token " ^ s2)
      | (Token s1, Custom s2) -> ("Token " ^ s1, "Custom " ^ s2)
      | (Custom s1, Token s2) -> ("Custom " ^ s1, "Token " ^ s2)
      | (Custom s1, Custom s2) -> ("Custom " ^ s1, "Custom " ^ s2)
    in
    raise (NotPossible ("Cannot determine precedence of two checks " ^ str1 ^ " vs. " ^ str2))
  | (Some (_, p1), Some (_, p2)) -> p1 < p2

let printedStringAndFixityExpr = function
  | {pexp_desc = Pexp_ident {txt=Lident l}} -> printedStringAndFixity l
  | _ -> Normal

(* which identifiers are in fact operators needing parentheses *)
let needs_parens txt =
  match printedStringAndFixity txt with
  | Infix _ -> true
  | UnaryPostfix _ -> true
  | UnaryPlusPrefix _ -> true
  | UnaryMinusPrefix _ -> true
  | UnaryNotPrefix _ -> true
  | AlmostSimplePrefix _ -> true
  | Normal -> false

(* some infixes need spaces around parens to avoid clashes with comment
   syntax. This isn't needed for comment syntax /* */ *)
let needs_spaces txt =
  txt.[0]='*' || txt.[String.length txt - 1] = '*'

let rec orList = function (* only consider ((A|B)|C)*)
  | {ppat_desc = Ppat_or (p1, p2)} -> (orList p1) @ (orList p2)
  | x -> [x]

let override = function
  | Override -> "!"
  | Fresh -> ""

(* variance encoding: need to sync up with the [parser.mly] *)
let type_variance = function
  | Invariant -> ""
  | Covariant -> "+"
  | Contravariant -> "-"

type construct =
  [ `cons of expression list
  | `list of expression list
  | `nil
  | `normal
  | `simple of Longident.t
  | `tuple ]

let view_expr x =
  match x.pexp_desc with
  | Pexp_construct ( {txt= Lident "()"},_) -> `tuple
  | Pexp_construct ( {txt= Lident "[]"},_) -> `nil
  | Pexp_construct ( {txt= Lident"::"},Some _) ->
    let rec loop exp acc = match exp with
      | {pexp_desc=Pexp_construct ({txt=Lident "[]"},_)} ->
        (List.rev acc,true)
      | {pexp_desc=
          Pexp_construct ({txt=Lident "::"},
                           Some ({pexp_desc= Pexp_tuple([e1;e2])}))} ->
        loop e2 (e1::acc)
      | e -> (List.rev (e::acc),false) in
    let (ls,b) = loop x []  in
    if b
    then `list ls
    else `cons ls
  | Pexp_construct (x,None) -> `simple x.txt
  | _ -> `normal

let is_simple_list_expr x =
  match view_expr x with
  | `list _ | `cons _ -> true
  | _ -> false

let is_simple_construct : construct -> bool = function
  | `nil | `tuple | `list _ | `simple _ | `cons _  -> true
  | `normal -> false

let uncurriedTable = Hashtbl.create 42

(* Determines if a list of expressions contains a single unit construct
 * e.g. used to check: MyConstructor() -> exprList == [()]
 * useful to determine if MyConstructor(()) should be printed as MyConstructor()
 * *)
let is_single_unit_construct exprList =
  match exprList with
  | x::[] ->
    let view = view_expr x in
    (match view with
    | `tuple -> true
    | _ -> false)
  | _ -> false

let detectTernary l = match l with
  | [{
      pc_lhs={ppat_desc=Ppat_construct ({txt=Lident "true"}, _)};
      pc_guard=None;
      pc_rhs=ifTrue
    };
    {
      pc_lhs={ppat_desc=Ppat_construct ({txt=Lident "false"}, _)};
      pc_guard=None;
      pc_rhs=ifFalse
    }] -> Some (ifTrue, ifFalse)
  | _ -> None
type funcApplicationLabelStyle =
  (* No attaching to the label, but if the entire application fits on one line,
     the entire application will appear next to the label as you 'd expect. *)
  | NeverWrapFinalItem
  (* Attach the first term if there are exactly two terms involved in the
     application.

     let x = firstTerm (secondTerm_1 secondTerm_2) thirdTerm;

     Ideally, we'd be able to attach all but the last argument into the label any
     time all but the last term will fit - and *not* when (attaching all but
     the last term isn't enough to prevent a wrap) - But there's no way to tell
     ahead of time if it would prevent a wrap.

     However, the number two is somewhat convenient. This models the
     indentation that you'd prefer in non-curried syntax languages like
     JavaScript, where application only ever has two terms.
  *)
  | WrapFinalListyItemIfFewerThan of int

type formatSettings = {
  (* Whether or not to expect that the original parser that generated the AST
     would have annotated constructor argument tuples with explicit arity to
     indicate that they are multiple arguments. (True if parsed in original
     OCaml AST, false if using Reason parser).
  *)
  constructorTupleImplicitArity: bool;
  space: int;

  (* For curried arguments in function *definitions* only: Number of [space]s
     to offset beyond the [let] keyword. Default 1.
  *)
  listsRecordsIndent: int;

  indentWrappedPatternArgs: int;

  indentMatchCases: int;

  (* Amount to indent in label-like constructs such as wrapped function
     applications, etc - or even record fields. This is not the same concept as an
     indented curried argument list. *)
  indentAfterLabels: int;

  (* Amount to indent after the opening brace of switch/try.
     Here's an example of what it would look like w/ [trySwitchIndent = 2]:
     Sticks the expression to the last item in a sequence in several [X | Y | Z
     => expr], and forces X, Y, Z to be split onto several lines. (Otherwise,
     sticking to Z would result in hanging expressions).  TODO: In the first case,
     it's clear that we want patterns to have an "extra" indentation with matching
     in a "match". Create extra config param to pass to [self#pattern] for extra
     indentation in this one case.

      switch x {
      | TwoCombos
          (HeresTwoConstructorArguments x y)
          (HeresTwoConstructorArguments a b) =>
          ((a + b) + x) + y;
      | Short
      | AlsoHasARecord a b {x, y} => (
          retOne,
          retTwo
        )
      | AlsoHasARecord a b {x, y} =>
        callMyFunction
          withArg
          withArg
          withArg
          withArg;
      }
  *)
  trySwitchIndent: int;


  (* In the case of two term function application (when flattened), the first
     term should become part of the label, and the second term should be able to wrap
     This doesn't effect n != 2.

       [true]
       let x = reallyShort allFitsOnOneLine;
       let x = someFunction {
         reallyLongObject: true,
         thatWouldntFitOnThe: true,
         firstLine: true
       };

       [false]
       let x = reallyShort allFitsOnOneLine;
       let x =
        someFunction
          {
            reallyLongObject: true,
            thatWouldntFitOnThe: true,
            firstLine: true
          };
  *)
  funcApplicationLabelStyle: funcApplicationLabelStyle;

  funcCurriedPatternStyle: funcApplicationLabelStyle;

  width: int;

  assumeExplicitArity: bool;

  constructorLists: string list;
}

let defaultSettings = {
  constructorTupleImplicitArity = false;
  space = 1;
  listsRecordsIndent = 2;
  indentWrappedPatternArgs = 2;
  indentMatchCases = 2;
  indentAfterLabels = 2;
  trySwitchIndent = 0;
  funcApplicationLabelStyle = WrapFinalListyItemIfFewerThan 3;
  (* WrapFinalListyItemIfFewerThan is currently a bad idea for curried
     arguments: It looks great in some cases:

        let myFun (a:int) :(
          int,
          string
        ) => (a, "this is a");

     But horrible in others:

        let myFun
            {
              myField,
              yourField
            } :someReturnType => myField + yourField;

        let myFun
            {            // Curried arg wraps
              myField,
              yourField
            } : (       // But the last is "listy" so it docks
          int,          // To the [let].
          int,
          int
        ) => myField + yourField;

     We probably want some special listy label docking/wrapping mode for
     curried function bindings.

  *)
  funcCurriedPatternStyle = NeverWrapFinalItem;
  width = 80;
  assumeExplicitArity = false;
  constructorLists = [];
}
let configuredSettings = ref defaultSettings

let configure ~width ~assumeExplicitArity ~constructorLists = (
  configuredSettings := {defaultSettings with width; assumeExplicitArity; constructorLists}
)

let createFormatter () =
let module Formatter = struct

let settings = !configuredSettings


(* How do we make
   this a label?

   /---------------------\
   let myVal = (oneThing, {
   field: [],
   anotherField: blah
   });

   But in this case, this wider region a label?
   /------------------------------------------------------\
   let myVal = callSomeFunc (oneThing, {field: [], anotherField: blah}, {
   boo: 'hi'
   });

   This is difficult. You must form a label from the preorder traversal of every
   node - except the last encountered in the traversal. An easier heuristic is:

   - The last argument to a functor application is expanded.

   React.CreateClass SomeThing {
   let render {props} => {
   };
   }

   - The last argument to a function application is expanded on the same line.
   - Only if it's not curried with another invocation.
   -- Optionally: "only if everything else is an atom"
   -- Optionally: "only if there are no other args"

   React.createClass someThing {
   render: fn x => y,
   }

   !!! NOT THIS
   React.createClass someThing {
   render: fn x => y,
   }
   somethingElse
*)

let isArityClear attrs =
  (!configuredSettings).assumeExplicitArity ||
  List.exists
    (function
      | ({txt="explicit_arity"}, _) -> true
      | _ -> false
    )
    attrs

let default_indent_body =
  settings.listsRecordsIndent * settings.space

let makeList
    ?listConfigIfCommentsInterleaved
    ?listConfigIfEolCommentsInterleaved
    ?(break=Layout.Never)
    ?(wrap=("", ""))
    ?(inline=(true, false))
    ?(sep=Layout.NoSep)
    ?(indent=default_indent_body)
    ?(sepLeft=true)
    ?(preSpace=false)
    ?(postSpace=false)
    ?(pad=(false,false))
    lst =
  let config =
    { Layout.
      listConfigIfCommentsInterleaved; listConfigIfEolCommentsInterleaved;
      break; wrap; inline; sep; indent; sepLeft; preSpace; postSpace; pad;
    }
  in
  Layout.Sequence (config, lst)

let makeAppList = function
  | [hd] -> hd
  | l -> makeList ~inline:(true, true) ~postSpace:true ~break:IfNeed l

let makeTup ?(wrap=("", ""))?(trailComma=true) ?(uncurried = false) l =
  let (lwrap, rwrap) = wrap in
  let lparen = lwrap ^ (if uncurried then "(. " else "(") in
  makeList
    ~wrap:(lparen, ")" ^ rwrap)
    ~sep:(if trailComma then commaTrail else commaSep)
    ~postSpace:true
    ~break:IfNeed l

let ensureSingleTokenSticksToLabel x =
  let listConfigIfCommentsInterleaved cfg =
    let inline = (true, true) and postSpace = true and indent = 0 in
    {cfg with Layout.break=Always_rec; postSpace; indent; inline}
  in
  makeList ~listConfigIfCommentsInterleaved [x]

let unbreakLabelFormatter formatter =
  let newFormatter labelTerm term =
    match formatter labelTerm term with
    | Easy_format.Label ((labelTerm, settings), term) ->
       Easy_format.Label ((labelTerm,
                           {settings with label_break = `Never}),
                          term)
    | _ -> failwith "not a label"
  in newFormatter

let inlineLabel labelTerm term =
  let settings = {
    label_break = `Never;
    space_after_label = true;
    indent_after_label = 0;
    label_style = Some "inlineLabel";
  } in
  Easy_format.Label ((labelTerm, settings), term)


(* Just for debugging: Set debugWithHtml = true *)
let debugWithHtml = ref false

let html_escape_string s =
  let buf = Buffer.create (2 * String.length s) in
  for i = 0 to String.length s - 1 do
    match s.[i] with
        '&' -> Buffer.add_string buf "&amp;"
      | '<' -> Buffer.add_string buf "&lt;"
      | '>' -> Buffer.add_string buf "&gt;"
      | c -> Buffer.add_char buf c
  done;
  Buffer.contents buf

let html_escape = `Escape_string html_escape_string

let html_style = [
  "atom", { Easy_format.tag_open = "<a>"; tag_close = "</a>" };
  "body", { tag_open = "<lb>"; tag_close = "</lb>" };
  "list", { tag_open = "<l>"; tag_close = "</l>" };
  "op", { tag_open = "<op>"; tag_close = "</op>" };
  "cl", { tag_open = "<cl>"; tag_close = "</cl>" };
  "sep", { tag_open = "<sep>"; tag_close = "</sep>" };
  "label", { tag_open = "<la>"; tag_close = "</la>" };
]

let easyLabel
    ?(break=`Auto) ?(space=false) ?(indent=settings.indentAfterLabels)
    labelTerm term =
  let settings = {
    label_break = break;
    space_after_label = space;
    indent_after_label = indent;
    label_style = Some "label";
  } in
  Easy_format.Label ((labelTerm, settings), term)

let label ?break ?space ?indent (labelTerm:Layout.t) (term:Layout.t) =
  Layout.Label (easyLabel ?break ?indent ?space, labelTerm, term)

let atom ?loc str =
  let style = { Easy_format.atom_style = Some "atomClss" } in
  source_map ?loc (Layout.Easy (Easy_format.Atom(str, style)))

(** Take x,y,z and n and generate [x, y, z, ...n] *)
let makeES6List ?wrap:((lwrap,rwrap)=("", "")) lst last =
  makeList
    ~wrap:(lwrap ^ "[", "]" ^ rwrap)
    ~break:IfNeed ~postSpace:true ~sep:commaTrail
    (lst @ [makeList [atom "..."; last]])

let makeNonIndentedBreakingList lst =
    (* No align closing: So that semis stick to the ends of every break *)
  makeList ~break:Always_rec ~indent:0 ~inline:(true, true) lst

(* Like a <span> could place with other breakableInline lists without upsetting final semicolons *)
let makeSpacedBreakableInlineList lst =
  makeList ~break:IfNeed ~inline:(true, true) ~postSpace:true lst

let makeCommaBreakableListSurround opn cls lst =
  makeList ~break:IfNeed ~postSpace:true ~sep:(Sep ",") ~wrap:(opn, cls) lst

(* TODO: Allow configuration of spacing around colon symbol *)

let formatPrecedence ?(inline=false) ?(wrap=("(", ")")) ?loc formattedTerm =
  source_map ?loc (makeList ~inline:(true, inline) ~wrap ~break:IfNeed [formattedTerm])

let wrap fn term =
  ignore (Format.flush_str_formatter ());
  fn Format.str_formatter term;
  atom (Format.flush_str_formatter ())

(* Don't use `trim` since it kills line return too? *)
let rec beginsWithStar_ line length idx =
  if idx = length then false else
    match String.get line idx with
    | '*' -> true
    | '\t' | ' ' -> beginsWithStar_ line length (idx + 1)
    | _ -> false

let beginsWithStar line = beginsWithStar_ line (String.length line) 0

let rec numLeadingSpace_ line length idx accum =
  if idx = length then accum else
    match String.get line idx with
    | '\t' | ' ' -> numLeadingSpace_ line length (idx + 1) (accum + 1)
    | _ -> accum

let numLeadingSpace line = numLeadingSpace_ line (String.length line) 0 0

(* Computes the smallest leading spaces for non-empty lines *)
let smallestLeadingSpaces strs =
  let rec smallestLeadingSpaces curMin strs = match strs with
    | [] -> curMin
    | ""::tl -> smallestLeadingSpaces curMin tl
    | hd::tl ->
      let leadingSpace = numLeadingSpace hd in
      let nextMin = min curMin leadingSpace in
      smallestLeadingSpaces nextMin tl
  in
  smallestLeadingSpaces 99999 strs

let rec isSequencey = function
  | Layout.SourceMap (_, sub) -> isSequencey sub
  | Layout.Sequence _ -> true
  | Layout.Label (_, _, _) -> false
  | Layout.Easy (Easy_format.List _) -> true
  | Layout.Easy _ -> false
  | Layout.Whitespace (_, sub) -> isSequencey sub

let inline ?(preSpace=false) ?(postSpace=false) labelTerm term =
  makeList [labelTerm; term]
    ~inline:(true, true) ~postSpace ~preSpace ~indent:0 ~break:Layout.Never

let breakline labelTerm term =
  makeList [labelTerm; term]
    ~inline:(true, true) ~indent:0 ~break:Always_rec

let insertBlankLines n term =
  if n = 0
  then term
  else makeList ~inline:(true, true) ~indent:0 ~break:Always_rec
      (Array.to_list (Array.make n (atom "")) @ [term])

let string_after s n = String.sub s n (String.length s - n)

(* This is a special-purpose functions only used by `formatComment_`. Notice we
skip a char below during usage because we know the comment starts with `/*` *)
let rec lineZeroMeaningfulContent_ line length idx accum =
  if idx = length then None
  else
    let ch = String.get line idx in
    if ch = '\t' || ch = ' ' || ch = '*' then
      lineZeroMeaningfulContent_ line length (idx + 1) (accum + 1)
    else Some accum

let lineZeroMeaningfulContent line =
  lineZeroMeaningfulContent_ line (String.length line) 1 0

let formatComment_ txt =
  let commLines =
    Reason_syntax_util.split_by ~keep_empty:true (fun x -> x = '\n')
      (Comment.wrap txt)
  in
  match commLines with
  | [] -> atom ""
  | [hd] ->
    atom hd
  | zero::one::tl ->
    let attemptRemoveCount = (smallestLeadingSpaces (one::tl)) in
    let leftPad =
      if beginsWithStar one then 1
      else match lineZeroMeaningfulContent zero with
        | None -> 1
        | Some num -> num + 1
    in
    let padNonOpeningLine s =
      let numLeadingSpaceForThisLine = numLeadingSpace s in
      if String.length s == 0 then ""
      else (String.make leftPad ' ') ^
           (string_after s (min attemptRemoveCount numLeadingSpaceForThisLine)) in
    let lines = zero :: List.map padNonOpeningLine (one::tl) in
    makeList ~inline:(true, true) ~indent:0 ~break:Always_rec (List.map atom lines)

let formatComment comment =
  source_map ~loc:(Comment.location comment) (formatComment_ comment)

let rec append ?(space=false) txt = function
  | Layout.SourceMap (loc, sub) ->
    Layout.SourceMap (loc, append ~space txt sub)
  | Sequence (config, l) when snd config.wrap <> "" ->
    let sep = if space then " " else "" in
    Sequence ({config with wrap=(fst config.wrap, snd config.wrap ^ sep ^ txt)}, l)
  | Sequence (config, []) ->
    Sequence (config, [atom txt])
  | Sequence ({sep=NoSep} as config, l)
  | Sequence ({sep=Sep("")} as config, l) ->
    let len = List.length l in
    let sub = List.mapi (fun i layout ->
        (* append to the end of the list *)
        if i + 1 = len then
          append ~space txt layout
        else
          layout
      ) l in
    Sequence (config, sub)
  | Label (formatter, left, right) ->
    Label (formatter, left, append ~space txt right)
  | Whitespace(info, sub) ->
      Whitespace(info, append ~space txt sub)
  | layout ->
    inline ~postSpace:space layout (atom txt)

let appendSep spaceBeforeSep sep layout =
  append (if spaceBeforeSep then " " ^ sep else sep) layout

let rec flattenCommentAndSep ?spaceBeforeSep:(spaceBeforeSep=false) ?sepStr = function
  | Layout.SourceMap (loc, sub) ->
     Layout.SourceMap (loc, flattenCommentAndSep ~spaceBeforeSep ?sepStr sub)
  | Layout.Whitespace(info, sub) ->
     Layout.Whitespace(info, flattenCommentAndSep ~spaceBeforeSep ?sepStr sub)
  | layout ->
     begin
       match sepStr with
       | None -> layout
       | Some sep -> appendSep spaceBeforeSep sep layout
     end

let rec preOrderWalk f layout =
  match f layout with
  | Layout.Sequence (listConfig, sublayouts) ->
    let newSublayouts = List.map (preOrderWalk f) sublayouts in
    Layout.Sequence (listConfig, newSublayouts)
  | Layout.Label (formatter, left, right) ->
    let newLeftLayout = preOrderWalk f left in
    let newRightLayout = preOrderWalk f right in
    Layout.Label (formatter, newLeftLayout, newRightLayout)
  | Layout.SourceMap (loc, sub) ->
    Layout.SourceMap (loc, preOrderWalk f sub)
  | Layout.Easy _ as layout -> layout
  | Layout.Whitespace (info, sub) ->
      Layout.Whitespace(info, preOrderWalk f sub)

(** Recursively unbreaks a layout to make sure they stay within the same line *)
let unbreaklayout = preOrderWalk (function
  | Layout.Sequence (listConfig, sublayouts) ->
    Layout.Sequence ({listConfig with break=Layout.Never}, sublayouts)
  | Layout.Label (formatter, left, right) ->
    Layout.Label (unbreakLabelFormatter formatter, left, right)
  | layout -> layout
)

(** [consolidateSeparator layout] walks the [layout], extract separators out of each
 *  list and insert them into PrintTree as separated items
 *)
let consolidateSeparator l = preOrderWalk (function
  | Sequence (listConfig, sublayouts) when listConfig.sep != NoSep && listConfig.sepLeft ->
     (* TODO: Support !sepLeft, and this should apply to the *first* separator if !sepLeft.  *)
     let sublayoutsLen = List.length sublayouts in
     let mapSublayout i layout =
        match (listConfig.sep, (i + 1 = sublayoutsLen)) with
        | (NoSep, _) -> raise (NotPossible "We already covered this case. This shouldn't happen.")
        | (Sep _, true) -> layout
        | (SepFinal (sepStr, _), false)
        | (Sep sepStr, false) ->
          flattenCommentAndSep ~spaceBeforeSep:listConfig.preSpace ~sepStr:sepStr layout
        | (SepFinal (_, finalSepStr), true) ->
          flattenCommentAndSep ~spaceBeforeSep:listConfig.preSpace ~sepStr:finalSepStr layout
     in
     let layoutsWithSepAndComment = List.mapi mapSublayout sublayouts in
     let sep = Layout.NoSep in
     let preSpace = false in
     Sequence ({listConfig with sep; preSpace}, layoutsWithSepAndComment)
  | layout -> layout
) l


(** [insertLinesAboveItems layout] walks the [layout] and insert empty lines *)
let insertLinesAboveItems items = preOrderWalk (function
  | Whitespace(region, sub) ->
      insertBlankLines (WhitespaceRegion.newlines region) sub
  | layout -> layout
) items

let insertCommentIntoWhitespaceRegion comment region subLayout =
  let cl = Comment.location comment in
  let range = WhitespaceRegion.range region in
  (* append the comment to the list of inserted comments in the whitespace region *)
  let nextRegion = WhitespaceRegion.addComment region comment in
  let formattedComment = formatComment comment in
  match WhitespaceRegion.comments region with
  (* the comment inserted into the whitespace region is the first in the region *)
  | [] ->
      (*
       * 1| let a = 1;
       * 2|
       * 3| /* comment at end of whitespace region */
       * 4| let b = 2;
       *)
      if range.lnum_end = cl.loc_end.pos_lnum then
        let subLayout = breakline formattedComment subLayout in
        Layout.Whitespace(nextRegion, subLayout)

      (*
       * 1| let a = 1;
       * 2| /* comment at start of whitespace region */
       * 3|
       * 4| let b = 2;
       *)
      else if range.lnum_start = cl.loc_start.pos_lnum then
        let subLayout = breakline formattedComment (insertBlankLines 1 subLayout) in
        let nextRegion = WhitespaceRegion.modifyNewlines nextRegion 0 in
        Whitespace(nextRegion, subLayout)

      (*
       * 1| let a = 1;
       * 2|
       * 3| /* comment floats in whitespace region */
       * 4|
       * 5| let b = 2;
       *)
      else
        let subLayout = breakline formattedComment (insertBlankLines 1 subLayout) in
        Whitespace(nextRegion, subLayout)

  (* The whitespace region contains already inserted comments *)
  | prevComment::_cs ->
      let pcl = Comment.location prevComment in
      (* check if the comment is attached to the start of the region *)
      let attachedToStartRegion = cl.loc_start.pos_lnum = range.lnum_start in
      let nextRegion =
        (*
         * 1| let a = 1;
         * 2| /* comment sits on the beginning of the region */
         * 3| /* previous comment */
         * 4|
         * 5| let b = 2;
         *)
        if attachedToStartRegion then
          (* we don't want a newline between `let a = 1` and the `comment sits
           * on the beginning of the region` comment*)
          WhitespaceRegion.modifyNewlines nextRegion 0
        (*
         * 1| let a = 1;
         * 2|
         * 3| /* comment isn't located at the beginnin of a region*/
         * 4| /* previous comment */
         * 5|
         * 6| let b = 2;
         *)
        else
          nextRegion
      in
      (*
       * 1| let a = 1;
       * 2| /* comment */
       * 3|                      --> whitespace between
       * 4| /* previous comment */
       * 5| let b = 1;
       *)
      if Reason_location.hasSpaceBetween pcl cl then
      (* pcl.loc_start.pos_lnum - cl.loc_end.pos_lnum > 1 then *)
        let subLayout = breakline formattedComment (insertBlankLines 1 subLayout) in
        let withComment = Layout.Whitespace(nextRegion, subLayout) in
        withComment

      (*
       * 1| let a = 1;
       * 2|
       * 3| /* comment */          | no whitespace between `comment`
       * 4| /* previous comment */ | and `previous comment`
       * 5| let b = 1;
       *)
      else
        let subLayout = breakline formattedComment subLayout in
        let withComment =  Layout.Whitespace(nextRegion, subLayout) in
        withComment

(**
 * prependSingleLineComment inserts a single line comment right above layout
 *)
let rec prependSingleLineComment comment layout =
  match layout with
  | Layout.SourceMap (loc, sub) ->
     Layout.SourceMap (loc, prependSingleLineComment comment sub)
  | Sequence (config, hd::tl) when config.break = Always_rec->
     Sequence(config, (prependSingleLineComment comment hd)::tl)
  | Whitespace(info, sub) ->
      insertCommentIntoWhitespaceRegion comment info sub
  | layout ->
      breakline (formatComment comment) layout

(* breakAncestors break ancestors above node, but not comment attachment itself.*)
let appendComment ~breakAncestors layout comment =
  let text = Comment.wrap comment in
  let layout = match layout with
  | Layout.Whitespace(info, sublayout) ->
    Layout.Whitespace(info, makeList ~break:Layout.Never ~postSpace:true [sublayout; atom text])
  | layout ->
      makeList ~break:Layout.Never ~postSpace:true [layout; atom text]
  in
  if breakAncestors then
    makeList ~inline:(true, true) ~postSpace:false ~preSpace:true ~indent:0
      ~break:Always_rec [layout]
  else
    layout

(**
 * [looselyAttachComment layout comment] preorderly walks the layout and
 * find a place where the comment can be loosely attached to
 *)
let rec looselyAttachComment ~breakAncestors layout comment =
  let location = Comment.location comment in
  match layout with
  | Layout.SourceMap (loc, sub) ->
     Layout.SourceMap (loc, looselyAttachComment ~breakAncestors sub comment)
  | Layout.Whitespace (info, sub) ->
     Layout.Whitespace(info, looselyAttachComment ~breakAncestors sub comment)
  | Easy _ ->
     inline ~postSpace:true layout (formatComment comment)
  | Sequence (listConfig, subLayouts)
    when List.exists (Layout.contains_location ~location) subLayouts ->
     (* If any of the subLayout strictly contains this comment, recurse into to it *)
    let recurse_sublayout layout =
      if Layout.contains_location layout ~location
      then begin
        looselyAttachComment ~breakAncestors layout comment
      end
      else layout
    in
    Sequence (listConfig, List.map recurse_sublayout subLayouts)
  | Sequence (listConfig, subLayouts) when subLayouts == [] ->
    (* If there are no subLayouts (empty body), create a Sequence of just the comment *)
    Sequence (listConfig, [formatComment comment])
  | Sequence (listConfig, subLayouts) ->
    let (beforeComment, afterComment) =
      Reason_syntax_util.pick_while (Layout.is_before ~location) subLayouts in
    let newSubLayout = match List.rev beforeComment with
      | [] ->
        Reason_syntax_util.map_first (prependSingleLineComment comment) afterComment
      | hd :: tl ->
        List.rev_append
          (appendComment ~breakAncestors hd comment :: tl) afterComment
    in
    Sequence (listConfig, newSubLayout)
  | Label (formatter, left, right) ->
    let newLeft, newRight =
      match (Layout.get_location left, Layout.get_location right) with
      | (None, None) ->
        (left, looselyAttachComment ~breakAncestors right comment)
      | (_, Some loc2) when location_contains loc2 location ->
        (left, looselyAttachComment ~breakAncestors right comment)
      | (Some loc1, _) when location_contains loc1 location ->
        (looselyAttachComment ~breakAncestors left comment, right)
      | (Some loc1, Some _) when location_is_before location loc1 ->
        (prependSingleLineComment comment left, right)
      | (Some _, Some loc2) when location_is_before location loc2 ->
        (left, prependSingleLineComment comment right)
      | _ -> (left, appendComment ~breakAncestors right comment)
    in
    Label (formatter, newLeft, newRight)

(**
 * [insertSingleLineComment layout comment] preorderly walks the layout and
 * find a place where the SingleLineComment can be fit into
 *)
let rec insertSingleLineComment layout comment =
  let location = Comment.location comment in
  match layout with
  | Layout.SourceMap (loc, sub) ->
    Layout.SourceMap (loc, insertSingleLineComment sub comment)
  | Layout.Whitespace (info, sub) ->
      let range = WhitespaceRegion.range info in
      if Range.containsLoc range location then
        insertCommentIntoWhitespaceRegion comment info sub
      else
        Layout.Whitespace(info, insertSingleLineComment sub comment)
  | Easy _ ->
    prependSingleLineComment comment layout
  | Sequence (listConfig, subLayouts) when subLayouts == [] ->
    (* If there are no subLayouts (empty body), create a Sequence of just the
     * comment. We need to be careful when the empty body contains a //-style
     * comment. Example:
     *   let make = () => {
     *     //
     *   };
     * It is clear that the sequence needs to always break here, otherwise
     * we get a parse error: let make = () => { // };
     * The closing brace and semicolon `};` would become part of the comment…
     *)
    let listConfig =
      if Reason_comment.isLineComment comment then
        {listConfig with break = Always_rec}
      else
        listConfig
    in
    Sequence (listConfig, [formatComment comment])
  | Sequence (listConfig, subLayouts) ->
    let (beforeComment, afterComment) =
      Reason_syntax_util.pick_while (Layout.is_before ~location) subLayouts in
    begin match afterComment with
      (* Nothing in the list is after comment, attach comment to the statement before the comment *)
      | [] ->
        let break sublayout = breakline sublayout (formatComment comment) in
        Sequence (listConfig, Reason_syntax_util.map_last break beforeComment)
      | hd::tl ->
        let afterComment =
          match Layout.get_location hd with
          | Some loc when location_contains loc location ->
            insertSingleLineComment hd comment :: tl
          | Some loc ->
            Layout.SourceMap (loc, (prependSingleLineComment comment hd)) :: tl
          | _ ->
            prependSingleLineComment comment hd :: tl
        in
        Sequence (listConfig, beforeComment @ afterComment)
    end
  | Label (formatter, left, right) ->
    let leftLoc = Layout.get_location left in
    let rightLoc = Layout.get_location right in
    let newLeft, newRight = match (leftLoc, rightLoc) with
      | (None, None) ->
        (left, insertSingleLineComment right comment)
      | (_, Some loc2) when location_contains loc2 location ->
        (left, insertSingleLineComment right comment)
      | (Some loc1, _) when location_contains loc1 location ->
        (insertSingleLineComment left comment, right)
      | (Some loc1, Some _) when location_is_before location loc1 ->
        (prependSingleLineComment comment left, right)
      | (Some _, Some loc2) when location_is_before location loc2 ->
        (left, prependSingleLineComment comment right)
      | _ ->
        (left, breakline right (formatComment comment))
    in
    Label (formatter, newLeft, newRight)

let rec attachCommentToNodeRight layout comment =
  match layout with
  | Layout.Sequence (config, sub) when snd config.wrap <> "" ->
    (* jwalke: This is quite the abuse of the "wrap" config *)
    let lwrap, rwrap = config.wrap in
    let rwrap = rwrap ^ " " ^ Comment.wrap comment in
    Layout.Sequence ({config with wrap=(lwrap, rwrap)}, sub)
  | Layout.SourceMap (loc, sub) ->
    Layout.SourceMap (loc, attachCommentToNodeRight sub comment)
  | layout -> inline ~postSpace:true layout (formatComment comment)

let rec attachCommentToNodeLeft comment layout =
  match layout with
  | Layout.Sequence (config, sub) when snd config.wrap <> "" ->
    let lwrap, rwrap = config.wrap in
    let lwrap = Comment.wrap comment ^ " " ^ lwrap in
    Layout.Sequence ({config with wrap = (lwrap, rwrap)}, sub)
  | Layout.SourceMap (loc, sub) ->
    Layout.SourceMap (loc, attachCommentToNodeLeft comment sub )
  | layout ->
    Layout.Label (inlineLabel, formatComment comment, layout)

(** [tryPerfectlyAttachComment layout comment] postorderly walk the [layout] and tries
 *  to perfectly attach a comment with a layout node.
 *
 *  Perfectly attach here means a comment's start location is equal to the node's end location
 *  and vice versa.
 *
 *  If the comment can be perfectly attached to any layout node, returns (newLayout, None),
 *  meaning the comment is consumed. Otherwise returns the (unchangedLayout, Some comment),
 *  meaning the comment is not consumed.
 *
 * "perfect attachment" doesn't make sense for end of line comments:
 *
 *       {
 *         x: 0,
 *         y: 0
 *       }
 *
 * One of these will be "perfectly attached" to the zero and the other won't.
 * Why should the comma have such an influence? Trailing commas and semicolons
 * may be inserted or removed, an we need end-of-line comments to never be
 * impacted by that. Therefore, never try to "perfectly" attach EOL comments.
 *)
let rec tryPerfectlyAttachComment layout = function
  | None -> (layout, None)
  | Some comment -> perfectlyAttachComment comment layout

and perfectlyAttachComment comment = function
  | Layout.Sequence (listConfig, subLayouts) ->
    let distributeCommentIntoSubLayouts (i, processed, newComment) layout =
      let (layout, newComment) =
        tryPerfectlyAttachComment layout newComment in
      (i + 1, layout::processed, newComment)
    in
    let (_, processed, consumed) =
      List.fold_left
        distributeCommentIntoSubLayouts
        (0, [], Some comment) (List.rev subLayouts)
    in
    Layout.Sequence (listConfig, processed), consumed
  | Layout.Label (labelFormatter, left, right) ->
    let (newRight, comment) = perfectlyAttachComment comment right in
    let (newLeft, comment) = tryPerfectlyAttachComment left comment in
    Layout.Label (labelFormatter, newLeft, newRight), comment
  | Layout.SourceMap (loc, subLayout) ->
    let commloc = Comment.location comment in
    if loc.loc_end.Lexing.pos_lnum = loc.loc_start.Lexing.pos_lnum &&
       commloc.loc_start.Lexing.pos_cnum = loc.loc_end.Lexing.pos_cnum
    then
      (Layout.SourceMap (loc, makeList ~inline:(true, true) ~break:Always
                    [unbreaklayout (attachCommentToNodeRight subLayout comment)]),
       None)
    else
      let (layout, comment) = perfectlyAttachComment comment subLayout in
      begin match comment with
        | None -> (Layout.SourceMap (loc, layout), None)
        | Some comment ->
          if commloc.loc_end.Lexing.pos_cnum =
             loc.loc_start.Lexing.pos_cnum  then
            (Layout.SourceMap (loc, attachCommentToNodeLeft comment layout), None)
          else if commloc.loc_start.Lexing.pos_cnum = loc.loc_end.Lexing.pos_cnum then
            (Layout.SourceMap (loc, attachCommentToNodeRight layout comment), None)
          else
            (Layout.SourceMap (loc, layout), Some comment)
      end
  | Whitespace(info, subLayout) ->
      begin match perfectlyAttachComment comment subLayout with
      | (newLayout, None) -> (Whitespace(info, newLayout), None)
      | (newLayout, Some c) -> (Whitespace(info, newLayout), Some c)
      end
  | layout -> (layout, Some comment)

let insertRegularComment layout comment =
  match perfectlyAttachComment comment layout with
  | (layout, None) -> layout
  | (layout, Some _) ->
      looselyAttachComment ~breakAncestors:false layout comment

let insertEndOfLineComment layout comment =
  looselyAttachComment ~breakAncestors:true layout comment

let rec partitionComments_ ((singleLines, endOfLines, regulars) as soFar) = function
  | [] -> soFar
  | com :: tl ->
    match Comment.category com with
    | Comment.EndOfLine ->
      partitionComments_ (singleLines, (com :: endOfLines), regulars) tl
    | Comment.SingleLine ->
      partitionComments_ ((com :: singleLines), endOfLines, regulars) tl
    | Comment.Regular ->
      partitionComments_ (singleLines, endOfLines, (com :: regulars)) tl

let partitionComments comments =
  let (singleLines, endOfLines, regulars) =
    partitionComments_ ([], [], []) comments in
  (singleLines, List.rev endOfLines, regulars)

(*
 * Partition single line comments based on a location into two lists:
 * - one contains the comments before/same height of that location
 * - the other contains the comments after the location
 *)
let partitionSingleLineComments loc singleLineComments =
  let (before, after) = List.fold_left (fun (before, after) comment ->
    let cl = Comment.location comment in
    let isAfter = loc.loc_end.pos_lnum < cl.loc_start.pos_lnum in
    if isAfter then
      (before, comment::after)
    else
      (comment::before, after)
  ) ([], []) singleLineComments
  in (List.rev before, after)

(*
 * appends all [singleLineComments] after the [layout].
 * [loc] marks the end of [layout]
 *)
let appendSingleLineCommentsToEnd loc layout singleLineComments =
  let rec aux prevLoc layout i = function
    | comment::cs ->
        let loc = Comment.location comment in
        let formattedComment = formatComment comment in
        let commentLayout = if Reason_location.hasSpaceBetween loc prevLoc then
          insertBlankLines 1 formattedComment
        else
          formattedComment
        in
        (* The initial layout breaks ugly with `breakline`,
         * an inline list (that never breaks) fixes this *)
        let newLayout = if i == 0 then
          makeList ~inline:(true, true) ~break:Never [layout; commentLayout]
        else
          breakline layout commentLayout
        in
        aux loc newLayout (i + 1) cs
    | [] -> layout
  in
  aux loc layout 0 singleLineComments

(*
 * For simplicity, the formatting of comments happens in two parts in context of a source map:
 * 1) insert the singleLineComments with the interleaving algorithm contained in
 *    `insertSingleLineComment` for all comments overlapping with the sourcemap.
 *    A `Layout.Whitespace` node signals an intent to preserve whitespace here.
 * 2) SingleLineComments after the sourcemap, e.g. at the end of .re/.rei file,
 *    get attached with `appendSingleLineCommentsToEnd`. Due to the fact there
 *    aren't any real ocaml ast nodes anymore after the sourcemap (end of a
 *    file), the printing of the comments can be done in one pass with
 *    `appendSingleLineCommentsToEnd`. This is more performant and
 *    simplifies the implementation of comment attachment.
 *)
let attachSingleLineComments singleLineComments = function
  | Layout.SourceMap(loc, subLayout) ->
      let (before, after) = partitionSingleLineComments loc singleLineComments in
      let layout = List.fold_left insertSingleLineComment subLayout before in
      appendSingleLineCommentsToEnd loc layout after
  | layout ->
    List.fold_left insertSingleLineComment layout singleLineComments

let format_layout ?comments ppf layout =
  let easy = match comments with
    | None -> Layout.to_easy_format layout
    | Some comments ->
      let (singleLines, endOfLines, regulars) = partitionComments comments in
      (* TODO: Stop generating multiple versions of the tree, and instead generate one new tree. *)
      (* Layout.dump Format.std_formatter layout; *)
      let layout = List.fold_left insertRegularComment layout regulars in
      let layout = consolidateSeparator layout in
      let layout = List.fold_left insertEndOfLineComment layout endOfLines in
      (* Layout.dump Format.std_formatter layout; *)
      let layout = attachSingleLineComments singleLines layout in
      (* Layout.dump Format.std_formatter layout; *)
      let layout = insertLinesAboveItems layout in
      let layout = Layout.to_easy_format layout in
      (* Layout.dump_easy Format.std_formatter layout; *)
      layout
  in
  let buf = Buffer.create 1000 in
  let fauxmatter = Format.formatter_of_buffer buf in
  let _ = Format.pp_set_margin fauxmatter settings.width in
  if debugWithHtml.contents then
    Easy_format.Pretty.define_styles fauxmatter html_escape html_style;
  let _ = Easy_format.Pretty.to_formatter fauxmatter easy in
  let trimmed = Reason_syntax_util.processLineEndingsAndStarts (Buffer.contents buf) in
  Format.fprintf ppf "%s\n" trimmed;
  Format.pp_print_flush ppf ()

let partitionFinalWrapping listTester wrapFinalItemSetting x =
  let rev = List.rev x in
  match (rev, wrapFinalItemSetting) with
    | ([], _) -> raise (NotPossible "shouldnt be partitioning 0 label attachments")
    | (_, NeverWrapFinalItem) -> None
    | (last::revEverythingButLast, WrapFinalListyItemIfFewerThan max) ->
        if not (listTester last) || (List.length x) >= max then
          None
        else
          Some (List.rev revEverythingButLast, last)

let semiTerminated term = makeList [term; atom ";"]

(* postSpace is so that when comments are interleaved, we still use spacing rules. *)
let makeLetSequence ?(wrap=("{", "}")) letItems =
  makeList
    ~break:Always_rec
    ~inline:(true, false)
    ~wrap
    ~postSpace:true
    ~sep:(SepFinal (";", ";"))
    letItems

let makeLetSequenceSingleLine ?(wrap=("{", "}")) letItems =
  makeList
    ~break:IfNeed
    ~inline:(true, false)
    ~wrap
    ~preSpace:true
    ~postSpace:true
    ~sep:(Sep ";")
    letItems

(* postSpace is so that when comments are interleaved, we still use spacing rules. *)
let makeUnguardedLetSequence ?(sep=(Layout.SepFinal (";", ";"))) letItems =
  makeList
    ~break:Always_rec
    ~inline:(true, true)
    ~wrap:("", "")
    ~indent:0
    ~postSpace:true
    ~sep
    letItems

let formatSimpleAttributed x y =
  makeList
    ~wrap:("(", ")")
    ~break:IfNeed
    ~indent:0
    ~postSpace:true
    (List.concat [y; [x]])

let formatAttributed ?(labelBreak=`Auto) x y =
  label
    ~break:labelBreak
    ~indent:0
    ~space:true
    (makeList ~inline:(true, true) ~postSpace:true y)
    x

(* For when the type constraint should be treated as a separate breakable line item itself
   not docked to some value/pattern label.
   fun x
       y
       : retType => blah;
 *)
let formatJustTheTypeConstraint typ =
  makeList ~postSpace:false ~sep:(Sep " ") [atom ":"; typ]

let formatTypeConstraint one two =
  label ~space:true (makeList ~postSpace:false [one; atom ":"]) two

let formatCoerce expr optType coerced =
  match optType with
    | None ->
      label ~space:true (makeList ~postSpace:true [expr; atom ":>"]) coerced
    | Some typ ->
      label ~space:true (makeList ~postSpace:true [formatTypeConstraint expr typ; atom ":>"]) coerced


(* Standard function application style indentation - no special wrapping
 * behavior.
 *
 * Formats like this:
 *
 *   let result =
 *     someFunc
 *       (10, 20);
 *
 *
 * Instead of this:
 *
 *   let result =
 *     someFunc (
 *       10,
 *       20
 *     );
 *
 * The outer list wrapping fixes #566: format should break the whole
 * application before breaking arguments.
 *)
let formatIndentedApplication headApplicationItem argApplicationItems =
  makeList ~inline:(true, true) ~postSpace:true ~break:IfNeed [
    label
      ~space:true
      headApplicationItem
      (makeAppList argApplicationItems)
  ]


(* The loc, is an optional location or the returned app terms *)
let formatAttachmentApplication finalWrapping (attachTo: (bool * Layout.t) option) (appTermItems, loc) =
  let partitioning = finalWrapping appTermItems in
  match partitioning with
    | None -> (
        match (appTermItems, attachTo) with
          | ([], _) -> raise (NotPossible "No app terms")
          | ([hd], None) -> source_map ?loc hd
          | ([hd], (Some (useSpace, toThis))) -> label ~space:useSpace toThis (source_map ?loc hd)
          | (hd::tl, None) ->
            source_map ?loc (formatIndentedApplication hd tl)
          | (hd::tl, (Some (useSpace, toThis))) ->
            label
              ~space:useSpace
              toThis
              (source_map ?loc (formatIndentedApplication hd tl))
      )
    | Some (attachedList, wrappedListy) -> (
        match (attachedList, attachTo) with
        | ([], Some (useSpace, toThis)) ->
          label ~space:useSpace toThis (source_map ?loc wrappedListy)
        | ([], None) ->
          (* Not Sure when this would happen *)
          source_map ?loc wrappedListy
        | (_::_, Some (useSpace, toThis)) ->
          (* TODO: Can't attach location to this - maybe rewrite anyways *)
          let attachedArgs = makeAppList attachedList in
          label ~space:useSpace toThis
            (label ~space:true attachedArgs wrappedListy)
        | (_::_, None) ->
          (* Args that are "attached to nothing" *)
          let appList = makeAppList attachedList in
          source_map ?loc (label ~space:true appList wrappedListy)
      )

(*
  Preprocesses an expression term for the sake of label attachments ([letx =
  expr]or record [field: expr]). Function application should have special
  treatment when placed next to a label. (The invoked function term should
  "stick" to the label in some cases). In others, the invoked function term
  should become a new label for the remaining items to be indented under.
 *)
let applicationFinalWrapping x =
  partitionFinalWrapping isSequencey settings.funcApplicationLabelStyle x

let curriedFunctionFinalWrapping x =
  partitionFinalWrapping isSequencey settings.funcCurriedPatternStyle x

let typeApplicationFinalWrapping typeApplicationItems =
  partitionFinalWrapping isSequencey settings.funcApplicationLabelStyle typeApplicationItems


(* add parentheses to binders when they are in fact infix or prefix operators *)
let protectIdentifier txt =
  if not (needs_parens txt) then atom txt
  else if needs_spaces txt then makeList ~wrap:("(", ")") ~pad:(true, true) [atom txt]
  else atom ("(" ^ txt ^ ")")

let protectLongIdentifier longPrefix txt =
  makeList [longPrefix; atom "."; protectIdentifier txt]

let paren b fu ppf x =
  if b
  then Format.fprintf ppf "(%a)" fu x
  else fu ppf x

let constant_string ppf s =
  Format.fprintf ppf "%S" s

let tyvar ppf str =
  Format.fprintf ppf "'%s" str

(* In some places parens shouldn't be printed for readability:
 * e.g. Some((-1)) should be printed as Some(-1)
 * In `1 + (-1)` -1 should be wrapped in parens for readability
 *)
let constant ?raw_literal ?(parens=true) ppf = function
  | Pconst_char i ->
    Format.fprintf ppf "%C"  i
  | Pconst_string (i, None) ->
    begin match raw_literal with
      | Some text ->
        Format.fprintf ppf "\"%s\"" text
      | None ->
        Format.fprintf ppf "\"%s\"" (Reason_syntax_util.escape_string i)
    end
  | Pconst_string (i, Some delim) ->
    Format.fprintf ppf "{%s|%s|%s}" delim i delim
  | Pconst_integer (i, None) ->
    paren (parens && i.[0] = '-')
      (fun ppf -> Format.fprintf ppf "%s") ppf i
  | Pconst_integer (i, Some m) ->
    paren (parens && i.[0] = '-')
      (fun ppf (i, m) -> Format.fprintf ppf "%s%c" i m) ppf (i,m)
  | Pconst_float (i, None) ->
    paren (parens && i.[0] = '-')
      (fun ppf -> Format.fprintf ppf "%s") ppf i
  | Pconst_float (i, Some m) ->
    paren (parens && i.[0] = '-')
      (fun ppf (i,m) -> Format.fprintf ppf "%s%c" i m) ppf (i,m)

let is_punned_labelled_expression e lbl = match e.pexp_desc with
  | Pexp_ident { txt }
  | Pexp_constraint ({pexp_desc = Pexp_ident { txt }}, _)
  | Pexp_coerce ({pexp_desc = Pexp_ident { txt }}, _, _)
    -> txt = Longident.parse lbl
  | _ -> false

let is_punned_labelled_pattern p lbl = match p.ppat_desc with
  | Ppat_constraint ({ ppat_desc = Ppat_var _; ppat_attributes = _::_ }, _)
    -> false
  | Ppat_constraint ({ ppat_desc = Ppat_var { txt } }, _)
  | Ppat_var { txt }
    -> txt = lbl
  | _ -> false

let isLongIdentWithDot = function
  | Ldot _ -> true
  | _ -> false

(* Js.t -> useful for bucklescript sugar `Js.t({. foo: bar})` -> `{. "foo": bar}` *)
let isJsDotTLongIdent ident = match ident with
  | Ldot (Lident "Js", "t") -> true
  | _ -> false

let recordRowIsPunned pld =
      let name = pld.pld_name.txt in
      (match pld.pld_type with
        | { ptyp_desc = (
            Ptyp_constr (
              { txt },
              (* don't pun parameterized types, e.g. {tag: tag 'props} *)
              [])
            );
            (* Don't pun types that have attributes attached, e.g. { foo: [@bar] foo } *)
            ptyp_attributes = [];
          _}
            when
            (Longident.last txt = name
              (* Don't pun types from other modules, e.g. type bar = {foo: Baz.foo}; *)
              && isLongIdentWithDot txt == false) -> true
        | _ -> false)

let isPunnedJsxArg lbl ident =
  not (isLongIdentWithDot ident.txt) && (Longident.last ident.txt) = lbl

let is_unit_pattern x = match x.ppat_desc with
  | Ppat_construct ( {txt= Lident"()"}, None) -> true
  | _ -> false

let is_ident_pattern x = match x.ppat_desc with
  | Ppat_var _ -> true
  | _ -> false

let is_any_pattern x = x.ppat_desc = Ppat_any

let is_direct_pattern x = x.ppat_attributes == [] && match x.ppat_desc with
  | Ppat_construct ( {txt= Lident"()"}, None) -> true
  | _ -> false

let isJSXComponent expr =
  match expr with
  | ({pexp_desc= Pexp_apply ({pexp_desc=Pexp_ident _}, args); pexp_attributes})
  | ({pexp_desc= Pexp_apply ({pexp_desc=Pexp_letmodule(_,_,_)}, args); pexp_attributes}) ->
    let {jsxAttrs} = partitionAttributes pexp_attributes in
    let hasLabelledChildrenLiteral = List.exists (function
      | (Labelled "children", _) -> true
      | _ -> false
    ) args in
    let rec hasSingleNonLabelledUnitAndIsAtTheEnd l = match l with
    | [] -> false
    | (Nolabel, {pexp_desc = Pexp_construct ({txt = Lident "()"}, _)}) :: [] -> true
    | (Nolabel, _) :: _ -> false
    | _ :: rest -> hasSingleNonLabelledUnitAndIsAtTheEnd rest
    in
    if jsxAttrs != []
       && hasLabelledChildrenLiteral
       && hasSingleNonLabelledUnitAndIsAtTheEnd args
    then
      true
    else
      false
  | _ -> false

(* Some cases require special formatting when there's a function application
 * with a single argument containing some kind of structure with braces/parens/brackets.
 * Example: `foo({a: 1, b: 2})` needs to be formatted as
 *  foo({
 *    a: 1,
 *    b: 2
 *  })
 *  when the line length dictates breaking. Notice how `({` and `})` 'hug'.
 *  Also applies to (poly)variants because they can be seen as a form of "function application".
 *  This function says if a list of expressions fulfills the need to be formatted like
 *  the example above. *)
let isSingleArgParenApplication = function
  | [{pexp_attributes = []; pexp_desc = Pexp_record _}]
  | [{pexp_attributes = []; pexp_desc = Pexp_tuple _}]
  | [{pexp_attributes = []; pexp_desc = Pexp_array _}]
  | [{pexp_attributes = []; pexp_desc = Pexp_object _}] -> true
  | [{pexp_attributes = []; pexp_desc = Pexp_extension (s, _)}] when s.txt = "bs.obj" -> true
  | [({pexp_attributes = []} as exp)] when (is_simple_list_expr exp) -> true
  | _ -> false

(*
 * Determines if the arguments of a constructor pattern match need
 * special printing. If there's one argument & they have some kind of wrapping,
 * they're wrapping need to 'hug' the surrounding parens.
 * Example:
 *  switch x {
 *  | Some({
 *      a,
 *      b,
 *    }) => ()
 *  }
 *
 *  Notice how ({ and }) hug.
 *  This applies for records, arrays, tuples & lists.
 *  See `singleArgParenPattern` for the acutal formatting
 *)
let isSingleArgParenPattern = function
  | [{ppat_attributes = []; ppat_desc = Ppat_record _}]
  | [{ppat_attributes = []; ppat_desc = Ppat_array _}]
  | [{ppat_attributes = []; ppat_desc = Ppat_tuple _}] -> true
  | [{ppat_attributes = []; ppat_desc = Ppat_construct (({txt=Lident "::"}), _)}] -> true
  | _ -> false

(* Flattens a resolvedRule into a list of infixChain nodes.
 * When foo |> f |> z gets parsed, we get the following tree:
 *         |>
 *        /  \
 *    foo      |>
 *            /  \
 *          f      z
 * To format this recursive tree in a way that allows nice breaking
 * & respects the print-width, we need some kind of flattened
 * version of the above tree. `computeInfixChain` transforms the tree
 * in a flattened version which allows flexible formatting.
 * E.g. we get
 *  [LayoutNode foo; InfixToken |>; LayoutNode f; InfixToken |>; LayoutNode z]
 *)
let rec computeInfixChain = function
  | LayoutNode layoutNode -> [Layout layoutNode]
  | InfixTree (op, leftResolvedRule, rightResolvedRule) ->
      (computeInfixChain leftResolvedRule) @ [InfixToken op] @ (computeInfixChain rightResolvedRule)

let equalityOperators = ["!="; "!=="; "==="; "=="; ">="; "<="; "<"; ">"]

(* Formats a flattened list of infixChain nodes into a list of layoutNodes
 * which allow smooth line-breaking
 * e.g. [LayoutNode foo; InfixToken |>; LayoutNode f; InfixToken |>; LayoutNode z]
 * becomes
 * [
 *   foo
 * ; |> f        --> label
 * ; |> z        --> label
 * ]
 * If you make a list out of this items, we get smooth line breaking
 *  foo |> f |> z
 * becomes
 *  foo
 *  |> f
 *  |> z
 *  when the print-width forces line breaks.
 *)
let formatComputedInfixChain infixChainList =
  let layout_of_group group currentToken =
    (* Represents the `foo` in
     * foo
     * |> f
     * |> z *)
    if List.length group < 2 then
      makeList ~inline:(true, true) ~sep:(Sep " ") group
    (* Basic equality operators require special formatting, we can't give it
     * 'classic' infix operator formatting, otherwise we would get
     * let example =
     *  true
     *  != false
     *  && "a"
     *  == "b"
     *  *)
    else if List.mem currentToken equalityOperators then
      let hd = List.hd group in
      let tl = makeList ~inline:(true, true) ~sep:(Sep " ") (List.tl group) in
      makeList ~inline:(true, true) ~sep:(Sep " ") ~break:IfNeed [hd; tl]
    else if currentToken.[0] = '#' then
      let isSharpEqual = currentToken = sharpOpEqualToken in
      makeList ~postSpace:isSharpEqual group
    else
      (* Represents `|> f` in foo |> f
       * We need a label here to indent possible closing parens
       * on the same height as the infix operator
       * e.g.
       * >|= (
       *   fun body =>
       *     Printf.sprintf
       *       "okokok" uri meth headers body
       * )   <-- notice how this closing paren is on the same height as >|=
       *)
      label ~break:`Never ~space:true (atom currentToken) (List.nth group 1)
  in
  let rec print acc group currentToken l =
    match l with
    | x::xs -> (match x with
      | InfixToken t ->
          (* = or := *)
          if List.mem t requireIndentFor then
            let groupNode =
              makeList ~inline:(true, true) ~sep:(Sep " ") ((print [] group currentToken []) @ [atom t])
            in
            let children =
              makeList ~inline:(true, true) ~preSpace:true ~break:IfNeed
                (print [] [] t xs)
            in
            print (acc @ [label ~space:true groupNode children]) [] t []
          (* Represents:
           * List.map @@
           * List.length
           *
           * Notice how we want the `@@` on the first line.
           * Extra indent puts pressure on the subsequent line lengths
           * *)
          else if t = "@@" then
            let groupNode =
              makeList ~inline:(true, true) ~sep:(Sep " ") (group @ [atom t])
            in
            print (acc @ [groupNode]) [] t xs
          (* != !== === == >= <= < > etc *)
          else if List.mem t equalityOperators then
            print acc ((print [] group currentToken []) @ [atom t]) t xs
          else
            begin if requireNoSpaceFor t then
              begin if (currentToken = "" || requireNoSpaceFor currentToken) then
                print acc (group@[atom t]) t xs
              else
                (* a + b + foo##bar##baz
                 * `foo` needs to be picked from the current group
                 * and inserted into a new one. This way `foo`
                 * gets the special "chained"-printing:
                 * foo##bar##baz. *)
                 begin match List.rev group with
                 |  hd::tl ->
                     let acc =
                       acc @ [layout_of_group (List.rev tl) currentToken]
                      in
                     print acc [hd; atom t] t xs
                 | [] -> print acc (group@[atom t]) t xs
                 end
              end
            else
              print (acc @ [layout_of_group group currentToken]) [(atom t)] t xs
            end
      | Layout layoutNode -> print acc (group @ [layoutNode]) currentToken xs
      )
    | [] ->
      if List.mem currentToken requireIndentFor then
        acc @ group
        else
          acc @ [layout_of_group group currentToken]
  in
  let l = print [] [] "" infixChainList in
  makeList ~inline:(true, true) ~sep:(Sep " ") ~break:IfNeed l

(**
 * [groupAndPrint] will print every item in [items] according to the function [xf].
 * [getLoc] will extract the location from an item. Based on the difference
 * between the location of two items, if there's whitespace between the two
 * (taken possible comments into account), items get grouped.
 * Every group designates a series of layout nodes "in need
 * of whitespace above". A group gets decorated with a Whitespace node
 * containing enough info to interleave whitespace at a later time during
 * printing.
 *)
let groupAndPrint ~xf ~getLoc ~comments items =
  let rec group prevLoc curr acc = function
    (* group items *)
    | x::xs ->
        let item = xf x in
        let loc = getLoc x in
        (* Get the range between the current and previous item
         * Example:
         * 1| let a = 1;
         * 2|            --> this is the range between the two
         * 3| let b = 2;
         * *)
        let range = Range.makeRangeBetween prevLoc loc in
        (* If there's whitespace interleaved, append the new layout node
         * to a new group, otherwise keep it in the current group.
         * Takes possible comments interleaved into account.
         *
         * Example:
         * 1| let a = 1;
         * 2|
         * 3| let b = 2;
         * 4| let c = 3;
         * `let b = 2` will mark the start of a new group
         * `let c = 3` will be added to the group containing `let b = 2`
         *)
        if Range.containsWhitespace ~range ~comments () then
          group loc [(range, item)] ((List.rev curr)::acc) xs
        else
          group loc ((range, item)::curr) acc xs
    (* convert groups into "Layout.Whitespace" *)
    | [] ->
        let groups = List.rev ((List.rev curr)::acc) in
        List.mapi (fun i group -> match group with
          | curr::xs ->
              let (range, x) = curr in
              (* if this is the first group of all "items", the number of
               * newlines interleaved should be 0, else we collapse all newlines
               * to 1.
               *
               * Example:
               * module Abc = {
               *   let a = 1;
               *
               *   let b = 2;
               * }
               * `let a = 1` should be wrapped in a `Layout.Whitespace` because a
               * user might put comments above the `let a = 1`.
               * e.g.
               * module Abc = {
               *   /* comment 1 */
               *
               *   /* comment 2 */
               *   let a = 1;
               *
               *  A Whitespace-node will automatically take care of the whitespace
               *  interleaving between the comments.
               *)
              let newlines = if i > 0 then 1 else 0 in
              let region = WhitespaceRegion.make ~range ~newlines () in
              let firstLayout = Layout.Whitespace(region, x) in
              (* the first layout node of every group taks care of the
               * whitespace above a group*)
              (firstLayout::(List.map snd xs))
          | [] -> []
        ) groups
  in
  match items with
  | first::rest ->
      List.concat (group (getLoc first) [] [] (first::rest))
  | [] -> []

let printer = object(self:'self)
  val pipe = false
  val semi = false

  val inline_braces = false
  val preserve_braces = true

  (* *Mutable state* in the printer to keep track of all comments
   * Used when whitespace needs to be interleaved.
   * The printing algorithm needs to take the comments into account in between
   * two items, to correctly determine if there's whitespace between two items.
   * The ast doesn't know if there are comments between two items, since
   * comments are store separately. The location diff between two items
   * might indicate whitespace between the two. While in reality there are
   * comments filling that whitespace. The printer needs access to the comments
   * for this reason.
   *
   * Example:
   * 1| let a = 1;
   * 2|
   * 3|
   * 4| let b = 2;
   *  -> here we can just diff the locations between `let a = 1` and `let b = 2`
   *
   * 1| let a = 1;
   * 2| /* a comment */
   * 3| /* another comment */
   * 4| let b = 2;
   *  -> here the location diff will result into false info if we don't include
   *  the comments in the diffing
   *)
  val mutable comments = []

  method comments = comments
  method trackComment comment = comments <- comment::comments

  (* The test and first branch of ternaries must be guarded *)
  method under_pipe = {<pipe=true>}
  method under_semi = {<semi=true>}
  method reset_semi = {<semi=false>}
  method reset_pipe = {<pipe=false>}
  method reset = {<pipe=false;semi=false>}

  method inline_braces = {<inline_braces=true>}
  method dont_preserve_braces = {<preserve_braces=false>}
  method reset_request_braces = {<inline_braces=false; preserve_braces=true>}


  method longident = function
    | Lident s -> (protectIdentifier s)
    | Ldot(longPrefix, s) ->
        (protectLongIdentifier (self#longident longPrefix) s)
    | Lapply (y,s) -> makeList [self#longident y; atom "("; self#longident s; atom ")";]

  (* This form allows applicative functors. *)
  method longident_class_or_type_loc x = self#longident x.txt
  (* TODO: Fail if observing applicative functors for this form. *)
  method longident_loc (x:Longident.t Location.loc) =
    source_map ~loc:x.loc (self#longident x.txt)

  method constant ?raw_literal ?(parens=true) =
    wrap (constant ?raw_literal ~parens)

  method constant_string = wrap constant_string
  method tyvar = wrap tyvar

  (* c ['a,'b] *)
  method class_params_def = function
    | [] -> atom ""
    | l -> makeTup (List.map self#type_param l)

  (* This will fall through to the simple version. *)
  method non_arrowed_core_type x = self#non_arrowed_non_simple_core_type x

  method core_type2 x =
    let {stdAttrs; uncurried} = partitionAttributes x.ptyp_attributes in
    let uncurried = uncurried || try Hashtbl.find uncurriedTable x.ptyp_loc with | Not_found -> false in
    if stdAttrs != [] then
      formatAttributed
        (self#non_arrowed_simple_core_type {x with ptyp_attributes = []})
        (self#attributes stdAttrs)
    else
      let x = if uncurried then { x with ptyp_attributes = [] } else x in
      match x.ptyp_desc with
        | Ptyp_arrow _ ->
          let rec allArrowSegments ?(uncurried=false) acc = function
            | { ptyp_desc = Ptyp_arrow (l, ct1, ct2); ptyp_attributes = []} ->
              allArrowSegments ~uncurried:false
                ((l,ct1, false || uncurried) :: acc) ct2
            | rhs ->
              let rhs = self#core_type2 rhs in
              let is_tuple typ = match typ.ptyp_desc with
                | Ptyp_tuple _ -> true
                | _ -> false
              in
              match acc with
              | [(Nolabel, lhs, uncurried )] when not (is_tuple lhs) ->
                  let t = self#non_arrowed_simple_core_type lhs in
                  let lhs = if uncurried then
                    makeList ~wrap:("(. ", ")") ~postSpace:true [t]
                  else t in
                (lhs, rhs)
              | acc ->
                let params = List.rev_map self#type_with_label acc in
                (makeCommaBreakableListSurround "(" ")" params, rhs)
          in
          let (lhs, rhs) = allArrowSegments ~uncurried [] x in
          let normalized = makeList
              ~preSpace:true ~postSpace:true ~inline:(true, true)
              ~break:IfNeed ~sep:(Sep "=>") [lhs; rhs]
          in source_map ~loc:x.ptyp_loc normalized
        | Ptyp_poly (sl, ct) ->
          let ct = self#core_type ct in
          let poly = match sl with
          | [] -> ct
          | sl ->
            makeList ~break:IfNeed ~postSpace:true [
              makeList [
                makeList ~postSpace:true (List.map (fun x -> self#tyvar x) sl);
                atom ".";
              ];
              ct
            ]
          in source_map ~loc:x.ptyp_loc poly
        | _ -> self#non_arrowed_core_type x

  (* Same as core_type2 but can be aliased *)
  method core_type x =
    let {stdAttrs; uncurried} = partitionAttributes x.ptyp_attributes in
    let () = if uncurried then Hashtbl.add uncurriedTable x.ptyp_loc true in
    if stdAttrs != [] then
      formatAttributed
        (self#non_arrowed_simple_core_type {x with ptyp_attributes = []})
        (self#attributes stdAttrs)
    else match x.ptyp_desc with
      | (Ptyp_alias (ct, s)) ->
        source_map ~loc:x.ptyp_loc
          (label
             ~space:true
             (self#core_type ct)
             (makeList ~postSpace:true [atom "as"; atom ("'" ^ s)]))
      | _ -> self#core_type2 x

  method type_with_label (lbl, c, uncurried) =
    let typ = self#core_type c in
    let t = match lbl with
    | Nolabel -> typ
    | Labelled lbl ->
        makeList ~sep:(Sep " ") [atom (namedArgSym ^ lbl ^ ":"); typ]
    | Optional lbl ->
        makeList ~sep:(Sep " ") [atom (namedArgSym ^ lbl ^ ":"); label typ (atom "=?")]
    in
    if uncurried then
      makeList ~postSpace:true [atom "."; t]
    else t

  method type_param (ct, a) =
    makeList [atom (type_variance a); self#core_type ct]

  (* According to the parse rule [type_declaration], the "type declaration"'s
   * physical location (as indicated by [td.ptype_loc]) begins with the
   * identifier and includes the constraints. *)
  method formatOneTypeDef prepend name assignToken ({ptype_params; ptype_kind; ptype_loc} as td) =
    let (equalInitiatedSegments, constraints) = (self#type_declaration_binding_segments td) in
    let formattedTypeParams = List.map self#type_param ptype_params in
    let binding = makeList ~postSpace:true [prepend;name] in
    (*
        /-----------everythingButConstraints--------------  | -constraints--\
       /-innerL---| ------innerR--------------------------\
      /binding\     /typeparams\ /--equalInitiatedSegments-\
      type name      'v1    'v1  =  foo = private bar        constraint a = b
    *)

    let labelWithParams = match formattedTypeParams with
      | [] -> binding
      | l -> label binding (makeTup l)
    in
    let everythingButConstraints =
      let nameParamsEquals = makeList ~postSpace:true [labelWithParams; assignToken] in
      match equalInitiatedSegments with
        | [] -> labelWithParams
        | _::_::_::_ -> raise (NotPossible "More than two type segments.")
        | hd::[] ->
            formatAttachmentApplication
              typeApplicationFinalWrapping
              (Some (true, nameParamsEquals))
              (hd, None)
        | hd::hd2::[] ->
            let first = makeList ~postSpace:true ~break:IfNeed ~inline:(true, true) (hd @ [atom "="]) in
            (*
             * Because we want a record as a label with the opening brace on the same line
             * and the closing brace indented at the beginning, we can't wrap it in a list here
             * Example:
             * type doubleEqualsRecord =
             *  myRecordWithReallyLongName = {   <- opening brace on the same line
             *    xx: int,
             *    yy: int
             *  };                               <- closing brace indentation
             *)
            let second = match ptype_kind with
              | Ptype_record _ -> List.hd hd2
              | _ -> makeList ~postSpace:true ~break:IfNeed ~inline:(true, true) hd2
            in
            label ~space:true nameParamsEquals (
              label ~space:true first second
            )
    in
    let everything =
      match constraints with
        | [] -> everythingButConstraints
        | hd::tl -> makeList ~break:IfNeed ~postSpace:true ~indent:0 ~inline:(true, true) (everythingButConstraints::hd::tl)
    in
    source_map ~loc:ptype_loc everything

  method formatOneTypeExt prepend name assignToken te =
    let privateAtom = (atom "pri") in
    let privatize scope lst = match scope with
      | Public -> lst
      | Private -> privateAtom::lst in
    let equalInitiatedSegments =
      let segments = List.map self#type_extension_binding_segments te.ptyext_constructors in
      let privatized_segments = privatize te.ptyext_private segments in
      [makeList ~break:Always_rec ~postSpace:true ~inline:(true, true) privatized_segments] in
    let formattedTypeParams = List.map self#type_param te.ptyext_params in
    let binding = makeList ~postSpace:true (prepend::name::[]) in
    let labelWithParams = match formattedTypeParams with
      | [] -> binding
      | l -> label binding (makeTup l)
    in
    let everything =
      let nameParamsEquals = makeList ~postSpace:true [labelWithParams; assignToken] in
      formatAttachmentApplication
             typeApplicationFinalWrapping
             (Some (true, nameParamsEquals))
             (equalInitiatedSegments, None)
    in
    source_map ~loc:te.ptyext_path.loc everything

  method type_extension_binding_segments {pext_kind; pext_loc; pext_attributes; pext_name} =
    let normalize lst = match lst with
        | [] -> raise (NotPossible "should not be called")
        | [hd] -> hd
        | _::_ -> makeList lst
      in
      let add_bar name attrs args =
        let lbl = begin match args with
        | None -> name
        | Some args -> label name args
        end in
        if attrs != [] then
         label ~space:true
            (makeList
              ~postSpace:true
              [
                atom "|";
                makeList
                  ~postSpace:true
                  ~break:Layout.IfNeed
                  ~inline:(true, true)
                  (self#attributes attrs)
              ]
            )
            lbl
        else
          makeList ~postSpace:true [atom "|"; lbl]
      in
    let sourceMappedName = atom ~loc:pext_name.loc pext_name.txt in
    let resolved = match pext_kind with
      | Pext_decl (ctor_args, gadt) ->
        let formattedArgs = match ctor_args with
          | Pcstr_tuple [] -> []
          | Pcstr_tuple args -> [makeTup (List.map self#non_arrowed_non_simple_core_type args)]
          | Pcstr_record r -> [self#record_declaration ~wrap:("({", "})") r]
        in
        let formattedGadt = match gadt with
        | None -> None
        | Some x -> Some (
            makeList [
              formatJustTheTypeConstraint (self#core_type x)
            ]
          )
        in
        (formattedArgs, formattedGadt)
      (* type bar += Foo = Attr.Foo *)
      | Pext_rebind rebind ->
        let r = self#longident_loc rebind in
        (* we put an empty space before the '=': we don't have access to the fact
         * that we need a space because of the Pext_rebind later *)
        let prepend = (atom " =") in
        ([makeList ~postSpace:true [prepend; r]], None)
    in
      (*
        The first element of the tuple represents constructor arguments,
        the second an optional formatted gadt.

        Case 1: No constructor arguments, neither a gadt
          type attr = ..;
          type attr += | Str

        Case 2: No constructor arguments, is a gadt
          type attr = ..;
          type attr += | Str :attr

        Case 3: Has Constructor args, not a gadt
          type attr  = ..;
          type attr += | Str(string);
          type attr += | Point(int, int);

        Case 4: Has Constructor args & is a gadt
          type attr  = ..;
          type attr += | Point(int, int) :attr;
      *)
    let everything = match resolved with
      | ([], None) -> add_bar sourceMappedName pext_attributes None
      | ([], Some gadt) -> add_bar sourceMappedName pext_attributes (Some gadt)
      | (ctorArgs, None) -> add_bar sourceMappedName pext_attributes (Some (normalize ctorArgs))
      | (ctorArgs, Some gadt) -> add_bar sourceMappedName pext_attributes (Some (normalize (ctorArgs@[gadt])))
    in
    source_map ~loc:pext_loc everything

  (* shared by [Pstr_type,Psig_type]*)
  method type_def_list (rf, l) =
    (* As oposed to used in type substitution. *)
    let formatOneTypeDefStandard prepend td =
      let itm =
        self#formatOneTypeDef
          prepend
          (atom ~loc:td.ptype_name.loc td.ptype_name.txt)
          (atom "=")
          td
      in
      let {stdAttrs; docAttrs} = partitionAttributes ~partDoc:true td.ptype_attributes in
      let layout = self#attach_std_item_attrs stdAttrs itm in
      self#attachDocAttrsToLayout
        ~stdAttrs
        ~docAttrs
        ~loc:td.ptype_loc
        ~layout
        ()
    in

    match l with
      | [] -> raise (NotPossible "asking for type list of nothing")
      | hd::tl ->
          let first =
            match rf with
            | Recursive -> formatOneTypeDefStandard (atom "type") hd
            | Nonrecursive ->
                formatOneTypeDefStandard (atom "type nonrec") hd
          in
          match tl with
            (* Exactly one type *)
            | [] -> first
            | _::_ as typeList ->
                let items = (hd.ptype_loc, first)::(List.map (fun ptyp ->
                    (ptyp.ptype_loc, formatOneTypeDefStandard (atom "and") ptyp)
                  ) typeList
                ) in
                makeList ~indent:0 ~inline:(true, true) ~break:Always_rec (
                  groupAndPrint
                    ~xf:snd
                    ~getLoc:fst
                    ~comments:self#comments
                    items
                )

  method type_variant_leaf ?opt_ampersand:(a=false) ?polymorphic:(p=false) = self#type_variant_leaf1 a p true
  method type_variant_leaf_nobar ?opt_ampersand:(a=false) ?polymorphic:(p=false) = self#type_variant_leaf1 a p false

  (* TODOATTRIBUTES: Attributes on the entire variant leaf are likely
   * not parsed or printed correctly. *)
  method type_variant_leaf1 opt_ampersand polymorphic print_bar x =
    let {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes} = x in
    let {stdAttrs; docAttrs} = partitionAttributes ~partDoc:true pcd_attributes in
    let ampersand_helper i arg =
      let ct = self#core_type arg in
      let ct = match arg.ptyp_desc with
        | Ptyp_tuple _ -> ct
        | _ -> makeTup [ct]
      in
      if i == 0 && not opt_ampersand then
        ct
      else
        label (atom "&") ct
    in
    let args = match pcd_args with
      | Pcstr_record r ->
          [self#record_declaration ~wrap:("({", "})") r]
      | Pcstr_tuple [] -> []
      | Pcstr_tuple l when polymorphic -> List.mapi ampersand_helper l
      (* Here's why this works. With the new syntax, all the args, are already inside of
        a safely guarded place like Constructor(here, andHere). Compare that to the
        previous syntax Constructor here andHere. In the previous syntax, we needed to
        require that we print "non-arrowed" types for here, and andHere to avoid
        something like Constructor a=>b c=>d. In the new syntax, we don't care if here
        and andHere have unguarded arrow types like a=>b because they're safely
        separated by commas.
       *)
      | Pcstr_tuple l -> [makeTup (List.map self#core_type l)]
    in
    let gadtRes = match pcd_res with
      | None -> None
      | Some x -> Some (
          formatJustTheTypeConstraint (self#core_type x)
        )
    in
    let normalize lst = match lst with
      | [] -> raise (NotPossible "should not be called")
      | [hd] -> hd
      | _::_ -> makeList ~inline:(true, true) ~break:IfNeed ~postSpace:true lst
    in
    let add_bar constructor =
      makeList ~postSpace:true (if print_bar then [atom "|"; constructor] else [constructor])
    in
    (* In some cases (e.g. inline records) we want the label with bar & the gadt resolution
     * as a list.
     *   | If {
     *       pred: expr bool,
     *       true_branch: expr 'a,
     *       false_branch: expr 'a
     *     }                           ==> end of label
     *     :expr 'a;                   ==> gadt res
     * The label & the gadt res form two separate units combined into a list.
     * This is necessary to properly align the closing '}' on the same height as the 'If'.
     *)
    let add_bar_2 ?gadt name args =
      let lbl = label name args in
      let fullLbl = match gadt with
        | Some g -> makeList ~inline:(true, true) ~break:IfNeed [lbl; g]
        | None -> lbl
      in
      add_bar fullLbl
    in

    let prefix = if polymorphic then "`" else "" in
    let sourceMappedName = atom ~loc:pcd_name.loc (prefix ^ pcd_name.txt) in
    let sourceMappedNameWithAttributes =
      let layout = match stdAttrs with
      | [] -> sourceMappedName
      | stdAttrs ->
        formatAttributed sourceMappedName (self#attributes stdAttrs)
      in
      match docAttrs with
      | [] -> layout
      | docAttrs ->
        makeList ~break:Always ~inline:(true, true) [
          makeList (self#attributes docAttrs);
          layout
        ]
    in
    let constructorName = makeList ~postSpace:true [sourceMappedNameWithAttributes] in
    let everything = match (args, gadtRes) with
      | ([], None) -> add_bar sourceMappedNameWithAttributes
      | ([], Some gadt) -> add_bar_2 sourceMappedNameWithAttributes gadt
      | (_::_, None) -> add_bar_2 constructorName (normalize args)
      | (_::_, Some gadt) ->
          (match pcd_args with
            | Pcstr_record _ -> add_bar_2 ~gadt constructorName (normalize args)
            | _ -> add_bar_2 constructorName ~gadt (normalize args))
    in
    source_map ~loc:pcd_loc everything

  method record_declaration ?(wrap=("{", "}")) ?assumeRecordLoc lbls =
    let recordRow pld =
      let hasPunning = recordRowIsPunned pld in
      let name =
        if hasPunning
        then [atom pld.pld_name.txt]
        else [atom pld.pld_name.txt; atom ":"]
      in
      let name = source_map ~loc:pld.pld_name.loc (makeList name) in
      let withMutable =
        match pld.pld_mutable with
        | Immutable -> name
        | Mutable -> makeList ~postSpace:true [atom "mutable"; name]
      in
      let recordRow = if hasPunning then
          label withMutable (atom "")
        else
          label ~space:true withMutable (self#core_type pld.pld_type)
      in
      let recordRow = match pld.pld_attributes with
      | [] -> recordRow
      | attrs ->
          let {stdAttrs; docAttrs} = partitionAttributes ~partDoc:true attrs in
        let stdAttrsLayout =
          makeList ~inline:(true, true) ~postSpace:true (self#attributes stdAttrs)
        in
        let docAttrsLayout = makeList ~inline:(true, true) (self#attributes docAttrs) in
        let children = match (docAttrs, stdAttrs) with
        | [], [] -> [recordRow]
        | _, [] -> [docAttrsLayout; recordRow]
        | [], _ -> [stdAttrsLayout; recordRow]
        | _, _ ->
            [docAttrsLayout; stdAttrsLayout; recordRow]
        in
        makeList ~inline:(true, true) ~break:Always_rec children
      in
      source_map ~loc:pld.pld_loc recordRow
    in
    let rows = List.map recordRow lbls in
    (* if a record has more than 2 rows, always break *)
    let break =
      if List.length rows >= 2
      then Layout.Always_rec
      else Layout.IfNeed
    in
    source_map ?loc:assumeRecordLoc
      (makeList ~wrap ~sep:commaTrail ~postSpace:true ~break rows)

  (* Returns the type declaration partitioned into three segments - one
     suitable for appending to a label, the actual type manifest
     and the list of constraints. *)
  method type_declaration_binding_segments x =
    (* Segments of the type binding (occuring after the type keyword) that
       should begin with "=". Zero to two total sections.
       This is just a straightforward reverse mapping from the original parser:
        type_kind:
            /*empty*/
              { (Ptype_abstract, Public, None) }
          | EQUAL core_type
              { (Ptype_abstract, Public, Some $2) }
          | EQUAL PRIVATE core_type
              { (Ptype_abstract, Private, Some $3) }
          | EQUAL constructor_declarations
              { (Ptype_variant(List.rev $2), Public, None) }
          | EQUAL PRIVATE constructor_declarations
              { (Ptype_variant(List.rev $3), Private, None) }
          | EQUAL private_flag BAR constructor_declarations
              { (Ptype_variant(List.rev $4), $2, None) }
          | EQUAL DOTDOT
              { (Ptype_open, Public, None) }
          | EQUAL private_flag LBRACE label_declarations opt_comma RBRACE
              { (Ptype_record(List.rev $4), $2, None) }
          | EQUAL core_type EQUAL private_flag opt_bar constructor_declarations
              { (Ptype_variant(List.rev $6), $4, Some $2) }
          | EQUAL core_type EQUAL DOTDOT
              { (Ptype_open, Public, Some $2) }
          | EQUAL core_type EQUAL private_flag LBRACE label_declarations opt_comma RBRACE
              { (Ptype_record(List.rev $6), $4, Some $2) }
    *)
    let privateAtom = (atom "pri") in
    let privatize scope lst = match scope with
      | Public -> lst
      | Private -> privateAtom::lst in

    let estimateRecordOpenBracePoint () =
      match x.ptype_params with
        | [] -> x.ptype_name.loc.loc_end
        | _ ->
          (fst (List.nth x.ptype_params (List.length x.ptype_params - 1))).ptyp_loc.loc_end
    in

    let equalInitiatedSegments = match (x.ptype_kind, x.ptype_private, x.ptype_manifest) with
      (* /*empty*/ {(Ptype_abstract, Public, None)} *)
      | (Ptype_abstract, Public, None) -> [

        ]
      (* EQUAL core_type {(Ptype_abstract, Public, Some _)} *)
      | (Ptype_abstract, Public, Some y) -> [
          [self#core_type y]
        ]
      (* EQUAL PRIVATE core_type {(Ptype_abstract, Private, Some $3)} *)
      | (Ptype_abstract, Private, Some y) -> [
          [privateAtom; self#core_type y]
        ]
      (* EQUAL constructor_declarations {(Ptype_variant _., Public, None)} *)
      (* This case is redundant *)
      (* | (Ptype_variant lst, Public, None) -> [ *)
      (*     [makeSpacedBreakableInlineList (List.map type_variant_leaf lst)] *)
      (*   ] *)
      (* EQUAL PRIVATE constructor_declarations {(Ptype_variant _, Private, None)} *)
      | (Ptype_variant lst, Private, None) -> [
          [privateAtom; makeList ~break:IfNeed ~postSpace:true ~inline:(true, true) (List.map self#type_variant_leaf lst)]
        ]
      (* EQUAL private_flag BAR constructor_declarations {(Ptype_variant _, $2, None)} *)
      | (Ptype_variant lst, scope, None) ->  [
          privatize scope [makeList ~break:Always_rec ~postSpace:true ~inline:(true, true) (List.map self#type_variant_leaf lst)]
        ]
      (* EQUAL DOTDOT {(Ptype_open, Public, None)} *)
      | (Ptype_open, Public, None) -> [
          [atom ".."]
        ]
      (* Super confusing how record/variants' manifest is not actually the
         description of the structure. What's in the manifest in that case is
         the *second* EQUALS asignment. *)

      (* EQUAL private_flag LBRACE label_declarations opt_comma RBRACE {(Ptype_record _, $2, None)} *)
      | (Ptype_record lst, scope, None) ->
          let assumeRecordLoc = {loc_start = estimateRecordOpenBracePoint(); loc_end = x.ptype_loc.loc_end; loc_ghost = false} in
          [privatize scope [self#record_declaration ~assumeRecordLoc lst]]
      (* And now all of the forms involving *TWO* equals *)
      (* Again, super confusing how manifests of variants/records represent the
         structure after the second equals. *)
      (* ================================================*)


      (* EQUAL core_type EQUAL private_flag opt_bar constructor_declarations {
         (Ptype_variant _, _, Some _)} *)
      | (Ptype_variant lst, scope, Some mani) -> [
          [self#core_type mani];
          let variant = makeList ~break:IfNeed ~postSpace:true ~inline:(true, true) (List.map self#type_variant_leaf lst) in
          privatize scope [variant];
        ]

      (* EQUAL core_type EQUAL DOTDOT {(Ptype_open, Public, Some $2)} *)
      | (Ptype_open, Public, Some mani) -> [
          [self#core_type mani];
          [atom ".."];
        ]
      (* EQUAL core_type EQUAL private_flag LBRACE label_declarations opt_comma RBRACE
           {(Ptype_record _, $4, Some $2)} *)
      | (Ptype_record lst, scope, Some mani) ->
          let declaration = self#record_declaration lst in
          let record = match scope with
            | Public -> [declaration]
            | Private -> [label ~space:true privateAtom declaration]
          in
          [ [self#core_type mani]; record ]

      (* Everything else is impossible *)
      (* ================================================*)

      | (_, _, _ ) ->  raise (NotPossible "Encountered impossible type specification")
    in

    let makeConstraint (ct1, ct2, _) =
      let constraintEq = makeList ~postSpace:true [
        atom "constraint";
        self#core_type ct1;
        atom "=";
      ] in
      label ~space:true constraintEq (self#core_type ct2) in
    let constraints = List.map makeConstraint x.ptype_cstrs in
    (equalInitiatedSegments, constraints)

  (* "non-arrowed" means "a type where all arrows are inside at least one level of parens"

    z => z: not a "non-arrowed" type.
    (a, b): a "non-arrowed" type.
    (z=>z): a "non-arrowed" type because the arrows are guarded by parens.

    A "non arrowed, non simple" type would be one that is not-arrowed, and also
    not "simple". Simple means it is "clearly one unit" like (a, b), identifier,
    "hello", None.
  *)
  method non_arrowed_non_simple_core_type x =
    let {stdAttrs} = partitionAttributes x.ptyp_attributes in
    if stdAttrs != [] then
      formatAttributed
        (self#non_arrowed_simple_core_type {x with ptyp_attributes=[]})
        (self#attributes stdAttrs)
    else
      match x.ptyp_desc with
      (* This significantly differs from the standard OCaml printer/parser:
         Type constructors are no longer simple *)
      | _ -> self#non_arrowed_simple_core_type x

  method type_param_list_element = function
    | {ptyp_attributes = []; ptyp_desc = Ptyp_package(lid,cstrs)} ->
        self#typ_package ~mod_prefix:true lid cstrs
    | t -> self#core_type t

  method non_arrowed_simple_core_type x =
    let {stdAttrs} = partitionAttributes x.ptyp_attributes in
    if stdAttrs != [] then
      formatSimpleAttributed
        (self#non_arrowed_simple_core_type {x with ptyp_attributes=[]})
        (self#attributes stdAttrs)
    else
      let result =
        match x.ptyp_desc with
        (*   LPAREN core_type_comma_list RPAREN %prec below_NEWDOT *)
        (*       { match $2 with *)
        (*         | [] -> raise Parse_error *)
        (*         | one::[] -> one *)
        (*         | moreThanOne -> mktyp(Ptyp_tuple(List.rev moreThanOne)) } *)
        | Ptyp_tuple l -> makeTup (List.map self#type_param_list_element l)
        | Ptyp_object (l, o) -> self#unparseObject l o
        | Ptyp_package (lid, cstrs) ->
            self#typ_package ~protect:true ~mod_prefix:true lid cstrs
        (*   | QUOTE ident *)
        (*       { mktyp(Ptyp_var $2) } *)
        | Ptyp_var s -> ensureSingleTokenSticksToLabel (self#tyvar s)
        (*   | UNDERSCORE *)
        (*       { mktyp(Ptyp_any) } *)
        | Ptyp_any -> ensureSingleTokenSticksToLabel (atom "_")
        (*   | type_longident *)
        (*       { mktyp(Ptyp_constr(mkrhs $1 1, [])) } *)
        | Ptyp_constr (li, []) ->
          (* [ensureSingleTokenSticksToLabel] loses location information which is important
               when you are embedded inside a list and comments are to be interleaved around you.
               Therefore, we wrap the result in the correct [SourceMap].  *)
          source_map ~loc:li.loc
            (ensureSingleTokenSticksToLabel (self#longident_loc li))
        | Ptyp_constr (li, l) ->
            (match l with
            | [{ptyp_desc = Ptyp_object (_::_ as l, o) }] when isJsDotTLongIdent li.txt ->
                (* should have one or more rows, Js.t({..}) should print as Js.t({..})
                 * {..} has a totally different meaning than Js.t({..}) *)
                self#unparseObject ~withStringKeys:true l o
            | [{ptyp_desc = Ptyp_object (l, o) }] when not (isJsDotTLongIdent li.txt) ->
                label (self#longident_loc li)
                  (self#unparseObject ~wrap:("(",")") l o)
            | [{ptyp_desc = Ptyp_constr(lii, [{ ptyp_desc = Ptyp_object (_::_ as ll, o)}])}]
              when isJsDotTLongIdent lii.txt ->
              label (self#longident_loc li)
                (self#unparseObject ~withStringKeys:true ~wrap:("(",")") ll o)
            | _ ->
              (* small guidance: in `type foo = bar`, we're now at the `bar` part *)

              (* The single identifier has to be wrapped in a [ensureSingleTokenSticksToLabel] to
                 avoid (@see @avoidSingleTokenWrapping): *)
              label
                (self#longident_loc li)
                (makeTup (
                  List.map self#type_param_list_element l
                ))
            )
        | Ptyp_variant (l, closed, low) ->
          let pcd_loc = x.ptyp_loc in
          let pcd_attributes = x.ptyp_attributes in
          let pcd_res = None in
          let variant_helper i rf =
            match rf with
              | Rtag (label, attrs, opt_ampersand, ctl) ->
                let pcd_name = {
                  txt = label;
                  loc = pcd_loc;
                } in
                let pcd_args = Pcstr_tuple ctl in
                let all_attrs = List.concat [pcd_attributes; attrs] in
                self#type_variant_leaf ~opt_ampersand ~polymorphic:true {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes = all_attrs}
              | Rinherit ct ->
                (* '| type' is required if the Rinherit is not the first
                  row_field in the list
                 *)
                if i = 0 then
                  self#core_type ct
                else
                  makeList ~postSpace:true [atom "|"; self#core_type ct] in
          let (designator, tl) =
            match (closed,low) with
              | (Closed,None) -> ("", [])
              | (Closed,Some tl) -> ("<", tl)
              | (Open,_) -> (">", []) in
          let node_list = List.mapi variant_helper l in
          let ll = (List.map (fun t -> atom ("`" ^ t)) tl) in
          let tag_list = makeList ~postSpace:true ~break:IfNeed ((atom ">")::ll) in
          let type_list = if tl != [] then node_list@[tag_list] else node_list in
          makeList ~wrap:("[" ^ designator,"]") ~pad:(true, false) ~postSpace:true ~break:IfNeed type_list
        | Ptyp_class (li, []) -> makeList [atom "#"; self#longident_loc li]
        | Ptyp_class (li, l) ->
          label
            (makeList [atom "#"; self#longident_loc li])
            (makeTup (List.map self#core_type l))
        | Ptyp_extension e -> self#extension e
        | Ptyp_arrow (_, _, _)
        | Ptyp_alias (_, _)
        | Ptyp_poly (_, _) ->
            makeList ~wrap:("(",")") ~break:IfNeed [self#core_type x]
      in
      source_map ~loc:x.ptyp_loc result
  (* TODO: ensure that we have a form of desugaring that protects *)
  (* when final argument of curried pattern is a type constraint: *)
  (* | COLON non_arrowed_core_type EQUALGREATER expr
      { mkexp_constraint $4 (Some $2, None) }         *)
  (*                         \----/   \--/
                             constraint coerce

                             Creates a ghost expression:
                             mkexp_constraint | Some t, None -> ghexp(Pexp_constraint(e, t))
  *)

  method pattern_list_split_cons acc = function
    | {
      ppat_desc = Ppat_construct (
        { txt = Lident("::")},
        Some {ppat_desc = Ppat_tuple ([pat1; pat2])}
      ) } ->
        self#pattern_list_split_cons (pat1::acc) pat2
    | p -> (List.rev acc), p

  (*
   * Adds parens to the right sub-tree when it is not a single node:
   *
   * A | B                   is formatted as    A | B
   * A | (B | C)             is formatted as    A | (B | C)
   *
   * Also, adds parens to both sub-trees when both of them
   * are not a single node:
   * (A | B) | (C | D)       is formatted as    A | B | (C | D)
   * A | B | (C | D)         is formatted as    A | B | (C | D)
   * (A | B) | C             is formatted as    A | B | C
   * A | B | C               is formatted as    A | B | C
   *
   *)
  method or_pattern p1 p2 =
    let (p1_raw, p2_raw) = (self#pattern p1, self#pattern p2) in
    let (left, right) =
      match p2.ppat_desc with
        | Ppat_or _ -> (p1_raw, formatPrecedence p2_raw)
        | _ -> (p1_raw, p2_raw)
    in
    makeList
      ~break:IfNeed
      ~inline:(true, true)
      ~sep:(Sep "|")
      ~postSpace:true
      ~preSpace:true
      [left; right]

  method pattern_without_or x =
    (* TODOATTRIBUTES: Handle the stdAttrs here *)
    let {arityAttrs} = partitionAttributes x.ppat_attributes in
    match x.ppat_desc with
      | Ppat_alias (p, s) ->
          let raw_pattern = (self#pattern p) in
          let pattern_with_precedence = match p.ppat_desc with
            | Ppat_or (p1, p2) -> formatPrecedence (self#or_pattern p1 p2)
            | _ -> raw_pattern
          in
          label ~space:true
            (source_map ~loc:p.ppat_loc pattern_with_precedence)
            (makeList ~postSpace:true [
              atom "as";
              (source_map ~loc:s.loc (protectIdentifier s.txt))
            ]) (* RA*)
      | Ppat_variant (l, Some p) ->
          if arityAttrs != [] then
            raise (NotPossible "Should never see embedded attributes on poly variant")
          else
            source_map ~loc:x.ppat_loc
              (self#constructor_pattern (atom ("`" ^ l)) p
                 ~polyVariant:true ~arityIsClear:true)
      | Ppat_lazy p -> label ~space:true (atom "lazy") (self#simple_pattern p)
      | Ppat_construct (({txt} as li), po) when not (txt = Lident "::")-> (* FIXME The third field always false *)
          let formattedConstruction = match po with
            (* TODO: Check the explicit_arity field on the pattern/constructor
               attributes to determine if should desugar to an *actual* tuple. *)
            (* | Some ({ *)
            (*   ppat_desc=Ppat_tuple l; *)
            (*   ppat_attributes=[{txt="explicit_arity"; loc}] *)
            (* }) -> *)
            (*   label ~space:true (self#longident_loc li) (makeSpacedBreakableInlineList (List.map self#simple_pattern l)) *)
            | Some pattern ->
                let arityIsClear = isArityClear arityAttrs in
                self#constructor_pattern ~arityIsClear (self#longident_loc li) pattern
            | None ->
                self#longident_loc li
          in
          source_map ~loc:x.ppat_loc formattedConstruction
      | _ -> self#simple_pattern x

  method pattern x =
    let {arityAttrs; stdAttrs} = partitionAttributes x.ppat_attributes in
    if stdAttrs != [] then
      formatAttributed
        (* Doesn't need to be simple_pattern because attributes are parse as
         * appyling to the entire "function application style" syntax preceeding them *)
        (self#pattern {x with ppat_attributes=arityAttrs})
        (self#attributes stdAttrs)
    else match x.ppat_desc with
      | Ppat_or (p1, p2) ->
        self#or_pattern p1 p2
      | _ -> self#pattern_without_or x

  method patternList ?(wrap=("","")) pat =
    let pat_list, pat_last = self#pattern_list_split_cons [] pat in
    let pat_list = List.map self#pattern pat_list in
    match pat_last with
    | {ppat_desc = Ppat_construct ({txt=Lident "[]"},_)} -> (* [x,y,z] *)
      let (lwrap, rwrap) = wrap in
      makeList pat_list
        ~break:Layout.IfNeed ~sep:commaTrail ~postSpace:true
        ~wrap:(lwrap ^ "[", "]" ^ rwrap)
    | _ -> (* x::y *)
      makeES6List pat_list (self#pattern pat_last) ~wrap

  (* In some contexts the Ptyp_package needs to be protected by parens, or
   * the `module` keyword needs to be added.
   * Example: let f = (module Add: S.Z, x) => Add.add(x);
   *  It's clear that `S.Z` is a module because it constraints the
   *  `module Add` pattern. No need to add "module" before `S.Z`.
   *
   * Example2:
   *   type t = (module Console);
   *   In this case the "module" keyword needs to be printed to indicate
   *   usage of a first-class-module.
   *)
  method typ_package ?(protect=false) ?(mod_prefix=true) lid cstrs =
    let packageIdent =
      let packageIdent = self#longident_loc lid in
      if mod_prefix then
        makeList ~postSpace:true [atom "module"; packageIdent]
      else packageIdent
    in
    let unwrapped_layout = match cstrs with
    | [] -> packageIdent
    | cstrs ->
        label ~space:true
          (makeList ~postSpace:true [packageIdent; atom "with"])
          (makeList
            ~inline:(true, true)
            ~break:IfNeed
            ~sep:(Sep " and ")
            (List.map (fun (s, ct) ->
              label ~space:true
                (makeList
                  ~break:IfNeed ~postSpace:true
                  [atom "type"; self#longident_loc s; atom "="])
                (self#core_type ct)
            ) cstrs))
    in
    if protect then
      makeList ~postSpace:true ~wrap:("(", ")") [unwrapped_layout ]
    else unwrapped_layout

  method constrained_pattern x = match x.ppat_desc with
    | Ppat_constraint (p, ct) ->
        let (pat, typ) = begin match (p, ct) with
        | (
            {ppat_desc = Ppat_unpack(unpack)},
            {ptyp_desc = Ptyp_package (lid, cstrs)}
          ) ->
            (makeList ~postSpace:true [atom "module"; atom unpack.txt],
             self#typ_package ~mod_prefix:false lid cstrs)
        | _ ->
          (self#pattern p, self#core_type ct)
        end in
        formatTypeConstraint pat typ
    | _  -> self#pattern x

  method simple_pattern x =
    let {arityAttrs; stdAttrs} = partitionAttributes x.ppat_attributes in
    if stdAttrs != [] then
      formatSimpleAttributed
        (self#simple_pattern {x with ppat_attributes=arityAttrs})
        (self#attributes stdAttrs)
    else
      let itm =
        match x.ppat_desc with
          | Ppat_construct (({loc; txt=Lident ("()"|"[]" as x)}), _) ->
              (* Patterns' locations might include a leading bar depending on the
               * context it was parsed in. Therefore, we need to include further
               * information about the contents of the pattern such as tokens etc,
               * in order to get comments to be distributed correctly.*)
            atom ~loc x
          | Ppat_construct (({txt=Lident "::"}), _) ->
            self#patternList x (* LIST PATTERN *)
          | Ppat_construct (li, None) ->
            source_map ~loc:x.ppat_loc (self#longident_loc li)
          | Ppat_any -> atom "_"
          | Ppat_var ({loc; txt = txt}) ->
            (*
               To prevent this:

                 let oneArgShouldWrapToAlignWith
                   theFunctionNameBinding => theFunctionNameBinding;

               And instead do:

                 let oneArgShouldWrapToAlignWith
                     theFunctionNameBinding => theFunctionNameBinding;

               We have to do something to the non "listy" patterns. Non listy
               patterns don't indent the same amount as listy patterns when docked
               to a label.

               If wrapping the non-listy pattern in [ensureSingleTokenSticksToLabel]
               you'll get the following (even though it should wrap)

                 let oneArgShouldWrapToAlignWith theFunctionNameBinding => theFunctionNameBinding;

             *)
            source_map ~loc (protectIdentifier txt)
          | Ppat_array l ->
              self#patternArray l
          | Ppat_unpack s ->
              makeList ~wrap:("(", ")") ~break:IfNeed ~postSpace:true [atom "module"; atom s.txt]
          | Ppat_open (lid, pat) ->
            (* let someFn Qualified.{ record } = ... *)
            let needsParens = match pat.ppat_desc with
              | Ppat_exception _ -> true
              | _ -> false
            in
            let pat = self#simple_pattern pat in
            label
              (label (self#longident_loc lid) (atom (".")))
              (if needsParens then formatPrecedence pat else pat)
          | Ppat_type li ->
              makeList [atom "#"; self#longident_loc li]
          | Ppat_record (l, closed) ->
             self#patternRecord l closed
          | Ppat_tuple l ->
             self#patternTuple l
          | Ppat_constant c ->
            let raw_literal, _ = extract_raw_literal x.ppat_attributes in
            (self#constant ?raw_literal c)
          | Ppat_interval (c1, c2) ->
            makeList [self#constant c1; atom ".."; self#constant c2]
          | Ppat_variant (l, None) -> makeList[atom "`"; atom l]
          | Ppat_constraint (p, ct) ->
              formatPrecedence (formatTypeConstraint (self#pattern p) (self#core_type ct))
          | Ppat_lazy p ->formatPrecedence (label ~space:true (atom "lazy") (self#simple_pattern p))
          | Ppat_extension e -> self#extension e
          | Ppat_exception p ->
              (*
                An exception pattern with an alias should be wrapped in (...)
                The rules for what goes to the right of the exception are a little (too) nuanced.
                It accepts "non simple" parameters, except in the case of `as`.
                Here we consistently apply "simplification" to the exception argument.
                Example:
                  | exception (Sys_error _ as exc) => raise exc
                 parses correctly while
                  | Sys_error _ as exc => raise exc
                 results in incorrect parsing with type error otherwise.
              *)
               (makeList ~postSpace:true [atom "exception"; self#simple_pattern p])
          | _ -> formatPrecedence (self#pattern x) (* May have a redundant sourcemap *)
        in
        source_map ~loc:x.ppat_loc itm

  method label_exp lbl opt pat =
    let term = self#constrained_pattern pat in
    let param = match lbl with
      | Nolabel -> term
      | Labelled lbl | Optional lbl when is_punned_labelled_pattern pat lbl ->
        makeList [atom namedArgSym; term]
      | Labelled lbl | Optional lbl ->
        let lblLayout=
          makeList ~sep:(Sep " ") ~break:Layout.Never
            [atom (namedArgSym ^ lbl); atom "as"]
        in
        label lblLayout ~space:true term
    in
    match opt, lbl with
    | None, Optional _ -> makeList [param; atom "=?"]
    | None, _ -> param
    | Some o, _ -> makeList [param; atom "="; (self#unparseProtectedExpr ~forceParens:true o)]

  method access op cls e1 e2 = makeList [
    (* Important that this be not breaking - at least to preserve same
       behavior as stock desugarer. It might even be required (double check
       in parser.mly) *)
    e1;
    atom op;
    e2;
    atom cls;
  ]


  method simple_get_application x =
    let {stdAttrs; jsxAttrs} = partitionAttributes x.pexp_attributes in
    match (x.pexp_desc, stdAttrs, jsxAttrs) with
    | (_, _::_, []) -> None (* Has some printed attributes - not simple *)
    | (Pexp_apply ({pexp_desc=Pexp_ident loc}, l), [], _jsx::_) -> (
      (* TODO: Soon, we will allow the final argument to be an identifier which
         represents the entire list. This would be written as
         `<tag>...list</tag>`. If you imagine there being an implicit [] inside
         the tag, then it would be consistent with array spread:
         [...list] evaluates to the thing as list.
      *)
      let hasLabelledChildrenLiteral = List.exists (function
        | (Labelled "children", _) -> true
        | _ -> false
      ) l in
      let rec hasSingleNonLabelledUnitAndIsAtTheEnd l = match l with
      | [] -> false
      | (Nolabel, {pexp_desc = Pexp_construct ({txt = Lident "()"}, _)}) :: [] -> true
      | (Nolabel, _) :: _ -> false
      | _ :: rest -> hasSingleNonLabelledUnitAndIsAtTheEnd rest
      in
      if hasLabelledChildrenLiteral && hasSingleNonLabelledUnitAndIsAtTheEnd l then
        let moduleNameList = List.rev (List.tl (List.rev (Longident.flatten loc.txt))) in
        if moduleNameList != [] then
          if Longident.last loc.txt = "createElement" then
            Some (self#formatJSXComponent (String.concat "." moduleNameList) l)
          else None
        else Some (self#formatJSXComponent (Longident.last loc.txt) l)
      else None
    )
    | (Pexp_apply (
        {pexp_desc=
          Pexp_letmodule(_,
            ({pmod_desc=Pmod_apply _} as app),
            {pexp_desc=Pexp_ident loc}
          )}, l), [], _jsx::_) -> (
      (* TODO: Soon, we will allow the final argument to be an identifier which
         represents the entire list. This would be written as
         `<tag>...list</tag>`. If you imagine there being an implicit [] inside
         the tag, then it would be consistent with array spread:
         [...list] evaluates to the thing as list.
      *)
      let rec extract_apps args = function
        | { pmod_desc = Pmod_apply (m1, {pmod_desc=Pmod_ident loc}) } ->
          let arg = String.concat "." (Longident.flatten loc.txt) in
          extract_apps (arg :: args) m1
        | { pmod_desc=Pmod_ident loc } -> (String.concat "." (Longident.flatten loc.txt))::args
        | _ -> failwith "Functors in JSX tags support only module names as parameters" in
      let hasLabelledChildrenLiteral = List.exists (function
        | (Labelled "children", _) -> true
        | _ -> false
      ) l in
      let rec hasSingleNonLabelledUnitAndIsAtTheEnd l = match l with
      | [] -> false
      | (Nolabel, {pexp_desc = Pexp_construct ({txt = Lident "()"}, _)}) :: [] -> true
      | (Nolabel, _) :: _ -> false
      | _ :: rest -> hasSingleNonLabelledUnitAndIsAtTheEnd rest
      in
      if hasLabelledChildrenLiteral && hasSingleNonLabelledUnitAndIsAtTheEnd l then
        if List.length (Longident.flatten loc.txt) > 1 then
          if Longident.last loc.txt = "createElement" then
            begin match extract_apps [] app with
              | ftor::args ->
                let applied = ftor ^ "(" ^ String.concat ", " args ^ ")" in
                Some (self#formatJSXComponent ~closeComponentName:ftor applied l)
              | _ -> None
            end
          else None
        else Some (self#formatJSXComponent (Longident.last loc.txt) l)
      else None
    )
    | _ -> None

  (** Detects "sugar expressions" (sugar for array/string setters) and returns their separate
      parts.  *)
  method sugar_set_expr_parts e =
    if e.pexp_attributes != [] then None
    (* should also check attributes underneath *)
    else match e.pexp_desc with
      | Pexp_apply ({pexp_desc=Pexp_ident{txt=Ldot (Lident ("Array"), "set")}}, [(_,e1);(_,e2);(_,e3)]) ->
        let prec = Custom "prec_lbracket" in
        let lhs = self#unparseResolvedRule (
            self#ensureExpression ~reducesOnToken:prec e1
          ) in
        Some (self#access "[" "]" lhs (self#unparseExpr e2), e3)
      | Pexp_apply ({pexp_desc=Pexp_ident {txt=Ldot (Lident "String", "set")}}, [(_,e1);(_,e2);(_,e3)]) ->
        let prec = Custom "prec_lbracket" in
        let lhs = self#unparseResolvedRule (
            self#ensureExpression ~reducesOnToken:prec e1
          ) in
        Some ((self#access ".[" "]" lhs (self#unparseExpr e2)), e3)
      | Pexp_apply (
        {pexp_desc=Pexp_ident {txt = Ldot (Ldot (Lident "Bigarray", array), "set")}},
        label_exprs
      ) -> (
        match array with
          | "Genarray" -> (
            match label_exprs with
            | [(_,a);(_,{pexp_desc=Pexp_array ls});(_,c)] ->
              let formattedList = List.map self#unparseExpr ls in
              let lhs = makeList [self#simple_enough_to_be_lhs_dot_send a; atom "."] in
              let rhs = makeList ~break:IfNeed ~postSpace:true ~sep:commaSep ~wrap:("{", "}") formattedList
              in
              Some (label lhs rhs, c)
            | _ -> None
          )
          | ("Array1"|"Array2"|"Array3") -> (
            match label_exprs with
            | (_,a)::rest -> (
              match List.rev rest with
              | (_,v)::rest ->
                let args = List.map snd (List.rev rest) in
                let formattedList = List.map self#unparseExpr args in
                let lhs = makeList [self#simple_enough_to_be_lhs_dot_send a; atom "."] in
                let rhs = makeList ~break:IfNeed ~postSpace:true ~sep:commaSep ~wrap:("{", "}") formattedList in
                Some (label lhs rhs, v)
              | _ -> assert false
            )
            | _ -> assert false
          )
          | _ -> None
        )
      | _ -> None

  (*

     How would we know not to print the sequence without { }; protecting the let a?

                            let a
                             |
                           sequence
                          /        \
                    let a           print a
                    alert a
     let res = {
       let a = something();
       {                     \
         alert(a);           | portion to be parsed as a sequence()
         let a = 20;         | The final ; print(a) causes the entire
         alert(a);           | portion to be parsed as a sequence()
       };                    |
       print (a);            /
     }

     ******************************************************************
     Any time the First expression of a sequence is another sequence, or (as in
     this case) a let, wrapping the first sequence expression in { } is
     required.
     ******************************************************************
  *)

  (**
     TODO: Configure the optional ability to print the *minimum* number of
     parens. It's simply a matter of changing [higherPrecedenceThan] to
     [higherOrEqualPrecedenceThan].
   *)

  (* The point of the function is to ensure that ~reducesAfterRight:rightExpr will reduce
     at the proper time when it is reparsed, possibly wrapping it
     in parenthesis if needed. It ensures a rule doesn't reduce
     until *after* `reducesAfterRight` gets a chance to reduce.
     Example: The addition rule which has precedence of rightmost
     token "+", in `x + a * b` should not reduce until after the a * b gets
     a chance to reduce. This function would determine the minimum parens to
     ensure that. *)
  method ensureContainingRule ~withPrecedence ~reducesAfterRight () =
    match self#unparseExprRecurse reducesAfterRight with
    | SpecificInfixPrecedence ({shiftPrecedence}, rightRecurse) ->
      if higherPrecedenceThan shiftPrecedence withPrecedence then rightRecurse
      else if (higherPrecedenceThan withPrecedence shiftPrecedence) then
        LayoutNode (formatPrecedence ~loc:reducesAfterRight.pexp_loc (self#unparseResolvedRule rightRecurse))
      else (
        if isRightAssociative ~prec:withPrecedence then
         rightRecurse
        else
          LayoutNode (formatPrecedence ~loc:reducesAfterRight.pexp_loc (self#unparseResolvedRule rightRecurse))
      )
    | FunctionApplication itms ->
      let funApplExpr = formatAttachmentApplication applicationFinalWrapping None (itms, Some reducesAfterRight.pexp_loc)
      in
      (* Little hack: need to print parens for the `bar` application in e.g.
         `foo->other##(bar(baz))` or `foo->other->(bar(baz))`. *)
      if higherPrecedenceThan withPrecedence (Custom "prec_functionAppl")
      then LayoutNode (formatPrecedence ~loc:reducesAfterRight.pexp_loc funApplExpr)
      else LayoutNode funApplExpr
    | PotentiallyLowPrecedence itm -> LayoutNode (formatPrecedence ~loc:reducesAfterRight.pexp_loc itm)
    | Simple itm -> LayoutNode itm

  method ensureExpression ~reducesOnToken expr =
    match self#unparseExprRecurse expr with
    | SpecificInfixPrecedence ({reducePrecedence}, leftRecurse) ->
      if higherPrecedenceThan reducePrecedence reducesOnToken then leftRecurse
      else if higherPrecedenceThan reducesOnToken reducePrecedence then
        LayoutNode (formatPrecedence ~loc:expr.pexp_loc (self#unparseResolvedRule leftRecurse))
      else (
        if isLeftAssociative ~prec:reducesOnToken then
          leftRecurse
        else
          LayoutNode (formatPrecedence ~loc:expr.pexp_loc (self#unparseResolvedRule leftRecurse))
      )
    | FunctionApplication itms -> LayoutNode (formatAttachmentApplication applicationFinalWrapping None (itms, Some expr.pexp_loc))
    | PotentiallyLowPrecedence itm -> LayoutNode (formatPrecedence ~loc:expr.pexp_loc itm)
    | Simple itm -> LayoutNode itm

  (** Attempts to unparse: The beginning of a more general printing algorithm,
      that determines how to print based on precedence of tokens and rules.
      The end goal is that this should be completely auto-generated from the
      Menhir parsing tables. We could move more and more into this function.

      You could always just call self#expression, but `unparseExpr` will render
      infix/prefix/unary/terary fixities in their beautiful forms while
      minimizing parenthesis.
  *)
  method unparseExpr x =
    match self#unparseExprRecurse x with
    | SpecificInfixPrecedence (_, resolvedRule) ->
        self#unparseResolvedRule resolvedRule
    | FunctionApplication itms ->
        formatAttachmentApplication applicationFinalWrapping None (itms, Some x.pexp_loc)
    | PotentiallyLowPrecedence itm -> itm
    | Simple itm -> itm

  (* This method may not even be needed *)
  method unparseUnattributedExpr x =
    match partitionAttributes x.pexp_attributes with
    | {docAttrs = []; stdAttrs = []} -> self#unparseExpr x
    | _ -> makeList ~wrap:("(",")") [self#unparseExpr x]

  (* ensureExpr ensures that the expression is wrapped in parens
   * e.g. is necessary in cases like:
   * let display = (:message=("hello": string)) => 1;
   * but not in cases like:
   * let f = (a: bool) => 1;
   * TODO: in the future we should probably use the type ruleCategory
   * to 'automatically' ensure the validity of a constraint expr with parens...
   *)
  method unparseProtectedExpr ?(forceParens=false) e =
    let itm =
      match e with
      | { pexp_attributes = []; pexp_desc = Pexp_constraint (x, ct)} ->
        let x = self#unparseExpr x in
        let children = [x; label ~space:true (atom ":") (self#core_type ct)] in
        if forceParens then
          makeList ~wrap:("(", ")") children
        else makeList children
      | { pexp_attributes; pexp_desc = Pexp_constant c } ->
        (* When we have Some(-1) or someFunction(-1, -2), the arguments -1 and -2
         * pass through this case. In this context they don't need to be wrapped in extra parens
         * Some((-1)) should be printed as Some(-1). This is in contrast with
         * 1 + (-1) where we print the parens for readability. *)
          let raw_literal, pexp_attributes =
            extract_raw_literal pexp_attributes
          in
          let constant = self#constant ?raw_literal ~parens:forceParens c in
          begin match pexp_attributes with
          | [] -> constant
          | attrs ->
              let formattedAttrs = makeSpacedBreakableInlineList (List.map self#item_attribute attrs) in
               makeSpacedBreakableInlineList [formattedAttrs; constant]
          end
      | {pexp_desc = Pexp_fun _ } -> self#formatPexpFun e
      | x -> self#unparseExpr x
    in
    source_map ~loc:e.pexp_loc itm

  method simplifyUnparseExpr ?(inline=false) ?(wrap=("(", ")")) x =
    match self#unparseExprRecurse x with
    | SpecificInfixPrecedence (_, itm) ->
        formatPrecedence
          ~inline
          ~wrap
          ~loc:x.pexp_loc
          (self#unparseResolvedRule itm)
    | FunctionApplication itms ->
      formatPrecedence
        ~inline
        ~wrap
        ~loc:x.pexp_loc
        (formatAttachmentApplication applicationFinalWrapping None (itms, Some x.pexp_loc))
    | PotentiallyLowPrecedence itm ->
        formatPrecedence
          ~inline
          ~wrap
          ~loc:x.pexp_loc
          itm
    | Simple itm -> itm


  method unparseResolvedRule  = function
    | LayoutNode layoutNode -> layoutNode
    | InfixTree _ as infixTree ->
      formatComputedInfixChain (computeInfixChain infixTree)

  method unparseExprApplicationItems x =
    match self#unparseExprRecurse x with
    | SpecificInfixPrecedence (_, wrappedRule) ->
        let itm = self#unparseResolvedRule wrappedRule in
        ([itm], Some x.pexp_loc)
    | FunctionApplication itms -> (itms, Some x.pexp_loc)
    | PotentiallyLowPrecedence itm -> ([itm], Some x.pexp_loc)
    | Simple itm -> ([itm], Some x.pexp_loc)


  (* Provides beautiful printing for pipe first sugar:
   * foo
   * ->f(a, b)
   * ->g(c, d)
   *)
  method formatPipeFirst e =
    let module PipeFirstTree = struct
      type exp = Parsetree.expression

      type flatNode =
        | Exp of exp
        | ExpU of exp (* uncurried *)
        | Args of (Asttypes.arg_label * exp) list
      type flatT = flatNode list

      type node = {
        exp: exp;
        args: (Asttypes.arg_label *exp) list;
        uncurried: bool;
      }
      type t = node list

      let formatNode ?prefix ?(first=false) {exp; args; uncurried} =
        let formatLayout expr =
          let formatted = if first then
            self#ensureExpression ~reducesOnToken:(Token pipeFirstToken) expr
          else
            match expr with
            (* a->foo(x, _) and a->(foo(x, _)) are equivalent under pipe first
             * (a->foo)(x, _) is unnatural and desugars to
             *    (__x) => (a |. foo)(x, __x)
             * Under `->`, it makes more sense to desugar into
             *  a |. (__x => foo(x, __x))
             *
             * Hence we don't need parens in this case.
             *)
            | expr when Reason_heuristics.isUnderscoreApplication expr ->
                LayoutNode (self#unparseExpr expr)
            | _ ->
              self#ensureContainingRule
                ~withPrecedence:(Token pipeFirstToken) ~reducesAfterRight:expr ()
          in
          self#unparseResolvedRule formatted
        in
        let parens = match (exp.pexp_desc) with
        | Pexp_apply (e,_) -> printedStringAndFixityExpr e = UnaryPostfix "^"
        | _ -> false
        in
        let layout = match args with
        | [] ->
          let e = formatLayout exp in
          (match prefix with
          | Some l -> makeList [l; e]
          | None -> e)
        | args ->
            let args = List.map
              (fun (label, arg) ->
                label, self#process_underscore_application arg)
              args
            in
            let fakeApplExp =
              let loc_end = match List.rev args with
                | (_, e)::_ -> e.pexp_loc.loc_end
                | _ -> exp.pexp_loc.loc_end
              in
              {exp with pexp_loc = { exp.pexp_loc with loc_end = loc_end } }
            in
            makeList (
              self#formatFunAppl
                ?prefix
                ~jsxAttrs:[]
                ~args
                ~funExpr:exp
                ~applicationExpr:fakeApplExp
                ~uncurried
                ()
            )
        in
        if parens then
          formatPrecedence layout
        else layout
    end in
    (* Imagine: foo->f(a, b)->g(c,d)
     * The corresponding parsetree looks more like:
     *   (((foo->f)(a,b))->g)(c, d)
     * The extra Pexp_apply nodes, e.g. (foo->f), result into a
     * nested/recursive ast which is pretty inconvenient in terms of printing.
     * For printing purposes we actually want something more like:
     *  foo->|f(a,b)|->|g(c, d)|
     * in order to provide to following printing:
     *  foo
     *  ->f(a, b)
     *  ->g(c, d)
     * The job of "flatten" is to turn the inconvenient, nested ast
     *  (((foo->f)(a,b))->g)(c, d)
     * into
     *  [Exp foo; Exp f; Args [a; b]; Exp g; Args [c; d]]
     * which can be processed for printing purposes.
     *)
    let rec flatten ?(uncurried=false) acc = function
      | {pexp_desc = Pexp_apply(
          {pexp_desc = Pexp_ident({txt = Longident.Lident("|.")})},
          [Nolabel, arg1; Nolabel, arg2]
         )} ->
          flatten ((PipeFirstTree.Exp arg2)::acc) arg1
      | {pexp_attributes;
         pexp_desc = Pexp_apply(
          {pexp_desc = Pexp_apply(
           {pexp_desc = Pexp_ident({txt = Longident.Lident("|.")})},
             [Nolabel, arg1; Nolabel, arg2]
           )},
           args
         )} as e ->
          let args = PipeFirstTree.Args args in
          begin match pexp_attributes with
          | [{txt = "bs"}, PStr []] ->
            flatten ((PipeFirstTree.ExpU arg2)::args::acc) arg1
          | [] ->
              (* the uncurried attribute might sit on the Pstr_eval
               * enclosing the Pexp_apply*)
              if uncurried then
                flatten ((PipeFirstTree.ExpU arg2)::args::acc) arg1
              else
                flatten ((PipeFirstTree.Exp arg2)::args::acc) arg1
          | _ ->
            (PipeFirstTree.Exp e)::acc
          end
      | {pexp_desc = Pexp_ident({txt = Longident.Lident("|.")})} -> acc
      | arg -> ((PipeFirstTree.Exp arg)::acc)
    in
    (* Given: foo->f(a, b)->g(c, d)
     * We get the following PipeFirstTree.flatNode list:
     *   [Exp foo; Exp f; Args [a; b]; Exp g; Args [c; d]]
     * The job of `parse` is to turn the "flat representation"
     * (a.k.a. PipeFirstTree.flastNode list) into a more convenient structure
     * that allows us to express the segments: "foo" "f(a, b)" "g(c, d)".
     * PipeFirstTree.t expresses those segments.
     *  [{exp = foo; args = []}; {exp = f; args = [a; b]}; {exp = g; args = [c; d]}]
     *)
    let rec parse acc = function
    | (PipeFirstTree.Exp e)::(PipeFirstTree.Args args)::xs ->
        parse ((PipeFirstTree.{exp = e; args; uncurried = false})::acc) xs
    | (PipeFirstTree.ExpU e)::(PipeFirstTree.Args args)::xs ->
        parse ((PipeFirstTree.{exp = e; args; uncurried = true})::acc) xs
    | (PipeFirstTree.Exp e)::xs ->
        parse ((PipeFirstTree.{exp = e; args = []; uncurried = false})::acc) xs
    | _ -> List.rev acc
    in
    (* Given: foo->f(. a,b);
     * The uncurried attribute doesn't sit on the Pexp_apply, but sits on
     * the top level Pstr_eval. We don't have access to top-level context here,
     * hence the lookup in the global uncurriedTable to correctly determine
     * if we need to print uncurried. *)
    let uncurried = try Hashtbl.find uncurriedTable e.pexp_loc with
      | Not_found -> false
    in
    (* Turn
     *  foo->f(a, b)->g(c, d)
     * into
     *  [Exp foo; Exp f; Args [a; b]; Exp g; Args [c; d]]
     *)
    let (flatNodes : PipeFirstTree.flatT) = flatten ~uncurried [] e in
    (* Turn
     *  [Exp foo; Exp f; Args [a; b]; Exp g; Args [c; d]]
     * into
     *  [{exp = foo; args = []}; {exp = f; args = [a; b]}; {exp = g; args = [c; d]}]
     *)
    let (pipetree : PipeFirstTree.t) = parse [] flatNodes in
    (* Turn
     *  [{exp = foo; args = []}; {exp = f; args = [a; b]}; {exp = g; args = [c; d]}]
     * into
     *  [foo; ->f(a, b); ->g(c, d)]
     *)
    let pipeSegments = match pipetree with
    (* Special case printing of
     * foo->bar(
     *  aa,
     *  bb,
     * )
     *
     *  We don't want
     *  foo
     *  ->bar(
     *      aa,
     *      bb
     *    )
     *
     *  Notice how `foo->bar` shouldn't break, it wastes space and is
     *  inconsistent with
     *  foo.bar(
     *    aa,
     *    bb,
     *  )
     *)
    | [({exp = {pexp_desc = Pexp_ident _ }} as hd); last] ->
        let prefix = Some (
          makeList [PipeFirstTree.formatNode ~first:true hd; atom "->"]
        ) in
        [PipeFirstTree.formatNode ?prefix last]
    | hd::tl ->
        let hd = PipeFirstTree.formatNode ~first:true hd in
        let tl = List.map (fun node ->
          makeList [atom "->"; PipeFirstTree.formatNode node]
        ) tl in
        hd::tl
    | [] -> []
    in
    (* Provide nice breaking for: [foo; ->f(a, b); ->g(c, d)]
     * foo
     * ->f(a, b)
     * ->g(c, d)
     *)
    makeList ~break:IfNeed ~inline:(true, true) pipeSegments

  (*
   * Replace (__x) => foo(__x) with foo(_)
   *)
  method process_underscore_application x =
    let process_application expr =
      let process_arg (l,e) = match e.pexp_desc with
        | Pexp_ident ({ txt = Lident "__x"} as id) ->
          let pexp_desc = Pexp_ident {id with txt = Lident "_"} in
          (l, {e with pexp_desc})
        | _ ->
          (l,e) in
      match expr.pexp_desc with
      | Pexp_apply (e_fun, args) ->
        let pexp_desc = Pexp_apply (e_fun, List.map process_arg args) in
        {expr with pexp_desc}
      | _ ->
        expr in
    match x.pexp_desc with
    | Pexp_fun (Nolabel, None, {ppat_desc = Ppat_var {txt="__x"}},
        ({pexp_desc = Pexp_apply _} as e)) ->
      process_application e
    | Pexp_fun (l, eo, p, e) ->
       let e_processed = self#process_underscore_application e in
       if e == e_processed then
         x
       else
         {x with pexp_desc = Pexp_fun (l, eo, p, e_processed)}
    | _ ->
      x

  method unparseExprRecurse x =
    let x = self#process_underscore_application x in
    (* If there are any attributes, render unary like `(~-) x [@ppx]`, and infix like `(+) x y [@attr]` *)

    let {arityAttrs; stdAttrs; jsxAttrs; stylisticAttrs; uncurried} =
      partitionAttributes ~allowUncurry:(Reason_heuristics.bsExprCanBeUncurried x) x.pexp_attributes
    in
    let stylisticAttrs = Reason_attributes.maybe_remove_stylistic_attrs stylisticAttrs preserve_braces in
    let () = if uncurried then Hashtbl.add uncurriedTable x.pexp_loc true in
    let x = {x with pexp_attributes = (stylisticAttrs @ arityAttrs @ stdAttrs @ jsxAttrs) } in
    (* If there's any attributes, recurse without them, then apply them to
       the ends of functions, or simplify infix printings then append. *)
    if stdAttrs != [] then
      let withoutVisibleAttrs = {x with pexp_attributes=(stylisticAttrs @ arityAttrs @ jsxAttrs)} in
      let attributesAsList = (List.map self#attribute stdAttrs) in
      let itms = match self#unparseExprRecurse withoutVisibleAttrs with
        | SpecificInfixPrecedence ({reducePrecedence}, wrappedRule) ->
            let itm = self#unparseResolvedRule wrappedRule in
            (match reducePrecedence with
             (* doesn't need wrapping; we know how to parse *)
             | Custom "prec_lbracket" | Token "." -> [itm]
             | _ -> [formatPrecedence ~loc:x.pexp_loc itm])
        | FunctionApplication itms -> itms
        | PotentiallyLowPrecedence itm -> [formatPrecedence ~loc:x.pexp_loc itm]
        | Simple itm -> [itm]
      in
      FunctionApplication [
        makeList
          ~break:IfNeed
          ~inline:(true, true)
          ~indent:0
          ~postSpace:true
          (List.concat [attributesAsList; itms])
      ]
    else
    match self#simplest_expression x with
    | Some se -> Simple se
    | None ->
    let self = self#reset_request_braces in
    match x.pexp_desc with
    | Pexp_apply (e, ls) -> (
      let ls = List.map (fun (l,expr) -> (l, self#process_underscore_application expr)) ls in
      match (e, ls) with
      | (e, _) when Reason_heuristics.isPipeFirst e ->
        let prec = Token pipeFirstToken in
          SpecificInfixPrecedence
            ({reducePrecedence=prec; shiftPrecedence=prec}, LayoutNode (self#formatPipeFirst x))
      | ({pexp_desc = Pexp_ident {txt = Ldot (Lident ("Array"),"get")}}, [(_,e1);(_,e2)]) ->
        begin match e1.pexp_desc with
          | Pexp_ident ({txt = Lident "_"}) ->
            let k = atom "Array.get" in
            let v = makeList ~postSpace:true ~sep:(Layout.Sep ",") ~wrap:("(", ")")
                [atom "_"; self#unparseExpr e2]
            in
            Simple (label k v)
          | _ ->
            let prec = Custom "prec_lbracket" in
            let lhs = self#unparseResolvedRule (
              self#ensureExpression ~reducesOnToken:prec e1
            ) in
            let rhs = self#unparseExpr e2 in
            SpecificInfixPrecedence
              ({reducePrecedence=prec; shiftPrecedence=prec}, LayoutNode (self#access "[" "]" lhs rhs))
        end
      | ({pexp_desc = Pexp_ident {txt = Ldot (Lident ("String"),"get")}}, [(_,e1);(_,e2)]) ->
        if Reason_heuristics.isUnderscoreIdent e1 then
          let k = atom "String.get" in
          let v = makeList ~postSpace:true ~sep:(Layout.Sep ",") ~wrap:("(", ")")
              [atom "_"; self#unparseExpr e2]
          in
          Simple (label k v)
        else
          let prec = Custom "prec_lbracket" in
            let lhs = self#unparseResolvedRule (
              self#ensureExpression ~reducesOnToken:prec e1
            ) in
            let rhs = self#unparseExpr e2 in
          SpecificInfixPrecedence
            ({reducePrecedence=prec; shiftPrecedence=prec}, LayoutNode (self#access ".[" "]" lhs rhs))
      | (
        {pexp_desc= Pexp_ident {txt=Ldot (Ldot (Lident "Bigarray", "Genarray" ), "get")}},
        [(_,e1); (_,({pexp_desc=Pexp_array ls} as e2))]
      ) ->
        if (Reason_heuristics.isUnderscoreIdent e1) then
          let k = atom "Bigarray.Genarray.get" in
          let v = makeList ~postSpace:true ~sep:(Layout.Sep ",") ~wrap:("(", ")")
              [atom "_"; self#unparseExpr e2]
          in
          Simple (label k v)
        else
          let formattedList = List.map self#unparseExpr ls in
          let lhs = makeList [(self#simple_enough_to_be_lhs_dot_send e1); atom "."] in
          let rhs = makeList ~break:IfNeed ~postSpace:true ~sep:commaSep ~wrap:("{", "}") formattedList in
          let prec = Custom "prec_lbracket" in
          SpecificInfixPrecedence ({reducePrecedence=prec; shiftPrecedence=prec}, LayoutNode (label lhs rhs))
      | (
        {pexp_desc= Pexp_ident {txt=
                                  Ldot (Ldot (Lident "Bigarray", (("Array1"|"Array2"|"Array3") as arrayIdent)), "get")}
        },
        (_,e1)::rest
      ) ->
        if Reason_heuristics.isUnderscoreIdent e1 then
          let k = atom("Bigarray." ^ arrayIdent ^ ".get") in
          let v = makeList ~postSpace:true ~sep:(Layout.Sep ",") ~wrap:("(", ")")
              ((atom "_")::(List.map (fun (_, e) -> self#unparseExpr e) rest))
          in
          Simple (label k v)
        else
          let formattedList = List.map self#unparseExpr (List.map snd rest) in
          let lhs = makeList [(self#simple_enough_to_be_lhs_dot_send e1); atom "."] in
          let rhs = makeList ~break:IfNeed ~postSpace:true ~sep:commaSep ~wrap:("{", "}") formattedList in
          let prec = Custom "prec_lbracket" in
          SpecificInfixPrecedence ({reducePrecedence=prec; shiftPrecedence=prec}, LayoutNode (label lhs rhs))
      | _ -> (

          match (self#sugar_set_expr_parts x) with
      (* Returns None if there's attributes - would render as regular function *)
      (* Format as if it were an infix function application with identifier "=" *)
      | Some (simplyFormatedLeftItm, rightExpr) -> (
        let tokenPrec = Token updateToken in
        let rightItm = self#ensureContainingRule ~withPrecedence:tokenPrec ~reducesAfterRight:rightExpr () in
        let leftWithOp = makeList ~postSpace:true [simplyFormatedLeftItm; atom updateToken] in
        let expr = label ~space:true leftWithOp (self#unparseResolvedRule rightItm) in
        SpecificInfixPrecedence ({reducePrecedence=tokenPrec; shiftPrecedence=tokenPrec}, LayoutNode expr)
      )
      | None -> (
        match (printedStringAndFixityExpr e, ls) with
       (* We must take care not to print two subsequent prefix operators without
         spaces between them (`! !` could become `!!` which is totally
         different).  *)
        | (AlmostSimplePrefix prefixStr, [(Nolabel, rightExpr)]) ->
        let forceSpace = match rightExpr.pexp_desc with
          | Pexp_apply (ee, _) ->
            (match printedStringAndFixityExpr ee with | AlmostSimplePrefix _ -> true | _ -> false)
          | _ -> false
        in
        let prec = Token prefixStr in
        let rightItm = self#unparseResolvedRule (
          self#ensureContainingRule ~withPrecedence:prec ~reducesAfterRight:rightExpr ()
        ) in
        SpecificInfixPrecedence
          ({reducePrecedence=prec; shiftPrecedence = prec}, LayoutNode (label ~space:forceSpace (atom prefixStr) rightItm))
        | (UnaryPostfix postfixStr, [(Nolabel, leftExpr)]) ->
          let forceSpace = match leftExpr.pexp_desc with
            | Pexp_apply (ee, _) ->
              (match printedStringAndFixityExpr ee with
               | UnaryPostfix "^" | AlmostSimplePrefix _ -> true
               | _ -> false)
            | _ -> false
          in
          let leftItm = (match leftExpr.pexp_desc with
            | Pexp_apply (e,_) ->
              (match printedStringAndFixityExpr e with
               | Infix printedIdent
                 when requireNoSpaceFor printedIdent ||
                      Reason_heuristics.isPipeFirst e ->
                 self#unparseExpr leftExpr
               | _ -> self#simplifyUnparseExpr leftExpr)
            | Pexp_field _ -> self#unparseExpr leftExpr
            | _ -> self#simplifyUnparseExpr leftExpr
          )
          in
          Simple (label ~space:forceSpace leftItm (atom postfixStr))
        | (Infix printedIdent, [(Nolabel, leftExpr); (Nolabel, rightExpr)]) ->
          let infixToken = Token printedIdent in
          let rightItm = self#ensureContainingRule ~withPrecedence:infixToken ~reducesAfterRight:rightExpr () in
          let leftItm = self#ensureExpression ~reducesOnToken:infixToken leftExpr in
          (* Left exprs of infix tokens which we don't print spaces for (e.g. `##`)
             need to be wrapped in parens in the case of postfix `^`. Otherwise,
             printing will be ambiguous as `^` is also a valid start of an infix
             operator. *)
          let formattedLeftItm = (match leftItm with
            | LayoutNode x -> begin match leftExpr.pexp_desc with
                | Pexp_apply (e,_) ->
                  (match printedStringAndFixityExpr e with
                   | UnaryPostfix "^" when requireNoSpaceFor printedIdent ->
                     LayoutNode (formatPrecedence ~loc:leftExpr.pexp_loc x)
                   | _ -> leftItm)
                | _ -> leftItm
              end
            | InfixTree _ -> leftItm
          ) in
          let infixTree = InfixTree (printedIdent, formattedLeftItm, rightItm) in
          SpecificInfixPrecedence ({reducePrecedence=infixToken; shiftPrecedence=infixToken}, infixTree)
        (* Will be rendered as `(+) a b c` which is parsed with higher precedence than all
           the other forms unparsed here.*)
        | (UnaryPlusPrefix printedIdent, [(Nolabel, rightExpr)]) ->
          let prec = Custom "prec_unary" in
          let rightItm = self#unparseResolvedRule (
            self#ensureContainingRule ~withPrecedence:prec ~reducesAfterRight:rightExpr ()
          ) in
          let expr = label ~space:true (atom printedIdent) rightItm in
          SpecificInfixPrecedence ({reducePrecedence=prec; shiftPrecedence=Token printedIdent}, LayoutNode expr)
        | (UnaryMinusPrefix printedIdent as x, [(Nolabel, rightExpr)])
        | (UnaryNotPrefix printedIdent as x, [(Nolabel, rightExpr)]) ->
          let forceSpace = (match x with
              | UnaryMinusPrefix _ -> true
              | _ -> begin match rightExpr.pexp_desc with
                  | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident s}}, _) ->
                    isSimplePrefixToken s
                  | _ -> false
                end) in
          let prec = Custom "prec_unary" in
          let rightItm = self#unparseResolvedRule (
            self#ensureContainingRule ~withPrecedence:prec ~reducesAfterRight:rightExpr ()
          ) in
          let expr = label ~space:forceSpace (atom printedIdent) rightItm in
          SpecificInfixPrecedence ({reducePrecedence=prec; shiftPrecedence=Token printedIdent}, LayoutNode expr)
        (* Will need to be rendered in self#expression as (~-) x y z. *)
        | (_, _) ->
        (* This case will happen when there is something like

             Bar.createElement a::1 b::2 [] [@bla] [@JSX]

           At this point the bla will be stripped (because it's a visible
           attribute) but the JSX will still be there.
         *)

        (* this case also happens when we have something like:
         * List.map((a) => a + 1, numbers);
         * We got two "List.map" as Pexp_ident & a list of arguments:
         * [`(a) => a + 1`; `numbers`]
         *
         * Another possible case is:
         * describe("App", () =>
         *   test("math", () =>
         *     Expect.expect(1 + 2) |> toBe(3)));
         *)
        let uncurried = try Hashtbl.find uncurriedTable x.pexp_loc with | Not_found -> false in
        FunctionApplication (
          self#formatFunAppl
            ~uncurried
            ~jsxAttrs
            ~args:ls
            ~applicationExpr:x
            ~funExpr:e
            ()
          )
        )
      )
    )
    | Pexp_field (e, li) ->
        let prec = Token "." in
        let leftItm = self#unparseResolvedRule (
          self#ensureExpression ~reducesOnToken:prec e
        ) in
        let {stdAttrs} = partitionAttributes e.pexp_attributes in
        let formattedLeftItm = if stdAttrs == [] then
            leftItm
          else
            formatPrecedence ~loc:e.pexp_loc leftItm
        in
        let layout = label (makeList [formattedLeftItm; atom "."]) (self#longident_loc li) in
        SpecificInfixPrecedence ({reducePrecedence=prec; shiftPrecedence=prec}, LayoutNode layout)
    | Pexp_construct (li, Some eo) when not (is_simple_construct (view_expr x)) -> (
        match view_expr x with
        (* TODO: Explicit arity *)
        | `normal ->
            let arityIsClear = isArityClear arityAttrs in
            FunctionApplication [self#constructor_expression ~arityIsClear stdAttrs (self#longident_loc li) eo]
        | _ -> assert false
      )
    | Pexp_variant (l, Some eo) ->
        if arityAttrs != [] then
          raise (NotPossible "Should never see embedded attributes on poly variant")
        else
          FunctionApplication [self#constructor_expression ~polyVariant:true ~arityIsClear:true stdAttrs (atom ("`" ^ l)) eo]
    (* TODO: Should protect this identifier *)
    | Pexp_setinstvar (s, rightExpr) ->
      let rightItm = self#unparseResolvedRule (
        self#ensureContainingRule ~withPrecedence:(Token updateToken) ~reducesAfterRight:rightExpr ()
      ) in
      let expr = label ~space:true (makeList ~postSpace:true [(protectIdentifier s.txt); atom updateToken]) rightItm in
      SpecificInfixPrecedence ({reducePrecedence=(Token updateToken); shiftPrecedence=(Token updateToken)}, LayoutNode expr)
    | Pexp_setfield (leftExpr, li, rightExpr) ->
      let rightItm = self#unparseResolvedRule (
        self#ensureContainingRule ~withPrecedence:(Token updateToken) ~reducesAfterRight:rightExpr ()
      ) in
      let leftItm = self#unparseResolvedRule (
        self#ensureExpression ~reducesOnToken:(Token ".") leftExpr
      ) in
      let leftLbl =
        label
          (makeList [leftItm; atom "."])
          (self#longident_loc li) in
      let expr = label ~space:true (makeList ~postSpace:true [leftLbl; atom updateToken]) rightItm in
      SpecificInfixPrecedence ({reducePrecedence=(Token updateToken); shiftPrecedence=(Token updateToken)}, LayoutNode expr)
    | Pexp_match (e, l) when detectTernary l != None -> (
      match detectTernary l with
      | None -> raise (Invalid_argument "Impossible")
      | Some (tt, ff) ->
        let ifTrue = self#reset_request_braces#unparseExpr tt in
        let testItem = self#unparseResolvedRule (
          self#reset_request_braces#ensureExpression e ~reducesOnToken:(Token "?")
        ) in
        let ifFalse = self#unparseResolvedRule (
          self#reset_request_braces#ensureContainingRule ~withPrecedence:(Token ":") ~reducesAfterRight:ff ()
        ) in
        let trueBranch = label ~space:true ~break:`Never (atom "?") ifTrue
        in
        let falseBranch = label ~space:true ~break:`Never (atom ":") ifFalse
        in
        let expr = label ~space:true testItem (makeList ~break:IfNeed ~sep:(Sep " ") ~inline:(true, true) [trueBranch; falseBranch])
        in
        SpecificInfixPrecedence ({reducePrecedence=Token ":"; shiftPrecedence=Token "?"}, LayoutNode expr)
      )
    | _ -> (
      match self#expression_requiring_parens_in_infix x with
      | Some e -> e
      | None -> raise (Invalid_argument "No match for unparsing expression")
    )

  method formatNonSequencyExpression e =
    (*
     * Instead of printing:
     *   let result =  { open Fmt; strf(foo);}
     *
     * We format as:
     *   let result = Fmt.(strf(foo))
     *
     * (Also see https://github.com/facebook/Reason/issues/114)
     *)
    match e.pexp_attributes, e.pexp_desc with
    | [], Pexp_record _ (* syntax sugar for M.{x:1} *)
    | [], Pexp_tuple _ (* syntax sugar for M.(a, b) *)
    | [], Pexp_object {pcstr_fields = []} (* syntax sugar for M.{} *)
    | [], Pexp_construct ( {txt= Lident"::"},Some _)
    | [], Pexp_construct ( {txt= Lident"[]"},_)
    | [], Pexp_extension ( {txt = "bs.obj"}, _ ) ->
      self#simplifyUnparseExpr e (* syntax sugar for M.[x,y] *)
    (* syntax sugar for the rest, wrap with parens to avoid ambiguity.
     * E.g., avoid M.(M2.v) being printed as M.M2.v
     * Or ReasonReact.(<> {string("Test")} </>);
     *)
    | _ -> makeList ~wrap:("(",")") ~break:IfNeed [self#unparseExpr e]

  (*
     It's not enough to only check if precedence of an infix left/right is
     greater than the infix itself. We also should likely pay attention to
     left/right associativity. So how do we render the minimum number of
     parenthesis?

     The intuition is that sequential right associative operators will
     naturally build up deep trees on the right side (left builds up left-deep
     trees). So by default, we add parens to model the tree structure that
     we're rendering except when the parser will *naturally* parse the tree
     structure that the parens assert.

     Sequential identical infix operators:
     ------------------------------------
     So if we see a nested infix operator of precedence Y, as one side of
     another infix operator that has the same precedence (Y), that is S
     associative on the S side of the function application, we don't need to
     wrap in parens. In more detail:

     -Add parens around infix binary function application
       Exception 1: Unless we are a left-assoc operator of precedence X in the left branch of an operator w/ precedence X.
       Exception 2: Unless we are a right-assoc operator of precedence X in the right branch of an operator w/ precedence X.
       Exception 3: Unless we are a _any_-assoc X operator in the _any_ branch of an Y operator where X has greater precedence than Y.

     Note that the exceptions do not specify any special cases for mixing
     left/right associativity. Precedence is what determines necessity of
     parens for operators with non-identical precedences. Associativity
     only determines necessity of parens for identically precedented operators.

     PLUS is left assoc:
     - So this one *shouldn't* expand into two consecutive infix +:


            [Pexp_apply]
              /      \
         first +   [Pexp_apply]
                      /   \
                  second + third


     - This one *should*:

                    [Pexp_apply]
                      /      \
           [  Pexp_apply  ] + third
              /     \
           first +  second



     COLONCOLON is right assoc, so
     - This one *should* expand into two consecutive infix ::  :

            [Pexp_apply]
              /      \
         first ::   [Pexp_apply]
                      /   \
                  second :: third


     - This one *shouldn't*:

                    [Pexp_apply]
                      /      \
           [  Pexp_apply  ] :: third
              /     \
           first ::  second




     Sequential differing infix operators:
     ------------------------------------

     Neither of the following require paren grouping because of rule 3.


            [Pexp_apply]
              /      \
         first  +  [Pexp_apply]
                      /   \
                  second * third


                    [Pexp_apply]
                      /      \
            [Pexp_apply  +  third
              /     \
           first *  second

      The previous has nothing to do with the fact that + and * have the same
      associativity. Exception 3 applies to the following where :: is right assoc
      and + is left. + has higher precedence than ::

      - so parens aren't required to group + when it is in a branch of a
        lower precedence ::

            [Pexp_apply]
              /      \
         first ::   [Pexp_apply]
                      /   \
                  second + third


      - Whereas there is no Exception that applies in this case (Exception 3
        doesn't apply) so parens are required around the :: in this case.

                    [Pexp_apply]
                      /      \
           [  Pexp_apply  ] + third
              /     \
           first ::  second

  *)

  method classExpressionToFormattedApplicationItems = function
    | { pcl_desc = Pcl_apply (ce, l) } ->
      [label (self#simple_class_expr ce) (self#label_x_expression_params l)]
    | x -> [self#class_expr x]


  (**
        How JSX is formatted/wrapped. We want the attributes to wrap independently
        of children.

        <xxx
          attr1=blah
          attr2=foo>
          child
          child
          child
        </x>

      +-------------------------------+
      |  left   right (list of attrs) |
      |   / \   /   \                 |
      |   <tag                        |
      |     attr1=blah                |
      |     attr2=foo                 |
      +-------------------------------+
       |
       |
       |
       |      left       right  list of children with
       |   /       \    /  \     open,close = > </tag>
       |  +---------+
       +--|         |    >
          +---------+

          </tag>           *)
  method formatJSXComponent componentName ?closeComponentName args =
    let self = self#inline_braces in
    let rec processArguments arguments processedAttrs children =
      match arguments with
      | (Labelled "children", {pexp_desc = Pexp_construct (_, None)}) :: tail ->
        processArguments tail processedAttrs None
      | (Labelled "children", {pexp_desc = Pexp_construct ({txt = Lident"::"}, Some {pexp_desc = Pexp_tuple components} )}) :: tail ->
        processArguments tail processedAttrs (self#formatChildren components [])
      | (Labelled "children", expr) :: tail ->
          let dotdotdotChild = match expr with
            | {pexp_desc = Pexp_apply (funExpr, args)}
              when printedStringAndFixityExpr funExpr == Normal &&
                   Reason_attributes.without_stylistic_attrs expr.pexp_attributes == [] ->
              begin match (self#formatFunAppl ~prefix:(atom "...") ~wrap:("{", "}") ~jsxAttrs:[] ~args ~funExpr ~applicationExpr:expr ()) with
              | [x] -> x
              | xs -> makeList xs
              end
            | {pexp_desc = Pexp_fun _ } ->
                self#formatPexpFun ~prefix:(atom "...") ~wrap:("{", "}") expr
            | _ ->
              let childLayout = self#dont_preserve_braces#simplifyUnparseExpr ~wrap:("{", "}") expr in
              makeList ~break:Never [atom "..."; childLayout]
          in
          processArguments tail processedAttrs (Some [dotdotdotChild])
      | (Optional lbl, expression) :: tail ->
        let {jsxAttrs; _} = partitionAttributes expression.pexp_attributes in
        let value_has_jsx = jsxAttrs != [] in
        let nextAttr =
          match expression.pexp_desc with
          | Pexp_ident ident when isPunnedJsxArg lbl ident ->
              makeList ~break:Layout.Never [atom "?"; atom lbl]
           | Pexp_construct _ when value_has_jsx ->
               label
                (makeList ~break:Layout.Never [atom lbl; atom "=?"])
                (self#simplifyUnparseExpr ~wrap:("{","}") expression)
          | _ ->
              label
                (makeList ~break:Layout.Never [atom lbl; atom "=?"])
                (self#dont_preserve_braces#simplifyUnparseExpr ~wrap:("{","}") expression) in
        processArguments tail (nextAttr :: processedAttrs) children
      | (Labelled lbl, expression) :: tail ->
         let {jsxAttrs; _} = partitionAttributes expression.pexp_attributes in
         let value_has_jsx = jsxAttrs != [] in
         let nextAttr =
           match expression.pexp_desc with
           | Pexp_ident ident when isPunnedJsxArg lbl ident -> atom lbl
           | _ when isJSXComponent expression  ->
               label (atom (lbl ^ "="))
                     (makeList ~break:IfNeed ~wrap:("{", "}")
                       [self#dont_preserve_braces#simplifyUnparseExpr expression])
           | Pexp_open (_, lid, e)
             when self#isSeriesOfOpensFollowedByNonSequencyExpression expression ->
             label (makeList [atom lbl;
                              atom "=";
                              (label (self#longident_loc lid) (atom "."))])
                   (self#formatNonSequencyExpression e)
           | Pexp_apply ({pexp_desc = Pexp_ident _} as funExpr, args)
                when printedStringAndFixityExpr funExpr == Normal &&
                     Reason_attributes.without_stylistic_attrs expression.pexp_attributes == [] ->
             let lhs = makeList [atom lbl; atom "="] in
             begin match (
               self#formatFunAppl
                ~prefix:lhs
                ~wrap:("{", "}")
                ~jsxAttrs:[]
                ~args
                ~funExpr
                ~applicationExpr:expression
                ())
             with
             | [x] -> x
             | xs -> makeList xs
             end
           | Pexp_apply (eFun, _) ->
             let lhs = makeList [atom lbl; atom "="] in
             let rhs = (match printedStringAndFixityExpr eFun with
                 | Infix str when requireNoSpaceFor str -> self#unparseExpr expression
                 | _ -> self#dont_preserve_braces#simplifyUnparseExpr ~wrap:("{","}") expression)
             in label lhs rhs
           | Pexp_construct _ when value_has_jsx ->
               label
                (makeList [atom lbl; atom "="])
                (self#simplifyUnparseExpr ~wrap:("{","}") expression)
           | Pexp_record _
           | Pexp_construct _
           | Pexp_array _
           | Pexp_tuple _
           | Pexp_match _
           | Pexp_extension _
           | Pexp_function _ ->
               label
                (makeList [atom lbl; atom "="])
                (self#dont_preserve_braces#simplifyUnparseExpr ~wrap:("{","}") expression)
           | Pexp_fun _ ->
               let propName = makeList [atom lbl; atom "="] in
               self#formatPexpFun ~wrap:("{", "}") ~prefix:propName expression
           | _ -> makeList [
                    atom lbl;
                    atom "=";
                    self#dont_preserve_braces#simplifyUnparseExpr ~wrap:("{","}") expression
                  ]
         in
         processArguments tail (nextAttr :: processedAttrs) children
      | [] -> (processedAttrs, children)
      | _ :: tail -> processArguments tail processedAttrs children
    in
    let (reversedAttributes, children) = processArguments args [] None in
    match children with
    | None ->
      makeList
        ~break:IfNeed
        ~wrap:("<" ^ componentName, "/>")
        ~pad:(true, true)
        ~inline:(false, false)
        ~postSpace:true
        (List.rev reversedAttributes)
    | Some renderedChildren ->
      let openTagAndAttrs =
        match reversedAttributes with
        | [] -> (atom ("<" ^ componentName ^ ">"))
        | revAttrHd::revAttrTl ->
          let finalAttrList = (List.rev (makeList ~break:Layout.Never [revAttrHd; atom ">"] :: revAttrTl)) in
          let renderedAttrList = (makeList ~inline:(true, true) ~break:IfNeed ~pad:(false, false) ~preSpace:true finalAttrList) in
          label
            ~space:true
            (atom ("<" ^ componentName))
            renderedAttrList
      in
      label
        openTagAndAttrs
        (makeList
          ~wrap:("", "</" ^ (match closeComponentName with None -> componentName | Some close -> close) ^ ">")
          ~inline:(true, false)
          ~break:IfNeed
          ~pad:(true, true)
          ~postSpace:true
          renderedChildren)

  (*
   * Format Pexp_fun expression: (a, b) => a + b;
   * Example: the `onClick` prop with Pexp_fun in
   *  <div
   *    onClick={(event) => {
   *      Js.log(event);
   *      handleChange(event);
   *    }}
   *  />;
   *
   *  The arguments of the callback (Pexp_fun) should be inlined as much as
   *  possible on the same line as `onClick={`.
   *  Also notice the brace-hugging `}}` at the end.
   *
   *  ~prefix -> prefixes the Pexp_fun layout, example `onClick=`
   *  ~wrap -> wraps the `Pexp_fun` in the tuple passed to wrap, e.g. `{` and
   *  `}` for jsx
   *)
  method formatPexpFun ?(prefix=(atom "")) ?(wrap=("","")) expression =
    let (lwrap, rwrap) = wrap in
    let {stdAttrs; uncurried} = partitionAttributes expression.pexp_attributes in
    if uncurried then Hashtbl.add uncurriedTable expression.pexp_loc true;

    let (args, ret) =
      (* omit attributes here, we're formatting them manually *)
      self#curriedPatternsAndReturnVal {expression with pexp_attributes = [] }
    in
    (* Format `onClick={` *)
    let propName = makeList ~wrap:("", lwrap) [prefix] in
    let argsList =
      let args = match args with
      | [argsList] -> argsList
      | args -> makeList args
      in
      match stdAttrs with
      | [] -> args
      | attrs ->
          (* attach attributes to the args of the Pexp_fun: `[@attr] (event)` *)
          let attrList =
            makeList ~inline:(true, true) ~break:IfNeed ~postSpace:true
              (List.map self#attribute attrs)
          in
          let all = [attrList; args] in
          makeList ~break:IfNeed ~inline:(true, true) ~postSpace:true all
    in
    (* Format `onClick={(event)` *)
    let propNameWithArgs = label propName argsList in
    (* Pick constraints: (a, b) :string => ...
     * :string is the constraint here *)
    let (return, optConstr) = match ret.pexp_desc with
      | Pexp_constraint (e, ct) -> (e, Some (self#non_arrowed_core_type ct))
      | _ -> (ret, None)
    in
    let returnExpr, leftWrap = match (self#letList return) with
    | [x] ->
      (* Format `handleChange(event)}` or
       *  handleChange(event)
       * }
       *
       * If the closing rwrap is empty, we need it to be inline, otherwise
       * we get a empty newline when the layout breaks:
       * ```
       *  handleChange(event)
       *
       * ```
       * (Notice to nonsense newline)
       *)
       let shouldPreserveBraces = self#should_preserve_requested_braces return in
       let rwrap = if shouldPreserveBraces then
         "}" ^ rwrap
       else
         rwrap
       in
       let inlineClosing = rwrap = "" in
       let layout =
         makeList ~break:IfNeed ~inline:(true, inlineClosing) ~wrap:("", rwrap) [x]
       in
       layout, if shouldPreserveBraces then "{" else ""
    | xs ->
      (* Format `Js.log(event)` and `handleChange(event)` as
       * {
       *   Js.log(event);
       *   handleChange(event);
       * }}
       *)
      let layout = makeList
          ~break:Always_rec ~sep:(SepFinal (";", ";")) ~wrap:("{", "}" ^ rwrap)
          xs
      in
      layout, ""
    in
    match optConstr with
    | Some typeConstraint ->
      let upToConstraint =
        label ~space:true
          (makeList ~wrap:("", ":") [propNameWithArgs])
          typeConstraint
      in
      label
        (makeList ~wrap:("", " => " ^ leftWrap) [upToConstraint])
        returnExpr
    | None ->
      label
        (makeList ~wrap:("", " => " ^ leftWrap) [propNameWithArgs])
        returnExpr

  (* Creates a list of simple module expressions corresponding to module
     expression or functor application. *)
  method moduleExpressionToFormattedApplicationItems ?(prefix="") x =
    match x with
    (* are we formatting a functor application with a module structure as arg?
     * YourLib.Make({
     *   type t = int;
     *   type s = string;
     * });
     *
     * We should "hug" the parens here: ({ & }) should stick together.
     *)
    | { pmod_desc = Pmod_apply (
            ({pmod_desc = Pmod_ident _} as m1),
            ({pmod_desc = Pmod_structure _} as m2)
         )
      } ->
        let modIdent = source_map ~loc:m1.pmod_loc (self#simple_module_expr m1) in
        let name = if prefix <> "" then
          makeList ~postSpace:true[atom prefix; modIdent]
          else modIdent
        in
        let arg = source_map ~loc:m2.pmod_loc (self#simple_module_expr ~hug:true m2) in
        label name arg
    | _ ->
      let rec extract_apps args = function
        | { pmod_desc = Pmod_apply (me1, me2) } ->
          let arg = source_map ~loc:me2.pmod_loc (self#simple_module_expr me2) in
          extract_apps (arg :: args) me1
        | me ->
          let head = source_map ~loc:me.pmod_loc (self#module_expr me) in
          if args == [] then head else label head (makeTup args)
      in
      let functor_application = extract_apps [] x in
      if prefix <> "" then
        makeList ~postSpace:true [atom prefix; functor_application]
      else
        functor_application

  (*

     Watch out, if you see something like below (sixteenTuple getting put on a
     newline), yet a paren-wrapped list wouldn't have had an extra newlin, you
     might need to wrap the single token (sixteenTuple) in [ensureSingleTokenSticksToLabel].
     let (
        axx,
        oxx,
        pxx
      ):
        sixteenTuple = echoTuple (
        0,
        0,
        0
      );
  *)

  method formatSimplePatternBinding labelOpener layoutPattern typeConstraint appTerms =
    let letPattern = label ~break:`Never ~space:true (atom labelOpener) layoutPattern in
    let upUntilEqual =
      match typeConstraint with
        | None -> letPattern
        | Some tc -> formatTypeConstraint letPattern tc
    in
    let includingEqual = makeList ~postSpace:true [upUntilEqual; atom "="] in
    formatAttachmentApplication applicationFinalWrapping (Some (true, includingEqual)) appTerms

  (*
     The [bindingLabel] is either the function name (if let binding) or first
     arg (if lambda).

     For defining layout of the following form:

         lbl one
             two
             constraint => {
           ...
         }

     If using "=" as the arrow, can also be used for:

         met private
             myMethod
             constraint = fun ...

   *)
  method wrapCurriedFunctionBinding
         ?attachTo
         ~arrow
         ?(sweet=false)
         ?(spaceBeforeArrow=true)
         prefixText
         bindingLabel
         patternList
         returnedAppTerms =
    let allPatterns = bindingLabel::patternList in
    let partitioning = curriedFunctionFinalWrapping allPatterns in
    let everythingButReturnVal =
      (*
         Because align_closing is set to false, you get:

         (Brackets[] inserted to show boundaries between open/close of pattern list)
         let[firstThing
             secondThing
             thirdThing]

         It only wraps to indent four by coincidence: If the "opening" token was
         longer, you'd get:

         letReallyLong[firstThing
                       secondThing
                       thirdThing]

         For curried let bindings, we stick the arrow in the *last* pattern:
         let[firstThing
             secondThing
             thirdThing =>]

         But it could have just as easily been the "closing" token corresponding to
         "let". This works because we have [align_closing = false]. The benefit of
         shoving it in the last pattern, is that we can turn [align_closing = true]
         and still have the arrow stuck to the last pattern (which is usually what we
         want) (See modeTwo below).
      *)
      match partitioning with
        | None when sweet ->
          makeList
            ~pad:(false, spaceBeforeArrow)
            ~wrap:("", arrow)
            ~indent:(settings.space * settings.indentWrappedPatternArgs)
            ~postSpace:true
            ~inline:(true, true)
            ~break:IfNeed
            allPatterns
        | None ->
            (* We want the binding label to break *with* the arguments. Again,
               there's no apparent way to add additional indenting for the
               args with this setting. *)

            (*
               Formats lambdas by treating the first pattern as the
               "bindingLabel" which is kind of strange in some cases (when
               you only have one arg that wraps)...

                  echoTheEchoer (
                    fun (
                          a,
                          p
                        ) => (
                      a,
                      b
                    )

               But it makes sense in others (where you have multiple args):

                  echoTheEchoer (
                    fun (
                          a,
                          p
                        )
                        mySecondArg
                        myThirdArg => (
                      a,
                      b
                    )

               Try any other convention for wrapping that first arg and it
               won't look as balanced when adding multiple args.

            *)
          makeList
            ~pad:(true, spaceBeforeArrow)
            ~wrap:(prefixText, arrow)
            ~indent:(settings.space * settings.indentWrappedPatternArgs)
            ~postSpace:true
            ~inline:(true, true)
            ~break:IfNeed
            allPatterns
        | Some (attachedList, wrappedListy) ->
            (* To get *only* the final argument to "break", while not
               necessarily breaking the prior arguments, we dock everything
               but the last item to a created label *)
          label
            ~space:true
            (
              makeList
                ~pad:(true, spaceBeforeArrow)
                ~wrap:(prefixText, arrow)
                ~indent:(settings.space * settings.indentWrappedPatternArgs)
                ~postSpace:true
                ~inline:(true, true)
                ~break:IfNeed
                attachedList
            )
            wrappedListy
    in

    let everythingButAppTerms = match attachTo with
      | None -> everythingButReturnVal
      | Some toThis -> label ~space:true toThis everythingButReturnVal
    in
    formatAttachmentApplication
      applicationFinalWrapping
      (Some (true, everythingButAppTerms))
      returnedAppTerms

  method leadingCurriedAbstractTypes x =
    let rec argsAndReturn xx =
      match xx.pexp_desc with
        | Pexp_newtype (str,e) ->
            let (nextArgs, return) = argsAndReturn e in
            (str::nextArgs, return)
        | _ -> ([], xx.pexp_desc)
    in argsAndReturn x

  method curriedConstructorPatternsAndReturnVal cl =
    let rec argsAndReturn args = function
      | { pcl_desc = Pcl_fun (label, eo, p, e); pcl_attributes = [] } ->
        let arg = source_map ~loc:p.ppat_loc (self#label_exp label eo p) in
        argsAndReturn (arg :: args) e
      | xx ->
        if args == [] then (None, xx) else (Some (makeTup (List.rev args)), xx)
    in
    argsAndReturn [] cl



  (*
    Returns the arguments list (if any, that occur before the =>), and the
    final expression (that is either returned from the function (after =>) or
    that is bound to the value (if there are no arguments, and this is just a
    let pattern binding)).
  *)
  method curriedPatternsAndReturnVal x =
    let uncurried = try Hashtbl.find uncurriedTable x.pexp_loc with | Not_found -> false in
    let rec extract_args xx =
      let {stdAttrs} = partitionAttributes ~allowUncurry:false xx.pexp_attributes in
      if stdAttrs != [] then
        ([], xx)
      else match xx.pexp_desc with
        (* label * expression option * pattern * expression *)
        | Pexp_fun (l, eo, p, e) ->
          let args, ret = extract_args e in
          (`Value (l,eo,p) :: args, ret)
        | Pexp_newtype (newtype,e) ->
          let args, ret = extract_args e in
          (`Type newtype :: args, ret)
        | Pexp_constraint _ -> ([], xx)
        | _ -> ([], xx)
    in
    let prepare_arg = function
      | `Value (l,eo,p) -> source_map ~loc:p.ppat_loc (self#label_exp l eo p)
      | `Type nt -> atom ("type " ^ nt)
    in
    let single_argument_no_parens p ret =
      if uncurried then false
      else
        let isUnitPat = is_unit_pattern p in
        let isAnyPat = is_any_pattern p in
        begin match ret.pexp_desc with
        (* (event) :ReasonReact.event => {...}
         * The above Pexp_fun with constraint ReasonReact.event requires parens
         * surrounding the single argument `event`.*)
        | Pexp_constraint _ when not isUnitPat && not isAnyPat -> false
        | _ -> isUnitPat || isAnyPat || is_ident_pattern p
      end
    in
    match extract_args x with
    | ([], ret) -> ([], ret)
    | ([`Value (Nolabel, None, p) ], ret) when is_unit_pattern p && uncurried ->
        ( [atom "(.)"], ret)
    | ([`Value (Nolabel, None, p) as arg], ret) when single_argument_no_parens p ret ->
      ([prepare_arg arg], ret)
    | (args, ret) ->
        ([makeTup ~uncurried (List.map prepare_arg args)], ret)

  (* Returns the (curriedModule, returnStructure) for a functor *)
  method curriedFunctorPatternsAndReturnStruct = function
    (* string loc * module_type option * module_expr *)
    | { pmod_desc = Pmod_functor(s, mt, me2) } ->
        let firstOne =
          match mt with
            | None -> atom "()"
            | Some mt' -> self#module_type (makeList [atom s.txt; atom ":"]) mt'
        in
        let (functorArgsRecurse, returnStructure) = (self#curriedFunctorPatternsAndReturnStruct me2) in
        (firstOne::functorArgsRecurse, returnStructure)
    | me -> ([], me)

  method isRenderableAsPolymorphicAbstractTypes
         typeVars
         polyType
         leadingAbstractVars
         nonVarifiedType =
      same_ast_modulo_varification_and_extensions polyType nonVarifiedType &&
      for_all2' string_equal typeVars leadingAbstractVars

  (* Reinterpret this as a pattern constraint since we don't currently have a
     way to disambiguate. There is currently a way to disambiguate a parsing
     from Ppat_constraint vs.  Pexp_constraint. Currently (and consistent with
     OCaml standard parser):

       let (x: typ) = blah;
         Becomes Ppat_constraint
       let x:poly . type = blah;
         Becomes Ppat_constraint
       let x:typ = blah;
         Becomes Pexp_constraint(ghost)
       let x = (blah:typ);
         Becomes Pexp_constraint(ghost)

     How are double constraints represented?
     let (x:typ) = (blah:typ);
     If currently both constraints are parsed into a single Pexp_constraint,
     then something must be lost, and how could you fail type checking on:
     let x:int = (10:string) ?? Answer: It probably parses into a nested
     Pexp_constraint.

     Proposal:

       let (x: typ) = blah;
         Becomes Ppat_constraint   (still)
       let x:poly . type = blah;
         Becomes Ppat_constraint   (still)
       let x:typ = blah;
         Becomes Ppat_constraint
       let x = blah:typ;
         Becomes Pexp_constraint


     Reasoning: Allows parsing of any of the currently valid ML forms, but
     combines the two most similar into one form. The only lossyness is the
     unnecessary parens, which there is already precedence for dropping in
     expressions. In the existing approach, preserving a paren-constrained
     expression is *impossible* because it becomes pretty printed as
     let x:t =.... In the proposal, it is not impossible - it is only
     impossible to preserve unnecessary parenthesis around the let binding.

     The one downside is that integrating with existing code that uses [let x =
     (blah:typ)] in standard OCaml will be parsed as a Pexp_constraint. There
     might be some lossiness (beyond parens) that occurs in the original OCaml
     parser.
  *)

  method locallyAbstractPolymorphicFunctionBinding prefixText layoutPattern funWithNewTypes absVars bodyType =
    let appTerms = self#unparseExprApplicationItems funWithNewTypes in
    let locallyAbstractTypes = (List.map atom absVars) in
    let typeLayout =
      source_map ~loc:bodyType.ptyp_loc (self#core_type bodyType)
    in
    let polyType =
      label
        ~space:true
        (* TODO: This isn't a correct use of sep! It ruins how
         * comments are interleaved. *)
        (makeList [makeList ~sep:(Sep " ") (atom "type"::locallyAbstractTypes); atom "."])
        typeLayout
      in
    self#formatSimplePatternBinding
      prefixText
      layoutPattern
      (Some polyType)
      appTerms

  (**
      Intelligently switches between:
      Curried function binding w/ constraint on return expr:
         lbl patt
             pattAux
             arg
             :constraint => {
           ...
         }

      Constrained:
         lbl patt
             pattAux...
             :constraint = {
           ...
         }
   *)
  method wrappedBinding prefixText ~arrow pattern patternAux expr =
    let expr = self#process_underscore_application expr in
    let (argsList, return) = self#curriedPatternsAndReturnVal expr in
    let patternList = match patternAux with
      | [] -> pattern
      | _::_ -> makeList ~postSpace:true ~inline:(true, true) ~break:IfNeed (pattern::patternAux)
    in
    match (argsList, return.pexp_desc) with
      | ([], Pexp_constraint (e, ct)) ->
          let typeLayout =
            source_map ~loc:ct.ptyp_loc
              begin match ct.ptyp_desc with
              | Ptyp_package (li, cstrs) ->
                self#typ_package li cstrs
              | _ ->
                self#core_type ct
              end
          in
          let appTerms = self#unparseExprApplicationItems e in
          self#formatSimplePatternBinding prefixText patternList (Some typeLayout) appTerms
      | ([], _) ->
          (* simple let binding, e.g. `let number = 5` *)
          (* let f = (. a, b) => a + b; *)
          let appTerms = self#unparseExprApplicationItems expr in
          self#formatSimplePatternBinding prefixText patternList None appTerms
      | (_::_, _) ->
          let (argsWithConstraint, actualReturn) = self#normalizeFunctionArgsConstraint argsList return in
          let fauxArgs =
            List.concat [patternAux; argsWithConstraint] in
          let returnedAppTerms = self#unparseExprApplicationItems actualReturn in
           (* Attaches the `=` to `f` to recreate javascript function syntax in
            * let f = (a, b) => a + b; *)
          let lbl = makeList ~sep:(Sep " ") ~break:Layout.Never [pattern; atom "="] in
          self#wrapCurriedFunctionBinding prefixText ~arrow lbl fauxArgs returnedAppTerms

  (* Similar to the above method. *)
  method wrappedClassBinding prefixText pattern patternAux expr =
    let (args, return) = self#curriedConstructorPatternsAndReturnVal expr in
    let patternList =
      match patternAux with
        | [] -> pattern
        | _::_ -> makeList ~postSpace:true ~inline:(true, true) ~break:IfNeed (pattern::patternAux)
    in
    match (args, return.pcl_desc) with
      | (None, Pcl_constraint (e, ct)) ->
          let typeLayout = source_map ~loc:ct.pcty_loc (self#class_constructor_type ct) in
          self#formatSimplePatternBinding prefixText patternList (Some typeLayout)
            (self#classExpressionToFormattedApplicationItems e, None)
      | (None, _) ->
          self#formatSimplePatternBinding prefixText patternList None
            (self#classExpressionToFormattedApplicationItems expr, None)
      | (Some args, _) ->
          let (argsWithConstraint, actualReturn) =
            self#normalizeConstructorArgsConstraint [args] return in
          let fauxArgs =
            List.concat [patternAux; argsWithConstraint] in
          self#wrapCurriedFunctionBinding prefixText ~arrow:"=" pattern fauxArgs
            (self#classExpressionToFormattedApplicationItems actualReturn, None)

  (* Attaches doc comments to a layout, with whitespace preserved
   * Example:
   * /** Doc comment */
   *
   * /* another random comment */
   * let a = 1;
   *)
  method attachDocAttrsToLayout
    (* all std attributes attached on the ast node backing the layout *)
    ~stdAttrs:(stdAttrs : Ast_404.Parsetree.attributes)
    (* all doc comments attached on the ast node backing the layout *)
    ~docAttrs:(docAttrs : Ast_404.Parsetree.attributes)
    (* location of the layout *)
    ~loc
    (* layout to attach the doc comments to *)
    ~layout () =
    (*
     * compute the correct location of layout
     * Example:
     * 1| /** doc-comment */
     * 2|
     * 3| [@attribute]
     * 4| let a = 1;
     *
     * The location might indicate a start of line 4 for the ast-node
     * representing `let a = 1`. The reality is that `[@attribute]` should be
     * included (start of line 3), to represent the correct start location
     * of the whole layout.
     *)
    let loc = match stdAttrs with
    | (astLoc, _)::_ -> astLoc.loc
    | [] -> loc
    in
    let rec aux prevLoc layout = function
      | ((x, _) as attr : Ast_404.Parsetree.attribute)::xs ->
        let newLayout =
          let range = Range.makeRangeBetween x.loc prevLoc in
          let layout =
            if Range.containsWhitespace ~range ~comments:self#comments () then
              let region = WhitespaceRegion.make ~range ~newlines:1 () in
              Layout.Whitespace(region, layout)
            else layout
          in
          makeList ~inline:(true, true) ~break:Always [
            self#attribute attr;
            layout
          ]
        in aux x.loc newLayout xs
      | [] -> layout
    in
    aux loc layout (List.rev docAttrs)

  method binding prefixText x = (* TODO: print attributes *)
    let body = match x.pvb_pat.ppat_desc with
      | (Ppat_var _) ->
        self#wrappedBinding prefixText ~arrow:"=>"
          (source_map ~loc:x.pvb_pat.ppat_loc (self#simple_pattern x.pvb_pat))
          [] x.pvb_expr
      (*
         Ppat_constraint is used in bindings of the form

            let (inParenVar:typ) = ...

         And in the case of let bindings for explicitly polymorphic type
         annotations (see parser for more details).

         See reason_parser.mly for explanation of how we encode the two primary
         forms of explicit polymorphic annotations in the parse tree, and how
         we must recover them here.
       *)
      | (Ppat_constraint(p, ty)) -> (
          (* Locally abstract forall types are *seriously* mangled by the parsing
             stage, and we have to be very smart about how to recover it.

              let df_locallyAbstractFuncAnnotated:
                type a b.
                  a =>
                  b =>
                  (inputEchoRecord a, inputEchoRecord b) =
                fun (input: a) (input2: b) => (
                  {inputIs: input},
                  {inputIs: input2}
                );

             becomes:

               let df_locallyAbstractFuncAnnotatedTwo:
                 'a 'b .
                 'a => 'b => (inputEchoRecord 'a, inputEchoRecord 'b)
                =
                 fun (type a) (type b) => (
                   fun (input: a) (input2: b) => ({inputIs: input}, {inputIs:input2}):
                     a => b => (inputEchoRecord a, inputEchoRecord b)
                 );
          *)
          let layoutPattern =
            source_map ~loc:x.pvb_pat.ppat_loc (self#simple_pattern p)
          in
          let leadingAbsTypesAndExpr = self#leadingCurriedAbstractTypes x.pvb_expr in
          match (p.ppat_desc, ty.ptyp_desc, leadingAbsTypesAndExpr) with
            | (Ppat_var _,
               Ptyp_poly (typeVars, varifiedPolyType),
               (_::_ as absVars, Pexp_constraint(funWithNewTypes, nonVarifiedExprType)))
              when self#isRenderableAsPolymorphicAbstractTypes
                  typeVars
                  (* If even artificially varified - don't know until returns*)
                  varifiedPolyType
                  absVars
                  nonVarifiedExprType ->
              (*
                 We assume was the case whenever we see this pattern in the
                 AST, it was because the parser parsed the polymorphic locally
                 abstract type sugar.

                 Ppat_var..Ptyp_poly...Pexp_constraint:

                    let x: 'a 'b . 'a => 'b => 'b =
                      fun (type a) (type b) =>
                         (fun aVal bVal => bVal : a => b => b);

                 We need to be careful not to accidentally detect similar
                 forms, that cannot be printed as sugar.

                    let x: 'a 'b . 'a => 'b => 'b =
                      fun (type a) (type b) =>
                         (fun aVal bVal => bVal : int => int => int);

                 Should *NOT* be formatted as:

                    let x: type a b. int => int => int = fun aVal bVal => bVal;

                 The helper function
                 [same_ast_modulo_varification_and_extensions] was created to
                 help compare the varified constraint pattern body, and the
                 non-varified expression constraint type.

                 The second requirement that we check before assuming that the
                 sugar form is correct, is to make sure the list of type vars
                 corresponds to a leading prefix of the Pexp_newtype variables.
              *)
              self#locallyAbstractPolymorphicFunctionBinding
                prefixText
                layoutPattern
                funWithNewTypes
                absVars
                nonVarifiedExprType
            | _ ->
              let typeLayout = source_map ~loc:ty.ptyp_loc (self#core_type ty) in
              let appTerms = self#unparseExprApplicationItems x.pvb_expr in
              self#formatSimplePatternBinding
                prefixText
                layoutPattern
                (Some typeLayout)
                appTerms
        )
      | _ ->
        let layoutPattern =
          source_map ~loc:x.pvb_pat.ppat_loc (self#pattern x.pvb_pat)
        in
        let appTerms = self#unparseExprApplicationItems x.pvb_expr in
        self#formatSimplePatternBinding prefixText layoutPattern None appTerms
    in
    let {stdAttrs; docAttrs} = partitionAttributes ~partDoc:true x.pvb_attributes in

    let body = makeList ~inline:(true, true) [body] in
    let layout = self#attach_std_item_attrs stdAttrs (source_map ~loc:x.pvb_loc body) in
    self#attachDocAttrsToLayout
      ~stdAttrs
      ~docAttrs
      ~loc:x.pvb_pat.ppat_loc
      ~layout
      ()

  (* Ensures that the constraint is formatted properly for sake of function
     binding (formatted without arrows)
     let x y z : no_unguarded_arrows_allowed_here => ret;
   *)
  method normalizeFunctionArgsConstraint argsList return =
    match return.pexp_desc with
      | Pexp_constraint (e, ct) ->
        let typeLayout =
          source_map ~loc:ct.ptyp_loc
            (self#non_arrowed_non_simple_core_type ct)
        in
        ([makeList
           ~break:IfNeed
           ~inline:(true, true)
           (argsList@[formatJustTheTypeConstraint typeLayout])], e)
      | _ -> (argsList, return)

  method normalizeConstructorArgsConstraint argsList return =
    match return.pcl_desc with
      | Pcl_constraint (e, ct) when return.pcl_attributes == [] ->
        let typeLayout =
          source_map ~loc:ct.pcty_loc
            (self#non_arrowed_class_constructor_type ct)
        in
        (argsList@[formatJustTheTypeConstraint typeLayout], e)
      | _ -> (argsList, return)

  method bindingsLocationRange ?extension l =
    let len = List.length l in
    let fstLoc = match extension with
    | Some ({pexp_loc = {loc_ghost = false}} as ext) -> ext.pexp_loc
    | _ -> (List.nth l 0).pvb_loc
    in
    let lstLoc = (List.nth l (len - 1)).pvb_loc in
    {
      loc_start = fstLoc.loc_start;
      loc_end = lstLoc.loc_end;
      loc_ghost = false
    }

  method bindings ?extension (rf, l) =
    let label = add_extension_sugar "let" extension in
    let label = match rf with
      | Nonrecursive -> label
      | Recursive -> label ^ " rec"
    in
    match l with
    | [x] -> self#binding label x
    | l ->
      let items = List.mapi (fun i x ->
        let loc = extractLocValBinding x in
        let layout = self#binding (if i == 0 then label else "and") x in
        (loc, layout)
      ) l
      in
      let itemsLayout = groupAndPrint
        ~xf:(fun (_, layout) -> layout)
        ~getLoc:(fun (loc, _) -> loc)
        ~comments:self#comments
        items
      in
      makeList
        ~postSpace:true
        ~break:Always
        ~indent:0
        ~inline:(true, true)
        itemsLayout

  method letList expr =
    (* Recursively transform a nested ast of "let-items", into a flat
     * list containing the location indicating start/end of the "let-item" and
     * its layout. *)
    let rec processLetList acc expr =
      let {stdAttrs; arityAttrs; jsxAttrs} =
        partitionAttributes ~allowUncurry:false expr.pexp_attributes
      in
      match (stdAttrs, expr.pexp_desc) with
        | ([], Pexp_let (rf, l, e)) ->
          (* For "letList" bindings, the start/end isn't as simple as with
           * module value bindings. For "let lists", the sequences were formed
           * within braces {}. The parser relocates the first let binding to the
           * first brace. *)
           let bindingsLayout = self#bindings (rf, l) in
           let bindingsLoc = self#bindingsLocationRange l in
           let layout = source_map ~loc:bindingsLoc bindingsLayout in
           processLetList ((bindingsLoc, layout)::acc) e
        | (attrs, Pexp_open (ovf, lid, e))
            (* Add this when check to make sure these are handled as regular "simple expressions" *)
            when not (self#isSeriesOfOpensFollowedByNonSequencyExpression {expr with pexp_attributes = []}) ->
          let overrideStr = match ovf with | Override -> "!" | Fresh -> "" in
          let openLayout = label ~space:true
            (atom ("open" ^ overrideStr))
            (self#longident_loc lid)
          in
          let attrsOnOpen =
            makeList ~inline:(true, true) ~postSpace:true ~break:Always
            ((self#attributes attrs)@[openLayout])
          in
          (* Just like the bindings, have to synthesize a location since the
           * Pexp location is parsed (potentially) beginning with the open
           * brace {} in the let sequence. *)
          let layout = source_map ~loc:lid.loc attrsOnOpen in
          let loc = {
            lid.loc with
            loc_start = {
              lid.loc.loc_start with
              pos_lnum = expr.pexp_loc.loc_start.pos_lnum
            }
          } in
          processLetList ((loc, layout)::acc) e
        | ([], Pexp_letmodule (s, me, e)) ->
            let prefixText = "module" in
            let bindingName = atom ~loc:s.loc s.txt in
            let moduleExpr = me in
            let letModuleLayout =
              (self#let_module_binding prefixText bindingName moduleExpr) in
            let letModuleLoc = {
              loc_start = s.loc.loc_start;
              loc_end = me.pmod_loc.loc_end;
              loc_ghost = false
            } in
            (* Just like the bindings, have to synthesize a location since the
             * Pexp location is parsed (potentially) beginning with the open
             * brace {} in the let sequence. *)
          let layout = source_map ~loc:letModuleLoc letModuleLayout in
          let (_, return) = self#curriedFunctorPatternsAndReturnStruct moduleExpr in
            let loc = {
              letModuleLoc with
              loc_end = return.pmod_loc.loc_end
            } in
           processLetList ((loc, layout)::acc) e
        | ([], Pexp_letexception (extensionConstructor, expr)) ->
            let exc = self#exception_declaration extensionConstructor in
            let layout = source_map ~loc:extensionConstructor.pext_loc exc in
            processLetList ((extensionConstructor.pext_loc, layout)::acc) expr
        | ([], Pexp_sequence (({pexp_desc=Pexp_sequence _ }) as e1, e2))
        | ([], Pexp_sequence (({pexp_desc=Pexp_let _      }) as e1, e2))
        | ([], Pexp_sequence (({pexp_desc=Pexp_open _     }) as e1, e2))
        | ([], Pexp_sequence (({pexp_desc=Pexp_letmodule _}) as e1, e2))
        | ([], Pexp_sequence (e1, e2)) ->
            let e1Layout = match expression_not_immediate_extension_sugar e1 with
              | Some (extension, e) ->
                    self#attach_std_item_attrs ~extension []
                      (self#unparseExpr e)
              | None ->
                  self#unparseExpr e1
            in
            let loc = e1.pexp_loc in
            let layout = source_map ~loc e1Layout in
            processLetList ((loc, layout)::acc) e2
        | _ ->
          let expr = { expr with pexp_attributes = (arityAttrs @ stdAttrs @ jsxAttrs) }
          in
          match expression_not_immediate_extension_sugar expr with
          | Some (extension, {pexp_attributes = []; pexp_desc = Pexp_let (rf, l, e)}) ->
            let bindingsLayout = self#bindings ~extension (rf, l) in
            let bindingsLoc = self#bindingsLocationRange ~extension:expr l in
            let layout = source_map ~loc:bindingsLoc bindingsLayout in
            processLetList ((extractLocationFromValBindList expr l, layout)::acc) e
          | Some (extension, e) ->
            let layout = self#attach_std_item_attrs ~extension [] (self#unparseExpr e) in
            (expr.pexp_loc, layout)::acc
          | None ->
            (* Should really do something to prevent infinite loops here. Never
               allowing a top level call into letList to recurse back to
               self#unparseExpr- top level calls into letList *must* be one of the
               special forms above whereas lower level recursive calls may be of
               any form. *)
            let layout = source_map ~loc:expr.pexp_loc (self#unparseExpr expr) in
            (expr.pexp_loc, layout)::acc
    in
    let es = processLetList [] expr in
    (* Interleave whitespace between the "let-items" when appropriate *)
    groupAndPrint
      ~xf:(fun (_, layout) -> layout)
      ~getLoc:(fun (loc, _) -> loc)
      ~comments:self#comments
      (List.rev es)

  method constructor_expression ?(polyVariant=false) ~arityIsClear stdAttrs ctor eo =
    let (implicit_arity, arguments) =
      match eo.pexp_desc with
      | Pexp_construct ( {txt= Lident "()"},_) ->
        (* `foo() is a polymorphic variant that contains a single unit construct as expression
         * This requires special formatting: `foo(()) -> `foo() *)
        (false, atom "()")
      (* special printing: MyConstructor(()) -> MyConstructor() *)
      | Pexp_tuple l when is_single_unit_construct l ->
          (false, atom "()")
      | Pexp_tuple l when polyVariant == true ->
          (false, self#unparseSequence ~wrap:("(", ")") ~construct:`Tuple l)
      | Pexp_tuple l ->
        (* There is no ambiguity when the number of tuple components is 1.
             We don't need put implicit_arity in that case *)
        (match l with
        | exprList when isSingleArgParenApplication exprList ->
            (false, self#singleArgParenApplication exprList)
        | _ ->
            (not arityIsClear, makeTup (List.map self#unparseProtectedExpr l)))
      | _ when isSingleArgParenApplication [eo] ->
          (false, self#singleArgParenApplication [eo])
      | _ ->
          (false, makeTup [self#unparseProtectedExpr eo])
    in
    let arguments = source_map ~loc:eo.pexp_loc arguments in
    let construction =
      label ctor (if isSequencey arguments
                  then arguments
                  else (ensureSingleTokenSticksToLabel arguments))
    in
    let attrs =
      if implicit_arity && (not polyVariant) then
        ({txt="implicit_arity"; loc=eo.pexp_loc}, PStr []) :: stdAttrs
      else
        stdAttrs
    in
    match attrs with
      | [] -> construction
      | _::_ -> formatAttributed construction (self#attributes attrs)

  (* TODOATTRIBUTES: Handle stdAttrs here (merge with implicit_arity) *)
  method constructor_pattern ?(polyVariant=false) ~arityIsClear ctor po =
    let (implicit_arity, arguments) =
      match po.ppat_desc with
      (* There is no ambiguity when the number of tuple components is 1.
           We don't need put implicit_arity in that case *)
      | Ppat_tuple (([] | _::[]) as l) ->
        (false, l)
      | Ppat_tuple l ->
        (not arityIsClear, l)

      | _ -> (false, [po])
    in
    let space, arguments = match arguments with
      | [x] when is_direct_pattern x -> (true, self#simple_pattern x)
      | xs when isSingleArgParenPattern xs -> (false, self#singleArgParenPattern xs)
      (* Optimize the case when it's a variant holding a shot variable - avoid trailing*)
      | [{ppat_desc=Ppat_constant (Pconst_string (s, None))} as x]
      | [{ppat_desc=Ppat_construct (({txt=Lident s}), None)} as x]
      | [{ppat_desc=Ppat_var ({txt = s})} as x]
        when Reason_heuristics.singleTokenPatternOmmitTrail s ->
        let layout = makeTup ~trailComma:false [self#pattern x] in
        (false, source_map ~loc:po.ppat_loc layout)
      | [{ppat_desc=Ppat_any} as x]
      | [{ppat_desc=Ppat_constant (Pconst_char _)} as x]
      | [{ppat_desc=Ppat_constant (Pconst_integer _)} as x] ->
        let layout = makeTup ~trailComma:false [self#pattern x] in
        (false, source_map ~loc:po.ppat_loc layout)
      | xs ->
        let layout = makeTup (List.map self#pattern xs) in
        (false, source_map ~loc:po.ppat_loc layout)
    in
    let construction = label ~space ctor arguments in
    if implicit_arity && (not polyVariant) then
      formatAttributed construction
        (self#attributes [({txt="implicit_arity"; loc=po.ppat_loc}, PStr [])])
    else
      construction

  (*
   * Provides special printing for constructor arguments:
   * iff there's one argument & they have some kind of wrapping,
   * they're wrapping need to 'hug' the surrounding parens.
   * Example:
   *  switch x {
   *  | Some({
   *      a,
   *      b,
   *    }) => ()
   *  }
   *
   *  Notice how ({ and }) hug.
   *  This applies for records, arrays, tuples & lists.
   *  Also see `isSingleArgParenPattern` to determine if this kind of wrapping applies.
   *)
  method singleArgParenPattern = function
    | [{ppat_desc = Ppat_record (l, closed); ppat_loc = loc}] ->
      source_map ~loc (self#patternRecord ~wrap:("(", ")") l closed)
    | [{ppat_desc = Ppat_array l; ppat_loc = loc}] ->
      source_map ~loc (self#patternArray ~wrap:("(", ")") l)
    | [{ppat_desc = Ppat_tuple l; ppat_loc = loc}] ->
      source_map ~loc (self#patternTuple ~wrap:("(", ")") l)
    | [{ppat_desc = Ppat_construct (({txt=Lident "::"}), _); ppat_loc} as listPattern]  ->
      source_map ~loc:ppat_loc (self#patternList ~wrap:("(", ")")  listPattern)
    | _ -> assert false

  method patternArray ?(wrap=("","")) l =
    let (left, right) = wrap in
    let wrap = (left ^ "[|", "|]" ^ right) in
    makeList ~wrap ~break:IfNeed ~postSpace:true ~sep:commaTrail (List.map self#pattern l)

  method patternTuple ?(wrap=("","")) l =
    let (left, right) = wrap in
    let wrap = (left ^ "(", ")" ^ right) in
    makeList ~wrap ~sep:commaTrail ~postSpace:true ~break:IfNeed (List.map self#constrained_pattern l)

  method patternRecord ?(wrap=("","")) l closed =
    let longident_x_pattern (li, p) =
      match (li, p.ppat_desc) with
        | ({txt = ident}, Ppat_var {txt}) when Longident.last ident = txt ->
          (* record field punning when destructuring. {x: x, y: y} becomes {x, y} *)
          (* works with module prefix too: {MyModule.x: x, y: y} becomes {MyModule.x, y} *)
            self#longident_loc li
        | ({txt = ident},
           Ppat_alias ({ppat_desc = (Ppat_var {txt = ident2}) }, {txt = aliasIdent}))
           when Longident.last ident = ident2 ->
          (* record field punning when destructuring with renaming. {state: state as prevState} becomes {state as prevState *)
          (* works with module prefix too: {ReasonReact.state: state as prevState} becomes {ReasonReact.state as prevState *)
            makeList ~sep:(Sep " ") [self#longident_loc li; atom "as"; atom aliasIdent]
        | _ ->
            label ~space:true (makeList [self#longident_loc li; atom ":"]) (self#pattern p)
    in
    let rows = (List.map longident_x_pattern l)@(
      match closed with
        | Closed -> []
        | _ -> [atom "_"]
    ) in
    let (left, right) = wrap in
    let wrap = (left ^ "{", "}" ^ right) in
    makeList
      ~wrap
      ~break:IfNeed
      ~sep:commaTrail
      ~postSpace:true
      rows

  method patternFunction ?extension loc l =
    let estimatedFunLocation = {
        loc_start = loc.loc_start;
        loc_end = {loc.loc_start with pos_cnum = loc.loc_start.Lexing.pos_cnum + 3};
        loc_ghost = false;
    } in
    makeList
      ~postSpace:true
      ~break:IfNeed
      ~inline:(true, true)
      ~pad:(false, false)
      ((atom ~loc:estimatedFunLocation (add_extension_sugar funToken extension)) :: (self#case_list l))

  method parenthesized_expr ?break expr =
    let result = self#unparseExpr expr in
    match expr.pexp_attributes, expr.pexp_desc with
    | [], (Pexp_tuple _ | Pexp_construct ({txt=Lident "()"}, None)) -> result
    | _ -> makeList ~wrap:("(",")") ?break [self#unparseExpr expr]

  (* Expressions requiring parens, in most contexts such as separated by infix *)
  method expression_requiring_parens_in_infix x =
    let {stdAttrs} = partitionAttributes x.pexp_attributes in
    assert (stdAttrs == []);
    (* keep the incoming expression around, an expr with
     * immediate extension sugar might contain less than perfect location
     * info in its children (used for comment interleaving), the expression passed to
     * 'expression_requiring_parens_in_infix' contains the correct location *)
    let originalExpr = x in
    let extension, x = expression_immediate_extension_sugar x in
    match x.pexp_desc with
      (* The only reason Pexp_fun must also be wrapped in parens when under
         pipe, is that its => token will be confused with the match token.
         Simple expression will also invoke `#reset`. *)
      | Pexp_function _ when pipe || semi -> None (* Would be rendered as simplest_expression  *)
      (* Pexp_function, on the other hand, doesn't need wrapping in parens in
         most cases anymore, since `fun` is not ambiguous anymore (we print Pexp_fun
         as ES6 functions). *)
      | Pexp_function l ->
        let prec = Custom funToken in
        let expr = self#patternFunction ?extension x.pexp_loc l in
        Some (SpecificInfixPrecedence
                ({reducePrecedence=prec; shiftPrecedence=prec}, LayoutNode expr))
      | _ ->
        (* The Pexp_function cases above don't use location because comment printing
          breaks for them. *)
        let itm = match x.pexp_desc with
          | Pexp_fun _
          | Pexp_newtype _ ->
            (* let uncurried =  *)
            let (args, ret) = self#curriedPatternsAndReturnVal x in
            (match args with
              | [] -> raise (NotPossible ("no arrow args in unparse "))
              | firstArg::tl ->
                (* Suboptimal printing of parens:

                      something >>= fun x => x + 1;

                   Will be printed as:

                      something >>= (fun x => x + 1);

                   Because the arrow has lower precedence than >>=, but it wasn't
                   needed because

                      (something >>= fun x) => x + 1;

                   Is not a valid parse. Parens around the `=>` weren't needed to
                   prevent reducing instead of shifting. To optimize this part, we need
                   a much deeper encoding of the parse rules to print parens only when
                   needed, testing which rules will be reduced. It really should be
                   integrated deeply with Menhir.

                   One question is, if it's this difficult to describe when parens are
                   needed, should we even print them with the minimum amount?  We can
                   instead model everything as "infix" with ranked precedences.  *)
                let retValUnparsed = self#unparseExprApplicationItems ret in
                Some (self#wrapCurriedFunctionBinding
                        ~sweet:(extension = None)
                        (add_extension_sugar funToken extension)
                        ~arrow:"=>" firstArg tl retValUnparsed)
            )
          | Pexp_try (e, l) ->
            let estimatedBracePoint = {
              loc_start = e.pexp_loc.loc_end;
              loc_end = x.pexp_loc.loc_end;
              loc_ghost = false;
            }
            in
            let cases = (self#case_list ~allowUnguardedSequenceBodies:true l) in
            let switchWith = self#dont_preserve_braces#formatSingleArgLabelApplication
              (atom (add_extension_sugar "try" extension))
              e
            in
            Some (
              label
                ~space:true
                switchWith
                (source_map ~loc:estimatedBracePoint
                   (makeList ~indent:settings.trySwitchIndent ~wrap:("{", "}")
                      ~break:Always_rec ~postSpace:true cases))
            )
          (* These should have already been handled and we should never havgotten this far. *)
          | Pexp_setinstvar _ -> raise (Invalid_argument "Cannot handle setinstvar here - call unparseExpr")
          | Pexp_setfield (_, _, _) -> raise (Invalid_argument "Cannot handle setfield here - call unparseExpr")
          | Pexp_apply _ -> raise (Invalid_argument "Cannot handle apply here - call unparseExpr")
          | Pexp_match (e, l) ->
             let estimatedBracePoint = {
               loc_start = e.pexp_loc.loc_end;
               (* See originalExpr binding, for more info.
                * It contains the correct location under immediate extension sugar *)
               loc_end = originalExpr.pexp_loc.loc_end;
               loc_ghost = false;
             }
             in
             let cases = (self#case_list ~allowUnguardedSequenceBodies:true l) in
             let switchWith =
               label ~space:true (atom (add_extension_sugar "switch" extension))
                 (self#parenthesized_expr ~break:IfNeed e)
             in
             let lbl =
               label
                 ~space:true
                 switchWith
                 (source_map ~loc:estimatedBracePoint
                    (makeList ~indent:settings.trySwitchIndent ~wrap:("{", "}")
                       ~break:Always_rec ~postSpace:true cases))
             in
             Some lbl
          | Pexp_ifthenelse (e1, e2, eo) ->
            let (blocks, finalExpression) = sequentialIfBlocks eo in
            let rec singleExpression exp =
              match exp.pexp_desc with
              | Pexp_ident _ -> true
              | Pexp_constant _ -> true
              | Pexp_construct (_, arg) ->
                (match arg with
                | None -> true
                | Some x -> singleExpression x)
              | _ -> false
            in
            let singleLineIf =
              (singleExpression e1) &&
              (singleExpression e2) &&
              (match eo with
               | Some expr -> singleExpression expr
               | None -> true
              )
            in
            let makeLetSequence =
              if singleLineIf then
                makeLetSequenceSingleLine
              else
                makeLetSequence
            in
            let rec sequence soFar remaining = (
              match (remaining, finalExpression) with
                | ([], None) -> soFar
                | ([], Some e) ->
                  let soFarWithElseAppended = makeList ~postSpace:true [soFar; atom "else"] in
                  label ~space:true soFarWithElseAppended
                    (source_map ~loc:e.pexp_loc (makeLetSequence (self#letList e)))
                | (hd::tl, _) ->
                  let (e1, e2) = hd in
                  let soFarWithElseIfAppended =
                    label
                      ~space:true
                      (makeList ~postSpace:true [soFar; atom "else if"])
                      (makeList ~wrap:("(",")") [self#unparseExpr e1])
                  in
                  let nextSoFar =
                    label ~space:true soFarWithElseIfAppended
                      (source_map ~loc:e2.pexp_loc (makeLetSequence (self#letList e2)))
                  in
                  sequence nextSoFar tl
            ) in
            let init =
              let if_ = atom (add_extension_sugar "if" extension) in
              let cond = self#parenthesized_expr e1 in
              label ~space:true
                (source_map ~loc:e1.pexp_loc (label ~space:true if_ cond))
                (source_map ~loc:e2.pexp_loc (makeLetSequence (self#letList e2)))
            in
            Some (sequence init blocks)
          | Pexp_while (e1, e2) ->
            let lbl =
              let while_ = atom (add_extension_sugar "while" extension) in
              let cond = self#parenthesized_expr e1 in
              label ~space:true
                (label ~space:true while_ cond)
                (source_map ~loc:e2.pexp_loc (makeLetSequence (self#letList e2)))
            in
            Some lbl
          | Pexp_for (s, e1, e2, df, e3) ->
            (*
             *  for longIdentifier in
             *      (longInit expr) to
             *      (longEnd expr) {
             *    print_int longIdentifier;
             *  };
             *)
            let identifierIn = (makeList ~postSpace:true [self#pattern s; atom "in";]) in
            let dockedToFor = makeList
                ~break:IfNeed
                ~postSpace:true
                ~inline:(true, true)
                ~wrap:("(",")")
                [
                  identifierIn;
                  makeList ~postSpace:true [self#unparseExpr e1; self#direction_flag df];
                  (self#unparseExpr e2);
                ]
            in
            let upToBody = makeList ~inline:(true, true) ~postSpace:true
                [atom (add_extension_sugar "for" extension); dockedToFor]
            in
            Some (label ~space:true upToBody
                    (source_map ~loc:e3.pexp_loc (makeLetSequence (self#letList e3))))
          | Pexp_new li ->
            Some (label ~space:true (atom "new") (self#longident_class_or_type_loc li))
          | Pexp_assert e ->
            Some (
              label
                (atom "assert")
                (makeTup [(self#unparseExpr e)]);
            )
          | Pexp_lazy e ->
            Some (self#formatSingleArgLabelApplication (atom "lazy") e)
          | Pexp_poly _ ->
            failwith (
              "This version of the pretty printer assumes it is impossible to " ^
              "construct a Pexp_poly outside of a method definition - yet it sees one."
            )
          | _ -> None
        in
        match itm with
          | None -> None
          | Some i -> Some (PotentiallyLowPrecedence (source_map ~loc:x.pexp_loc i))

  method potentiallyConstrainedExpr x =
    match x.pexp_desc with
      | Pexp_constraint (e, ct) ->
          formatTypeConstraint (self#unparseExpr e) (self#core_type ct)
      | _ -> self#unparseExpr x


  (*
   * Because the rule BANG simple_expr was given %prec below_DOT_AND_SHARP,
   * !x.y.z will parse as !(x.y.z) and not (!x).y.z.
   *
   *     !x.y.z == !((x.y).z)
   *     !x#y#z == !((x#y)#z)
   *
   * So the intuition is: In general, any simple expression can exist to the
   * left of a `.`, except `BANG simple_expr`, which has special precedence,
   * and must be guarded in this one case.
   *
   * TODO: Instead of special casing this here, we should continue to extend
   * unparseExpr to also unparse simple expressions, (by encoding the
   * rules precedence below_DOT_AND_SHARP).
   *
   * TODO:
   *  Some would even have the prefix application be parsed with lower
   *  precedence function *application*. In the case of !, where ! means not,
   *  it makes a lot of sense because (!identifier)(arg) would be meaningless.
   *
   *  !callTheFunction(1, 2, 3)(andEvenCurriedArgs)
   *
   * Only problem is that it could then not appear anywhere simple expressions
   * would appear.
   *
   * We could make a special case for ! followed by one simple expression, and
   * consider the result simple.
   *
   * Alternatively, we can figure out a way to not require simple expressions
   * in the most common locations such as if/while tests. This is really hard
   * (impossible w/ grammars Menhir supports?)
   *
   * if ! myFunc argOne argTwo {
   *
   * } else {
   *
   * };
   *
   *)
  method simple_enough_to_be_lhs_dot_send x =
    match x.pexp_desc with
    | (Pexp_apply (eFun, _)) -> (
        match printedStringAndFixityExpr eFun with
        | AlmostSimplePrefix _
        | UnaryPlusPrefix _
        | UnaryMinusPrefix _
        | UnaryNotPrefix _
        | UnaryPostfix _
        | Infix _ -> self#simplifyUnparseExpr x
        | Normal ->
          if x.pexp_attributes == [] then
            (* `let a = foo().bar` instead of `let a = (foo()).bar *)
            (* same for foo()##bar, foo()#=bar, etc. *)
            self#unparseExpr x
          else
            self#simplifyUnparseExpr x
      )
    | _ -> self#simplifyUnparseExpr x

  method unparseRecord
    ?wrap:((lwrap, rwrap)=("", ""))
    ?withStringKeys:(withStringKeys=false)
    ?allowPunning:(allowPunning=true)
    ?forceBreak:(forceBreak=false)
    l eo =
    (* forceBreak is a ref which can be set to always break the record rows.
     * Example, when we have a row which contains a nested record,
     * this ref can be set to true from inside the printing of that row,
     * which forces breaks for the outer record structure. *)
    let forceBreak = ref forceBreak in
    let quote = (atom "\"") in
    let maybeQuoteFirstElem fst rest =
        if withStringKeys then (match fst.txt with
          | Lident s -> quote::(atom s)::quote::rest
          | Ldot _  | Lapply _ -> assert false
          )
        else
          (self#longident_loc fst)::rest
    in
    let makeRow (li, e) shouldPun =
      let totalRowLoc = {
        loc_start = li.Asttypes.loc.loc_start;
        loc_end = e.pexp_loc.loc_end;
        loc_ghost = false;
      } in
      let theRow = match (e.pexp_desc, shouldPun, allowPunning) with
        (* record value punning. Turns {foo: foo, bar: 1} into {foo, bar: 1} *)
        (* also turns {Foo.bar: bar, baz: 1} into {Foo.bar, baz: 1} *)
        (* don't turn {bar: Foo.bar, baz: 1} into {bar, baz: 1}, naturally *)
        | (Pexp_ident {txt = Lident value}, true, true) when Longident.last li.txt = value ->
          makeList (maybeQuoteFirstElem li [])

          (* Force breaks for nested records or bs obj sugar
           * Example:
           *  let person = {name: {first: "Bob", last: "Zhmith"}, age: 32};
           * is a lot less readable than
           *  let person = {
           *   "name": {
           *     "first": "Bob",
           *     "last": "Zhmith"
           *   },
           *  "age": 32
           *  };
           *)
        | (Pexp_record (recordRows, optionalGadt), _, _) ->
            forceBreak := true;
            let keyWithColon = makeList (maybeQuoteFirstElem li [atom ":"]) in
            let value = self#unparseRecord ~forceBreak: true recordRows optionalGadt in
            label ~space:true keyWithColon value
        | (Pexp_extension (s, p), _, _) when s.txt = "bs.obj" ->
            forceBreak := true;
            let keyWithColon = makeList (maybeQuoteFirstElem li [atom ":"]) in
            let value = self#formatBsObjExtensionSugar ~forceBreak:true p in
            label ~space:true keyWithColon value
        | (Pexp_object classStructure, _, _) ->
            forceBreak := true;
            let keyWithColon = makeList (maybeQuoteFirstElem li [atom ":"]) in
            let value = self#classStructure ~forceBreak:true classStructure in
            label ~space:true keyWithColon value
        | _ ->
          let (argsList, return) = self#curriedPatternsAndReturnVal e in
          match argsList with
          | [] ->
            let appTerms = self#unparseExprApplicationItems e in
            let upToColon = makeList (maybeQuoteFirstElem li [atom ":"]) in
            formatAttachmentApplication applicationFinalWrapping (Some (true, upToColon)) appTerms
          | firstArg :: tl ->
            let upToColon = makeList (maybeQuoteFirstElem li [atom ":"]) in
            let returnedAppTerms = self#unparseExprApplicationItems return in
            self#wrapCurriedFunctionBinding
              ~sweet:true ~attachTo:upToColon funToken ~arrow:"=>"
              firstArg tl returnedAppTerms
      in (source_map ~loc:totalRowLoc theRow, totalRowLoc)
    in
    let rec getRows l =
      match l with
        | [] -> []
        | hd::[] -> [makeRow hd true]
        | hd::hd2::tl -> (makeRow hd true)::(getRows (hd2::tl))
    in

    let allRows = match eo with
      | None -> (
        match l with
          (* No punning (or comma) for records with only a single field. It's ambiguous with an expression in a scope *)
          (* See comment in parser.mly for lbl_expr_list_with_at_least_one_non_punned_field *)
          | [hd] -> [makeRow hd false]
          | _ -> getRows l
        )
      (* This case represents a "spread" being present -> {...x, a: 1, b: 2} *)
      | Some withRecord ->
        let firstRow =
          let row = (
            (* Unclear why "sugar_expr" was special cased hre. *)
            let appTerms = self#unparseExprApplicationItems withRecord in
            formatAttachmentApplication applicationFinalWrapping (Some (false, (atom "..."))) appTerms
          )
          in (
            source_map ~loc:withRecord.pexp_loc row,
            withRecord.pexp_loc
          )
        in
        firstRow::(getRows l)
    in
    makeList
      ~wrap:(lwrap ^ "{" ,"}" ^ rwrap)
      ~break:(if !forceBreak then Layout.Always else Layout.IfNeed)
      ~sep:commaTrail
      ~postSpace:true
      (groupAndPrint ~xf:fst ~getLoc:snd ~comments:self#comments allRows)

  method isSeriesOfOpensFollowedByNonSequencyExpression expr =
    match (expr.pexp_attributes, expr.pexp_desc) with
        | ([], Pexp_let _) -> false
        | ([], Pexp_sequence _) -> false
        | ([], Pexp_letmodule _) -> false
        | ([], Pexp_open (ovf, _, e)) ->
          ovf == Fresh && self#isSeriesOfOpensFollowedByNonSequencyExpression e
        | ([], Pexp_letexception _) -> false
        | ([], Pexp_extension ({txt}, _)) -> txt = "bs.obj"
        | _ -> true

  method unparseObject ?wrap:((lwrap,rwrap)=("", "")) ?(withStringKeys=false) l o =
    let core_field_type (s, attrs, ct) =
      let l = extractStdAttrs attrs in
      let row =
         let rowKey = if withStringKeys then
            (makeList ~wrap:("\"", "\"") [atom s])
          else (atom s)
          in
          label ~space:true
                (makeList ~break:Layout.Never [rowKey; (atom ":")])
                (self#core_type ct)
      in
      (match l with
       | [] -> row
       | _::_ ->
         makeList
           ~postSpace:true
           ~break:IfNeed
           ~inline:(true, true)
           (List.concat [self#attributes attrs; [row]]))
    in
    let rows = List.map core_field_type l in
    let openness = match o with
      | Closed -> atom "."
      | Open -> atom ".."
    in
    (* if an object has more than 2 rows, always break for readability *)
    let rows_layout = makeList
        ~inline:(true, true) ~postSpace:true ~sep:commaTrail rows
        ~break:(if List.length rows >= 2
                then Layout.Always_rec
                else Layout.IfNeed)
    in
    makeList
      ~break:Layout.IfNeed
      ~preSpace:(rows != [])
      ~wrap:(lwrap ^ "{", "}" ^ rwrap)
      (openness::[rows_layout])

  method unparseSequence ?wrap:(wrap=("", "")) ~construct l =
    match construct with
    | `ES6List ->
      let seq, ext = (match List.rev l with
        | ext :: seq_rev -> (List.rev seq_rev, ext)
        | [] -> assert false) in
      makeES6List ~wrap (List.map self#unparseExpr seq) (self#unparseExpr ext)
    | _ ->
      let (left, right) = wrap in
      let (xf, (leftDelim, rightDelim)) = (match construct with
        | `List -> (self#unparseExpr, ("[", "]"))
        | `Array -> (self#unparseExpr, ("[|", "|]"))
        | `Tuple -> (self#potentiallyConstrainedExpr, ("(", ")"))
        | `ES6List -> assert false)
      in
      let wrap = (left ^ leftDelim, rightDelim ^ right) in
      makeList
        ~wrap
        ~sep:commaTrail
        ~break:IfNeed
        ~postSpace:true
        (List.map xf l)


  method formatBsObjExtensionSugar ?wrap:(wrap=("", "")) ?(forceBreak=false) payload =
    match payload with
    | PStr [itm] -> (
      match itm with
      | {pstr_desc = Pstr_eval ({ pexp_desc = Pexp_record (l, eo) }, []) } ->
        self#unparseRecord ~forceBreak ~wrap ~withStringKeys:true ~allowPunning:false l eo
      | {pstr_desc = Pstr_eval ({ pexp_desc = Pexp_extension ({txt = "bs.obj"}, payload) }, []) } ->
        (* some folks write `[%bs.obj [%bs.obj {foo: bar}]]`. This looks improbable but
          it happens often if you use the sugared version: `[%bs.obj {"foo": bar}]`.
          We're gonna be lenient here and treat it as if they wanted to just write
          `{"foo": bar}`. BuckleScript does the same relaxation when parsing bs.obj
        *)
        self#formatBsObjExtensionSugar ~wrap ~forceBreak payload
      | _ -> raise (Invalid_argument "bs.obj only accepts a record. You've passed something else"))
    | _ -> assert false

  method should_preserve_requested_braces expr =
    let {stylisticAttrs} = partitionAttributes expr.pexp_attributes in
    match expr.pexp_desc with
    | Pexp_ifthenelse _
    | Pexp_try _ -> false
    | Pexp_sequence _ ->
      (* `let ... in` should _always_ preserve braces *)
      true
    | _ ->
        preserve_braces &&
        Reason_attributes.has_preserve_braces_attrs stylisticAttrs

  method simplest_expression x =
    let {stdAttrs; jsxAttrs} = partitionAttributes x.pexp_attributes in
    if stdAttrs != [] then
      None
    else if self#should_preserve_requested_braces x then
      let layout =
        makeList
          ~break:(if inline_braces then Always else Always_rec)
          ~inline:(true, inline_braces)
          ~wrap:("{", "}")
          ~postSpace:true
          ~sep:(if inline_braces then (Sep ";") else (SepFinal (";", ";")))
          (self#letList x)
      in
      Some layout
    else
      let item =
        match x.pexp_desc with
        (* The only reason Pexp_fun must also be wrapped in parens is that its =>
           token will be confused with the match token. *)
        | Pexp_fun _ when pipe || semi -> Some (self#reset#simplifyUnparseExpr x)
        | Pexp_function l when pipe || semi -> Some (formatPrecedence ~loc:x.pexp_loc (self#reset#patternFunction x.pexp_loc l))
        | Pexp_apply _ -> (
          match self#simple_get_application x with
          (* If it's the simple form of application. *)
          | Some simpleGet -> Some simpleGet
          | None -> None
        )
        | Pexp_object cs -> Some (self#classStructure cs)
        | Pexp_override l -> (* FIXME *)
          let string_x_expression (s, e) =
            label ~space:true (atom (s.txt ^ ":")) (self#unparseExpr e)
          in
          Some (
            makeList
              ~postSpace:true
              ~wrap:("{<", ">}")
              ~sep:(Sep ",")
              (List.map string_x_expression l)
          )
        | Pexp_construct _  when is_simple_construct (view_expr x) ->
            let hasJsxAttribute = jsxAttrs != [] in
            Some (
              match view_expr x with
              | `nil -> if hasJsxAttribute then atom "<> </>" else atom "[]"
              | `tuple -> atom "()"
              | `list xs -> (* LIST EXPRESSION *)
                if hasJsxAttribute then
                  let actualChildren =
                    match self#formatChildren xs [] with
                    | None -> []
                    | Some ch -> ch
                  in
                    makeList
                      ~break:IfNeed
                      ~inline:(false, false)
                      ~postSpace:true
                      ~wrap:("<>", "</>")
                      ~pad:(true, true)
                      actualChildren
                else
                  self#unparseSequence ~construct:`List xs
              | `cons xs ->
                  self#unparseSequence ~construct:`ES6List xs
              | `simple x -> self#longident x
              | _ -> assert false
            )
        | Pexp_ident li ->
            (* Lone identifiers shouldn't break when to the right of a label *)
            Some (ensureSingleTokenSticksToLabel (self#longident_loc li))
        | Pexp_constant c ->
            (* Constants shouldn't break when to the right of a label *)
          let raw_literal, _ = extract_raw_literal x.pexp_attributes in
            Some (ensureSingleTokenSticksToLabel
                    (self#constant ?raw_literal c))
        | Pexp_pack me ->
          Some (
            makeList
              ~break:IfNeed
              ~postSpace:true
              ~wrap:("(", ")")
              ~inline:(true, true)
              [atom "module"; self#module_expr me;]
          )
        | Pexp_tuple l ->
            (* TODO: These may be simple, non-simple, or type constrained
               non-simple expressions *)
          Some (self#unparseSequence ~construct:`Tuple l)
        | Pexp_constraint (e, ct) ->
          Some (
            makeList
              ~break:IfNeed
              ~wrap:("(", ")")
              [formatTypeConstraint (self#unparseExpr e) (self#core_type ct)]
          )
        | Pexp_coerce (e, cto1, ct) ->
            let optFormattedType = match cto1 with
              | None -> None
              | Some typ -> Some (self#core_type typ) in
            Some (
              makeList
                ~break:IfNeed
                ~wrap:("(", ")")
                [formatCoerce (self#unparseExpr e) optFormattedType (self#core_type ct)]
            )
        | Pexp_variant (l, None) ->
            Some (ensureSingleTokenSticksToLabel (atom ("`" ^ l)))
        | Pexp_record (l, eo) -> Some (self#unparseRecord l eo)
        | Pexp_array l ->
          Some (self#unparseSequence ~construct:`Array l)
        | Pexp_let _ | Pexp_sequence _
        | Pexp_letmodule _ | Pexp_letexception _ ->
          Some (makeLetSequence (self#letList x))
        | Pexp_extension e ->
          begin match expression_immediate_extension_sugar x with
            | (Some _, _) -> None
            | (None, _) ->
              match expression_extension_sugar x with
              | None -> Some (self#extension e)
              | Some (_, x') ->
                match x'.pexp_desc with
                | Pexp_let _ ->
                  Some (makeLetSequence (self#letList x))
                | _ -> Some (self#extension e)
          end
        | Pexp_open (_, lid, e) ->
            if self#isSeriesOfOpensFollowedByNonSequencyExpression x then
              Some (label (label (self#longident_loc lid) (atom (".")))
                          (self#formatNonSequencyExpression e))
          else
            Some (makeLetSequence (self#letList x))
        | Pexp_send (e, s) ->
          let needparens = match e.pexp_desc with
            | Pexp_apply (ee, _) ->
              (match printedStringAndFixityExpr ee with
               | UnaryPostfix "^" -> true
               | _ -> false)
            | _ -> false
          in
          let lhs = self#simple_enough_to_be_lhs_dot_send e in
          let lhs = if needparens then makeList ~wrap:("(",")") [lhs] else lhs in
          Some (label (makeList [lhs; atom "#";]) (atom s))
        | _ -> None
      in
      match item with
      | None -> None
      | Some i -> Some (source_map ~loc:x.pexp_loc i)

  method formatChildren children processedRev =
    match children with
    | {pexp_desc = Pexp_constant constant} as x :: remaining ->
      let raw_literal, _ = extract_raw_literal x.pexp_attributes in
      self#formatChildren remaining (self#constant ?raw_literal constant :: processedRev)
    | {pexp_desc = Pexp_construct ({txt = Lident "::"}, Some {pexp_desc = Pexp_tuple children} )} as x :: remaining ->
      let {jsxAttrs} = partitionAttributes x.pexp_attributes in
      if jsxAttrs != [] then
        match self#simplest_expression x with
        | Some r -> self#formatChildren remaining (r :: processedRev)
        | None -> self#formatChildren (remaining @ children) processedRev
      else
        self#formatChildren (remaining @ children) processedRev
    | ({pexp_desc = Pexp_apply _} as e) :: remaining ->
        let child =
        (* Pipe first behaves differently according to the expression on the
         * right. In example (1) below, it's a `SpecificInfixPrecedence`; in
         * (2), however, it's `Simple` and doesn't need to be wrapped in parens.
         *
         * (1). <div> {items->Belt.Array.map(ReasonReact.string)->ReasonReact.array} </div>;
         * (2). <Foo> (title === "" ? [1, 2, 3] : blocks)->Foo.toString </Foo>; *)
        if Reason_heuristics.isPipeFirst e &&
           not (Reason_heuristics.isPipeFirstWithNonSimpleJSXChild e)
        then
          self#formatPipeFirst e
        else
          self#inline_braces#simplifyUnparseExpr ~inline:true ~wrap:("{", "}") e
        in
        self#formatChildren remaining (child::processedRev)
    | {pexp_desc = Pexp_ident li} :: remaining ->
      self#formatChildren remaining (self#longident_loc li :: processedRev)
    | {pexp_desc = Pexp_construct ({txt = Lident "[]"}, None)} :: remaining -> self#formatChildren remaining processedRev
    | {pexp_desc = Pexp_match _ } as head :: remaining ->
        self#formatChildren
          remaining
          (self#inline_braces#simplifyUnparseExpr ~inline:true ~wrap:("{", "}") head :: processedRev)
    | head :: remaining ->
        self#formatChildren
          remaining
          (self#inline_braces#simplifyUnparseExpr ~inline:true ~wrap:("{", "}") head :: processedRev)
    | [] -> match processedRev with
        | [] -> None
        | _::_ -> Some (List.rev processedRev)

  method direction_flag = function
    | Upto -> atom "to"
    | Downto -> atom "downto"

  method payload ppxToken ppxId e =
    let wrap = ("[" ^ ppxToken ^ ppxId.txt, "]") in
    let wrap_prefix str (x,y) = (x^str, y) in
    let break = Layout.IfNeed in
    let pad = (true, false) in
    let postSpace = true in
    match e with
    | PStr [] -> atom ("[" ^ ppxToken  ^ ppxId.txt  ^ "]")
    | PStr [itm] -> makeList ~break ~wrap ~pad [self#structure_item itm]
    | PStr (_::_ as items) ->
      let rows = List.map self#structure_item items in
      makeList ~wrap ~break ~pad ~postSpace ~sep:(Layout.Sep ";") rows
    | PTyp x ->
      let wrap = wrap_prefix ":" wrap in
      makeList ~wrap ~break ~pad [self#core_type x]
    (* Signatures in attributes were added recently *)
    | PSig [] -> atom ("[" ^ ppxToken ^ ppxId.txt ^":]")
    | PSig [x] ->
      let wrap = wrap_prefix ":" wrap in
      makeList ~break ~wrap ~pad [self#signature_item x]
    | PSig items ->
      let wrap = wrap_prefix ":" wrap in
      let rows = List.map self#signature_item items in
      makeList ~wrap ~break ~pad ~postSpace ~sep:(Layout.Sep ";") rows
    | PPat (x, None) ->
      let wrap = wrap_prefix "?" wrap in
      makeList ~wrap ~break ~pad [self#pattern x]
    | PPat (x, Some e) ->
      let wrap = wrap_prefix "?" wrap in
      makeList ~wrap ~break ~pad ~postSpace [
        self#pattern x;
        label ~space:true (atom "when") (self#unparseExpr e)
      ]

  method extension (s, p) =
    match s.txt with
    (* We special case "bs.obj" for now to allow for a nicer interop with
     * BuckleScript. We might be able to generalize to any kind of record
     * looking thing with struct keys. *)
    | "bs.obj" -> self#formatBsObjExtensionSugar p
    | _ -> (self#payload "%" s p)

  method item_extension (s, e) = (self#payload "%%" s e)


  (* [@ ...] Simple attributes *)
  method attribute = function
    | { Location. txt = ("ocaml.doc" | "ocaml.text") },
      PStr [{ pstr_desc = Pstr_eval ({ pexp_desc = Pexp_constant (Pconst_string(text, None)) } , _);
              pstr_loc }] ->
      let text = if text = "" then "/**/" else "/**" ^ text ^ "*/" in
      makeList ~inline:(true, true) ~postSpace:true ~preSpace:true ~indent:0 ~break:IfNeed [atom ~loc:pstr_loc text]
    | (s, e) -> self#payload "@" s e

  (* [@@ ... ] Attributes that occur after a major item in a structure/class *)
  method item_attribute = self#attribute

  (* [@@ ...] Attributes that occur not *after* an item in some structure/class/sig, but
     rather as their own standalone item. Note that syntactic distinction
     between item_attribute and floating_attribute is no longer necessary with
     Reason. Thank you semicolons. *)
  method floating_attribute = self#item_attribute

  method attributes l = List.map self#attribute l

  method attach_std_attrs l toThis =
    let l = extractStdAttrs l in
    match l with
      | [] -> toThis
      | _::_ -> makeList ~postSpace:true (List.concat [self#attributes l; [toThis]])

  method attach_std_item_attrs ?(allowUncurry=true) ?extension l toThis =
    let l = (partitionAttributes ~allowUncurry l).stdAttrs in
    match extension, l with
    | None, [] -> toThis
    | _, _ ->
      let extension = match extension with
        | None -> []
        | Some id -> [atom ("%" ^ id.txt)]
      in
      makeList
        ~postSpace:true ~indent:0 ~break:Layout.Always_rec ~inline:(true, true)
        (extension @ List.map self#item_attribute l @ [toThis])

  method exception_declaration ed =
    let pcd_name = ed.pext_name in
    let pcd_loc = ed.pext_loc in
    let pcd_attributes = [] in
    let exn_arg = match ed.pext_kind with
      | Pext_decl (args, type_opt) ->
          let pcd_args, pcd_res = args, type_opt in
          [self#type_variant_leaf_nobar {pcd_name; pcd_args; pcd_res; pcd_loc; pcd_attributes}]
      | Pext_rebind id ->
          [atom pcd_name.txt; atom "="; (self#longident_loc id)] in
    let {stdAttrs; docAttrs} =
      partitionAttributes ~partDoc:true ed.pext_attributes
    in
    let layout =
      self#attach_std_item_attrs
        stdAttrs
        (label ~space:true
          (atom "exception")
          (makeList ~postSpace:true ~inline:(true, true) exn_arg))
    in
    self#attachDocAttrsToLayout
      ~stdAttrs
      ~docAttrs
      ~loc:ed.pext_loc
      ~layout
      ()

  (*
    Note: that override doesn't appear in class_sig_field, but does occur in
    class/object expressions.
    TODO: TODOATTRIBUTES
   *)
  method method_sig_flags_for s = function
    | Virtual -> [atom "virtual"; atom s]
    | Concrete ->  [atom s]

  method value_type_flags_for s = function
    | (Virtual, Mutable) -> [atom "virtual"; atom "mutable"; atom s]
    | (Virtual, Immutable) -> [atom "virtual"; atom s]
    | (Concrete, Mutable) -> [atom "mutable"; atom s]
    | (Concrete, Immutable) -> [atom s]

  method class_sig_field x =
    match x.pctf_desc with
    | Pctf_inherit ct ->
      label ~space:true (atom "inherit") (self#class_constructor_type ct)
    | Pctf_val (s, mf, vf, ct) ->
      let valueFlags = self#value_type_flags_for (s ^ ":") (vf, mf) in
      label
        ~space:true
        (
          label ~space:true
            (atom "val")
            (makeList ~postSpace:true ~inline:(false, true) ~break:IfNeed valueFlags)
        )
        (self#core_type ct)
    | Pctf_method (s, pf, vf, ct) ->
      let methodFlags = self#method_sig_flags_for (s ^ ":") vf
      in
      let pubOrPrivate =
        match pf with
        | Private -> "pri"
        | Public -> "pub"
      in
      let m = label
        ~space:true
        (label ~space:true
            (atom pubOrPrivate)
            (makeList ~postSpace:true ~inline:(false, true) ~break:IfNeed methodFlags)
        )
        (self#core_type ct)
      in
      (self#attach_std_item_attrs x.pctf_attributes m)
    | Pctf_constraint (ct1, ct2) ->
      label
        ~space:true
        (atom "constraint")
        (label ~space:true
            (makeList ~postSpace:true [self#core_type ct1; atom "="])
            (self#core_type ct2)
        )
    | Pctf_attribute a -> self#floating_attribute a
    | Pctf_extension e -> self#item_extension e

  (*
    /** doc comment */                                    (* formattedDocs *)
    [@bs.val] [@bs.module "react-dom"]                    (* formattedAttrs *)
    external render : reactElement => element => unit =   (* frstHalf *)
      "render";                                           (* sndHalf *)

    To improve the formatting with breaking & indentation:
      * consider the part before the '=' as a label
      * combine that label with '=' in a list
      * consider the part after the '=' as a list
      * combine both parts as a label
      * format the doc comment with a ~postSpace:true (inline, not inline) list
      * format the attributes with a ~postSpace:true (inline, inline) list
      * format everything together in a ~postSpace:true (inline, inline) list
        for nicer breaking
  *)
  method primitive_declaration vd =
    let lblBefore =
      label
        ~space:true
        (makeList
           [(makeList ~postSpace:true [atom "external"; protectIdentifier vd.pval_name.txt]); (atom ":")])
        (self#core_type vd.pval_type)
    in
    let primDecl =
      match vd.pval_prim with
      | [""] -> lblBefore
      | _ ->
        let frstHalf = makeList ~postSpace:true [lblBefore; atom "="] in
        let sndHalf = makeSpacedBreakableInlineList (List.map self#constant_string vd.pval_prim) in
        label ~space:true frstHalf sndHalf
    in
    match vd.pval_attributes with
    | [] -> primDecl
    | attrs ->
        let {stdAttrs; docAttrs} = partitionAttributes ~partDoc:true attrs in
        let docs = List.map self#item_attribute docAttrs in
        let formattedDocs = makeList ~postSpace:true docs in
        let attrs = List.map self#item_attribute stdAttrs in
        let formattedAttrs = makeSpacedBreakableInlineList attrs in
        let layouts = match (docAttrs, stdAttrs) with
        | ([], _) -> [formattedAttrs; primDecl]
        | (_, []) -> [formattedDocs; primDecl]
        | _ -> [formattedDocs; formattedAttrs; primDecl] in
        makeSpacedBreakableInlineList layouts

  method class_instance_type x =
    match x.pcty_desc with
    | Pcty_signature cs ->
      let {pcsig_self = ct; pcsig_fields = l} = cs in
      let instTypeFields = List.map self#class_sig_field l in
      let allItems = match ct.ptyp_desc with
        | Ptyp_any -> instTypeFields
        | _ ->
          label ~space:true (atom "as") (self#core_type ct) ::
          instTypeFields
      in
      self#attach_std_item_attrs ~allowUncurry:false x.pcty_attributes (
        makeList
          ~wrap:("{", "}")
          ~postSpace:true
          ~break:Layout.Always_rec
          (List.map semiTerminated allItems)
      )
    | Pcty_constr (li, l) ->
      self#attach_std_attrs x.pcty_attributes (
        match l with
        | [] -> self#longident_loc li
        | _::_ ->
          label
            (self#longident_loc li)
            (makeList ~wrap:("(", ")") ~sep:commaTrail (List.map self#core_type l))
      )
    | Pcty_extension e ->
      self#attach_std_item_attrs x.pcty_attributes (self#extension e)
    | Pcty_arrow _ -> failwith "class_instance_type should not be printed with Pcty_arrow"

  method class_declaration_list l =
    let class_declaration ?(class_keyword=false)
        ({pci_params=ls; pci_name={txt}; pci_virt; pci_loc} as x) =
      let (firstToken, pattern, patternAux) = self#class_opening class_keyword txt pci_virt ls in
      let classBinding = self#wrappedClassBinding firstToken pattern patternAux x.pci_expr in
      source_map ~loc:pci_loc
        (self#attach_std_item_attrs x.pci_attributes classBinding)
    in
    (match l with
      | [] -> raise (NotPossible "Class definitions will have at least one item.")
      | x::rest ->
        makeNonIndentedBreakingList (
          class_declaration ~class_keyword:true x ::
          List.map class_declaration rest
        )
    )
  (* For use with [class type a = class_instance_type]. Class type
     declarations/definitions declare the types of instances generated by class
     constructors.
     We have to call self#class_instance_type because self#class_constructor_type
     would add a "new" before the type.
     TODO: TODOATTRIBUTES:
  *)
  method class_type_declaration_list l =
    let class_type_declaration kwd ({pci_params=ls;pci_name;pci_attributes} as x) =
      let opener = match x.pci_virt with
        | Virtual -> kwd ^ " " ^ "virtual"
        | Concrete -> kwd
      in

      let upToName =
        if ls == [] then
          label ~space:true (atom opener) (atom pci_name.txt)
        else
          label
            ~space:true
            (label ~space:true (atom opener) (atom pci_name.txt))
            (self#class_params_def ls)
      in
      let includingEqual = makeList ~postSpace:true [upToName; atom "="] in
      let {stdAttrs; docAttrs} =
        partitionAttributes ~partDoc:true pci_attributes
      in
      let layout =
        self#attach_std_item_attrs stdAttrs @@
        label ~space:true includingEqual (self#class_instance_type x.pci_expr)
      in
      self#attachDocAttrsToLayout
        ~stdAttrs
        ~docAttrs
        ~loc:pci_name.loc
        ~layout
        ()
    in
    match l with
    | [] -> failwith "Should not call class_type_declaration with no classes"
    | [x] -> class_type_declaration "class type" x
    | x :: xs ->
      makeList
        ~break:Always_rec
        ~indent:0
        ~inline:(true, true)
        (
          (class_type_declaration "class type" x)::
          List.map (class_type_declaration "and") xs
        )

  (*
     Formerly the [class_type]
     Notice how class_constructor_type doesn't have any type attributes -
     class_instance_type does.
     TODO: Divide into class_constructor_types that allow arrows and ones
     that don't.
   *)
  method class_constructor_type x =
    match x.pcty_desc with
    | Pcty_arrow _ ->
      let rec allArrowSegments acc = function
        | { pcty_desc = Pcty_arrow (l, ct1, ct2); } ->
            allArrowSegments (self#type_with_label (l, ct1, false) :: acc) ct2
        (* This "new" is unfortunate. See reason_parser.mly for details. *)
        | xx -> (List.rev acc, self#class_constructor_type xx)
      in
      let (params, return) = allArrowSegments [] x in
      let normalized =
        makeList ~break:IfNeed
          ~sep:(Sep "=>")
          ~preSpace:true ~postSpace:true ~inline:(true, true)
        [makeCommaBreakableListSurround "(" ")" params; return]
      in
      source_map ~loc:x.pcty_loc normalized
    | _ ->
      (* Unfortunately, we have to have final components of a class_constructor_type
         be prefixed with the `new` keyword.  Hopefully this is temporary. *)
      self#class_instance_type x

  method non_arrowed_class_constructor_type x =
    match x.pcty_desc with
    | Pcty_arrow _ ->
      source_map ~loc:x.pcty_loc
        (formatPrecedence (self#class_constructor_type x))
    | _ -> self#class_instance_type x

  method class_field x =
    let itm =
      match x.pcf_desc with
      | Pcf_inherit (ovf, ce, so) ->
        let inheritText = ("inherit" ^ override ovf) in
        let inheritExp = self#class_expr ce in
        label
          ~space:true
          (atom inheritText)
          (
            match so with
            | None -> inheritExp;
            | Some s -> label ~space:true inheritExp (atom ("as " ^ s))
          )
      | Pcf_val (s, mf, Cfk_concrete (ovf, e)) ->
        let opening = match mf with
          | Mutable ->
            let mutableName = [atom "mutable"; atom s.txt] in
            label
              ~space:true
              (atom ("val" ^ override ovf))
              (makeList ~postSpace:true ~inline:(false, true) ~break:IfNeed mutableName)
          | Immutable -> label ~space:true (atom ("val" ^ override ovf)) (atom s.txt)
        in
        let valExprAndConstraint = match e.pexp_desc with
          | Pexp_constraint (ex, ct) ->
            let openingWithTypeConstraint = formatTypeConstraint opening (self#core_type ct) in
            label
              ~space:true
              (makeList ~postSpace:true [openingWithTypeConstraint; atom "="])
              (self#unparseExpr ex)
          | _ ->
            label ~space:true (makeList ~postSpace:true [opening; atom "="]) (self#unparseExpr e)
        in
        valExprAndConstraint
      | Pcf_val (s, mf, Cfk_virtual ct) ->
        let opening = match mf with
          | Mutable ->
            let mutableVirtualName = [atom "mutable"; atom "virtual"; atom s.txt] in
            let openingTokens =
              (makeList ~postSpace:true ~inline:(false, true) ~break:IfNeed mutableVirtualName) in
            label ~space:true (atom "val") openingTokens
          | Immutable ->
            let virtualName = [atom "virtual"; atom s.txt] in
            let openingTokens =
              (makeList ~postSpace:true ~inline:(false, true) ~break:IfNeed virtualName) in
            label ~space:true (atom "val") openingTokens
        in
        formatTypeConstraint opening (self#core_type ct)
      | Pcf_method (s, pf, Cfk_virtual ct) ->
        let opening = match pf with
          | Private ->
            let privateVirtualName = [atom "virtual"; atom s.txt] in
            let openingTokens =
              (makeList ~postSpace:true ~inline:(false, true) ~break:IfNeed privateVirtualName) in
            label ~space:true (atom "pri") openingTokens
          | Public ->
            let virtualName = [atom "virtual"; atom s.txt] in
            let openingTokens =
              (makeList ~postSpace:true ~inline:(false, true) ~break:IfNeed virtualName) in
            label ~space:true (atom "pub") openingTokens
        in
        formatTypeConstraint opening (self#core_type ct)
      | Pcf_method (s, pf, Cfk_concrete (ovf, e)) ->
        let methodText =
           let postFix = if ovf == Override then "!" else "" in
           (
           match pf with
           | Private -> "pri" ^ postFix
           | Public -> "pub" ^ postFix
           ) in
        (* Should refactor the binding logic so faking out the AST isn't needed,
           currently, it includes a ton of nuanced logic around recovering explicitly
           polymorphic type definitions, and that furthermore, that representation...
           Actually, let's do it.

           For some reason, concrete methods are only ever parsed as Pexp_poly.
           If there *is* no polymorphic function for the method, then the return
           value of the function is wrapped in a ghost Pexp_poly with [None] for
           the type vars.*)
        (match e.pexp_desc with
          | (Pexp_poly
              ({pexp_desc=Pexp_constraint (methodFunWithNewtypes, nonVarifiedExprType)},
                Some ({ptyp_desc=Ptyp_poly (typeVars, varifiedPolyType)})
              )
            ) when (
              let (leadingAbstractVars, _) =
                self#leadingCurriedAbstractTypes methodFunWithNewtypes in
              self#isRenderableAsPolymorphicAbstractTypes
                typeVars
                (* If even artificially varified. Don't know until this returns*)
                varifiedPolyType
                leadingAbstractVars
                nonVarifiedExprType
          ) ->
            let (leadingAbstractVars, _) =
              self#leadingCurriedAbstractTypes methodFunWithNewtypes in
            self#locallyAbstractPolymorphicFunctionBinding
              methodText
              (atom s.txt)
              methodFunWithNewtypes
              leadingAbstractVars
              nonVarifiedExprType
          | Pexp_poly (e, Some ct) ->
            self#formatSimplePatternBinding methodText (atom s.txt)
              (Some (source_map ~loc:ct.ptyp_loc (self#core_type ct)))
              (self#unparseExprApplicationItems e)
          (* This form means that there is no type constraint - it's a strange node name.*)
          | Pexp_poly (e, None) ->
            self#wrappedBinding methodText ~arrow:"=>" (atom s.txt) [] e
          | _ -> failwith "Concrete methods should only ever have Pexp_poly."
        )
      | Pcf_constraint (ct1, ct2) ->
        label
          ~space:true
          (atom "constraint")
          (
            makeList ~postSpace:true ~inline:(true, false) [
              makeList ~postSpace:true [self#core_type ct1; atom "="];
              self#core_type ct2
            ]
          )
      | Pcf_initializer e ->
        label
          ~space:true
          (atom "initializer")
          (self#simplifyUnparseExpr e)
      | Pcf_attribute a -> self#floating_attribute a
      | Pcf_extension e ->
        (* And don't forget, we still need to print post_item_attributes even for
           this case *)
        self#item_extension e
    in
    let layout = self#attach_std_attrs x.pcf_attributes itm in
    source_map ~loc:x.pcf_loc layout

  method class_self_pattern_and_structure {pcstr_self = p; pcstr_fields = l} =
    let fields = List.map self#class_field l in
    (* Recall that by default self is bound to "this" at parse time. You'd
       have to go out of your way to bind it to "_". *)
    match (p.ppat_attributes, p.ppat_desc) with
      | ([], Ppat_var ({txt = "this"})) -> fields
      | _ ->
        let field = label ~space:true (atom "as") (self#pattern p) in
        source_map ~loc:p.ppat_loc field :: fields

  method simple_class_expr x =
    let {stdAttrs} = partitionAttributes x.pcl_attributes in
    if stdAttrs != [] then
      formatSimpleAttributed
        (self#simple_class_expr {x with pcl_attributes=[]})
        (self#attributes stdAttrs)
    else
      let itm =
        match x.pcl_desc with
        | Pcl_constraint (ce, ct) ->
          formatTypeConstraint (self#class_expr ce) (self#class_constructor_type ct)
        (* In OCaml,
          - In the most recent version of OCaml, when in the top level of a
            module, let _ = ... is a PStr_eval.
          - When in a function, it is a Pexp_let PPat_any
          - When in class pre-member let bindings it is a Pcl_let PPat_any

           Reason normalizes all of these to be simple imperative expressions
           with trailing semicolons, *except* in the case of classes because it
           will likely introduce a conflict with some proposed syntaxes for
           objects.
        *)
        | Pcl_let _
        | Pcl_structure _ ->
          let rows = (self#classExprLetsAndRest x) in
          makeList ~wrap:("{", "}") ~inline:(true, false) ~postSpace:true ~break:Always_rec (List.map semiTerminated rows)
        | Pcl_extension e -> self#extension e
        | _ -> formatPrecedence (self#class_expr x)
     in source_map ~loc:x.pcl_loc itm

  method classExprLetsAndRest x =
    match x.pcl_desc with
      | Pcl_structure cs -> self#class_self_pattern_and_structure cs
      | Pcl_let (rf, l, ce) ->
        (* For "letList" bindings, the start/end isn't as simple as with
         * module value bindings. For "let lists", the sequences were formed
         * within braces {}. The parser relocates the first let binding to the
         * first brace. *)
        let binding =
          source_map ~loc:(self#bindingsLocationRange l)
            (self#bindings (rf, l))
        in
        (binding :: self#classExprLetsAndRest ce)
      | _ -> [self#class_expr x]

  method class_expr x =
    let {stdAttrs} = partitionAttributes x.pcl_attributes in
    (* We cannot handle the attributes here. Must handle them in each item *)
    if stdAttrs != [] then
      (* Do not need a "simple" attributes precedence wrapper. *)
      formatAttributed
        (self#simple_class_expr {x with pcl_attributes=[]})
        (self#attributes stdAttrs)
    else
      match x.pcl_desc with
      | Pcl_fun _ ->
        (match self#curriedConstructorPatternsAndReturnVal x with
         | None, _ ->
           (* x just matched Pcl_fun, there is at least one parameter *)
           assert false
         | Some args, e ->
           label ~space:true
             (makeList ~postSpace:true
                [label ~space:true (atom funToken) args; atom "=>"])
             (self#class_expr e))
      | Pcl_apply _ ->
        formatAttachmentApplication applicationFinalWrapping None
         (self#classExpressionToFormattedApplicationItems x, None)
      | Pcl_constr (li, []) ->
        label ~space:true (atom "class") (self#longident_loc li)
      | Pcl_constr (li, l) ->
        label
          (makeList ~postSpace:true [atom "class"; self#longident_loc li])
          (makeTup (List.map self#non_arrowed_non_simple_core_type l))
      | Pcl_constraint _
      | Pcl_extension _
      | Pcl_let _
      | Pcl_structure _ -> self#simple_class_expr x;

  method classStructure ?(forceBreak=false) ?(wrap=("", "")) cs =
    let (left, right) = wrap in
    makeList
      ~sep:(Layout.Sep ";")
      ~wrap:(left ^ "{", "}" ^ right)
      ~break:(if forceBreak then Layout.Always else Layout.IfNeed)
      ~postSpace:true
      ~inline:(true, false)
      (self#class_self_pattern_and_structure cs)

  method signature signatureItems =
    match signatureItems with
    | [] -> atom ""
    | first::_ as signatureItems ->
      let last = match (List.rev signatureItems) with | last::_ -> last | [] -> assert false in
      let loc_start = first.psig_loc.loc_start in
      let loc_end = last.psig_loc.loc_end in
      let items =
        groupAndPrint
          ~xf:self#signature_item
          ~getLoc:(fun x -> x.psig_loc)
          ~comments:self#comments
          signatureItems
      in
      source_map ~loc:{loc_start; loc_end; loc_ghost=false}
        (makeList
           ~postSpace:true
           ~break:Layout.Always_rec
           ~indent:0
           ~inline:(true, false)
           ~sep:(SepFinal (";", ";"))
           items)

  method signature_item x : Layout.t =
    let item: Layout.t =
      match x.psig_desc with
        | Psig_type (rf, l) ->
            self#type_def_list (rf, l)
        | Psig_value vd ->
            if vd.pval_prim != [] then
              self#primitive_declaration vd
            else
              let intro = atom "let" in
              let {stdAttrs; docAttrs} = partitionAttributes ~partDoc:true vd.pval_attributes in
              let layout = self#attach_std_item_attrs stdAttrs
                (formatTypeConstraint
                   (label ~space:true intro
                      (source_map ~loc:vd.pval_name.loc
                         (protectIdentifier vd.pval_name.txt)))
                  (self#core_type vd.pval_type))
              in
              self#attachDocAttrsToLayout
                ~stdAttrs
                ~docAttrs
                ~loc:vd.pval_loc
                ~layout
                ()

        | Psig_typext te ->
            self#type_extension te
        | Psig_exception ed ->
            self#exception_declaration ed
        | Psig_class l ->
            let class_description
                ?(class_keyword=false)
                ({pci_params=ls; pci_name={txt}; pci_loc} as x) =
              let (firstToken, pattern, patternAux) = self#class_opening class_keyword txt x.pci_virt ls in
              let withColon = self#wrapCurriedFunctionBinding
                ~arrow:":"
                ~spaceBeforeArrow:false
                firstToken
                pattern
                patternAux
                ([(self#class_constructor_type x.pci_expr)], None)
              in
              let {stdAttrs; docAttrs} = partitionAttributes ~partDoc:true x.pci_attributes in
              let layout = self#attach_std_item_attrs stdAttrs withColon in
              source_map ~loc:pci_loc
                (self#attachDocAttrsToLayout
                  ~stdAttrs
                  ~docAttrs
                  ~loc:x.pci_name.loc
                  ~layout
                  ())
            in
            makeNonIndentedBreakingList (
              match l with
              | [] -> raise (NotPossible "No recursive class bindings")
              | [x] -> [class_description ~class_keyword:true x]
              | x :: xs ->
                 (class_description ~class_keyword:true x)::
                 (List.map class_description xs)
            )
        | Psig_module {pmd_name; pmd_type={pmty_desc=Pmty_alias alias}; pmd_attributes} ->
            let {stdAttrs; docAttrs} =
              partitionAttributes ~partDoc:true pmd_attributes
            in
            let layout =
              self#attach_std_item_attrs stdAttrs @@
              label ~space:true
                (makeList ~postSpace:true [
                   atom "module";
                   atom pmd_name.txt;
                   atom "="
                 ])
                (self#longident_loc alias)
            in
            self#attachDocAttrsToLayout
              ~stdAttrs
              ~docAttrs
              ~loc:pmd_name.loc
              ~layout
              ()
        | Psig_module pmd ->
            let {stdAttrs; docAttrs} =
              partitionAttributes ~partDoc:true pmd.pmd_attributes
            in
            let letPattern =
              makeList
                [makeList ~postSpace:true [atom "module"; (atom pmd.pmd_name.txt)];
                 atom ":"]
            in
            let layout =
              self#attach_std_item_attrs stdAttrs @@
              (self#module_type letPattern pmd.pmd_type)
            in
            self#attachDocAttrsToLayout
              ~stdAttrs
              ~docAttrs
              ~loc:pmd.pmd_name.loc
              ~layout
              ()
        | Psig_open od ->
          let {stdAttrs; docAttrs} =
            partitionAttributes ~partDoc:true od.popen_attributes
          in
          let layout =
            self#attach_std_item_attrs stdAttrs @@
            label ~space:true
              (atom ("open" ^ (override od.popen_override)))
              (self#longident_loc od.popen_lid)
          in
          self#attachDocAttrsToLayout
            ~stdAttrs
            ~docAttrs
            ~loc:od.popen_lid.loc
            ~layout
            ()
        | Psig_include incl ->
          let {stdAttrs; docAttrs} =
            partitionAttributes ~partDoc:true incl.pincl_attributes
          in
          let layout =
            self#attach_std_item_attrs stdAttrs @@
            (self#module_type (atom "include") incl.pincl_mod)
          in
          self#attachDocAttrsToLayout
            ~stdAttrs
            ~docAttrs
            ~loc:incl.pincl_mod.pmty_loc
            ~layout
            ()
        | Psig_modtype x ->
          let name = atom x.pmtd_name.txt in
          let letPattern = makeList ~postSpace:true [atom "module type"; name; atom "="] in
          let main = match x.pmtd_type with
            | None -> makeList ~postSpace:true [atom "module type"; name]
            | Some mt -> self#module_type letPattern mt
          in
          let {stdAttrs; docAttrs} =
            partitionAttributes ~partDoc:true x.pmtd_attributes
          in
          let layout =
            self#attach_std_item_attrs stdAttrs main
          in
          self#attachDocAttrsToLayout
            ~stdAttrs
            ~docAttrs
            ~loc:x.pmtd_name.loc
            ~layout
            ()
        | Psig_class_type l -> self#class_type_declaration_list l
        | Psig_recmodule decls ->
            let items = List.mapi (fun i xx ->
              let {stdAttrs; docAttrs} =
                partitionAttributes ~partDoc:true xx.pmd_attributes
              in
              let letPattern =
                makeList [
                  makeList ~postSpace:true [
                    atom (if i == 0 then "module rec" else "and");
                    atom xx.pmd_name.txt
                  ];
                 atom ":"
                ]
              in
              let layout =
                self#attach_std_item_attrs stdAttrs
                  (self#module_type ~space:true letPattern xx.pmd_type)
              in
              let layoutWithDocAttrs =
                self#attachDocAttrsToLayout
                 ~stdAttrs
                 ~docAttrs
                 ~loc:xx.pmd_name.loc
                 ~layout
                 ()
              in
              (extractLocModDecl xx, layoutWithDocAttrs)
            ) decls
            in
            makeNonIndentedBreakingList
              (groupAndPrint
                ~xf:(fun (_, layout) -> layout)
                ~getLoc:(fun (loc, _) -> loc)
                ~comments:self#comments
                items)

        | Psig_attribute a -> self#floating_attribute a
        | Psig_extension (({loc}, _) as ext, attrs) ->
          let {stdAttrs; docAttrs} =
            partitionAttributes ~partDoc:true attrs
          in
          let layout =
            self#attach_std_item_attrs stdAttrs (self#item_extension ext)
          in
          self#attachDocAttrsToLayout
            ~stdAttrs
            ~docAttrs
            ~loc
            ~layout
            ()
    in
    source_map ~loc:x.psig_loc item

  method non_arrowed_module_type ?(space=true) letPattern x =
    match x.pmty_desc with
      | Pmty_alias li ->
        label ~space
          letPattern
          (formatPrecedence (label ~space:true (atom "module") (self#longident_loc li)))
      | Pmty_typeof me ->
        let labelWithoutFinalWrap =
          label ~space:true
            (label ~space:true
               letPattern
               (makeList
                  ~inline:(false, false)
                  ~wrap:("(","")
                  ~postSpace:true
                  [atom "module type of"]))
            (self#module_expr me)
        in
        makeList ~wrap:("",")") [labelWithoutFinalWrap]
      | _ -> self#simple_module_type ~space letPattern x

  method simple_module_type ?(space=true) letPattern x =
    match x.pmty_desc with
      | Pmty_ident li -> label ~space letPattern (self#longident_loc li)
      | Pmty_signature s ->
        let items =
          groupAndPrint
          ~xf:self#signature_item
          ~getLoc:(fun x -> x.psig_loc)
          ~comments:self#comments
          s
        in
        let shouldBreakLabel = if List.length s > 1 then `Always else `Auto in
        label
          ~indent:0
          ~break:shouldBreakLabel
          (makeList
            [label
               ~break:shouldBreakLabel
                (makeList
                  ~postSpace:true
                  [letPattern; (atom "{")])
              (source_map
                 ~loc:x.pmty_loc
                 (makeList
                    ~break:(if List.length s > 1 then Always else IfNeed)
                    ~inline:(true, true)
                    ~postSpace:true
                    ~sep:(SepFinal (";", ";"))
                    items))])
          (atom "}")
      | Pmty_extension (s, e) -> label ~space letPattern (self#payload "%" s e)
      | _ ->
        makeList ~break:IfNeed ~wrap:("", ")")
          [self#module_type ~space:false (makeList ~pad:(false,true) ~wrap:("","(") [letPattern]) x]

  method module_type ?(space=true) letPattern x =
    let pmty = match x.pmty_desc with
      | Pmty_functor _ ->
        (* The segments that should be separated by arrows. *)
        let rec extract_args args xx = match xx.pmty_desc with
          | Pmty_functor (_, None, mt2) -> extract_args (`Unit :: args) mt2
          | Pmty_functor (s, Some mt1, mt2) ->
            let arg =
              if s.txt = "_"
              then self#module_type ~space:false (atom "") mt1
              else self#module_type ~space (makeList [(atom s.txt); atom ":"]) mt1
            in
            extract_args (`Arg arg :: args) mt2
          | _ ->
            let prepare_arg = function
              | `Unit -> atom "()"
              | `Arg x -> x
            in
            let args = match args with
              | [`Unit] -> []
              | _ -> List.rev_map prepare_arg args
            in
            (args, self#module_type (atom "") xx)
        in
        let args, ret = extract_args [] x in
        label ~space letPattern
          (makeList
             ~break:IfNeed
             ~sep:(Sep "=>")
             ~preSpace:true
             ~inline:(true, true)
             [makeTup args; ret])

      (* See comments in sugar_parser.mly about why WITH constraints aren't "non
       * arrowed" *)
      | Pmty_with (mt, l) ->
          let modSub atm li2 token = makeList ~postSpace:true [
            atom "module";
            atm;
            atom token;
            self#longident_loc li2
          ] in
          let typeAtom = atom "type" in
          let eqAtom = atom "=" in
          let destrAtom = atom ":=" in
          let with_constraint = function
            | Pwith_type (li, td) ->
                self#formatOneTypeDef
                  typeAtom
                  (makeList ~preSpace:true [(self#longident_loc li)])
                  eqAtom
                  td
            | Pwith_module (li, li2) ->
                modSub (self#longident_loc li) li2 "="
            | Pwith_typesubst td ->
                self#formatOneTypeDef
                  typeAtom
                  (atom ~loc:td.ptype_name.loc td.ptype_name.txt)
                  destrAtom
                  td
            | Pwith_modsubst (s, li2) -> modSub (atom s.txt) li2 ":="
          in
          (match l with
            | [] -> self#module_type ~space letPattern mt
            | _ ->
              label ~space letPattern
                (label ~space:true
                  (makeList ~preSpace:true [self#module_type ~space:false (atom "") mt; atom "with"])
                  (makeList
                     ~break:IfNeed
                     ~inline:(true, true)
                     ~sep:(Sep "and")
                     ~postSpace:true
                     ~preSpace:true
                     (List.map with_constraint l)))
          )
        (* Seems like an infinite loop just waiting to happen. *)
        | _ -> self#non_arrowed_module_type ~space letPattern x
    in
    source_map ~loc:x.pmty_loc pmty

  method simple_module_expr ?(hug=false) x = match x.pmod_desc with
    | Pmod_unpack e ->
        let exprLayout = match e.pexp_desc with
        | Pexp_constraint (e, {ptyp_desc = Ptyp_package(lid, cstrs)}) ->
          formatTypeConstraint
            (makeList ~postSpace:true [atom "val"; (self#unparseExpr e)])
            (self#typ_package ~mod_prefix:false lid cstrs)
        | _ -> makeList ~postSpace:true [atom "val"; (self#unparseExpr e)]
        in formatPrecedence exprLayout
    | Pmod_ident li ->
        ensureSingleTokenSticksToLabel (self#longident_loc li)
    | Pmod_constraint (unconstrainedRet, mt) ->
        let letPattern = makeList [(self#module_expr unconstrainedRet); atom ":"]
        in
        formatPrecedence (self#module_type letPattern mt)
    | Pmod_structure s ->
        let wrap = if hug then ("({", "})") else ("{", "}") in
        let items =
          groupAndPrint
            ~xf:self#structure_item
            ~getLoc:(fun x -> x.pstr_loc)
            ~comments:self#comments
            s
        in
        makeList
          ~break:Always_rec
          ~inline:(true, false)
          ~wrap
          ~postSpace:true
          ~sep:(SepFinal (";", ";"))
          items
    | _ ->
        (* For example, functor application will be wrapped. *)
        formatPrecedence (self#module_expr x)

  method module_expr x =
    match x.pmod_desc with
    | Pmod_functor _ ->
      let (argsList, return) = self#curriedFunctorPatternsAndReturnStruct x in
      (* See #19/20 in syntax.mls - cannot annotate return type at
               the moment. *)
      self#wrapCurriedFunctionBinding funToken ~sweet:true ~arrow:"=>" (makeTup argsList) []
        ([self#moduleExpressionToFormattedApplicationItems return], None)
    | Pmod_apply _ ->
      self#moduleExpressionToFormattedApplicationItems x
    | Pmod_extension (s, e) -> self#payload "%" s e
    | Pmod_unpack _
    | Pmod_ident _
    | Pmod_constraint _
    | Pmod_structure _ -> self#simple_module_expr x


  method structure structureItems =
    match structureItems with
    | [] -> atom ""
    | first::_ as structureItems ->
      let last = match (List.rev structureItems) with | last::_ -> last | [] -> assert false in
      let loc_start = first.pstr_loc.loc_start in
      let loc_end = last.pstr_loc.loc_end in
      let items =
        groupAndPrint
          ~xf:self#structure_item
          ~getLoc:(fun x -> x.pstr_loc)
          ~comments:self#comments
          structureItems
      in
      source_map ~loc:{loc_start; loc_end; loc_ghost = false}
        (makeList
           ~postSpace:true
           ~break:Always_rec
           ~indent:0
           ~inline:(true, false)
           ~sep:(SepFinal (";", ";"))
           items)

  (*
     How do modules become parsed?
     let module (X: sig) = blah;
       Will not parse! (Should just make it parse to let [X:sig =]).
     let module X: sig = blah;
       Becomes Pmod_constraint
     let module X: sig = (blah:sig);
       Becomes Pmod_constraint .. Pmod_constraint
     let module X = blah:typ;
       Becomes Pmod_constraint
     let module X (Y:y) (Z:z):r => Q
       Becomes Pmod_functor...=> Pmod_constraint

     let module X (Y:y) (Z:z):r => (Q:r2)
       Probably becomes Pmod_functor...=> (Pmod_constraint..
       Pmod_constraint)

    let (module X) =
      Is a *completely* different thing (unpacking/packing first class modules).
      We should make sure this is very well distinguished.
      - Just replace all "let module" with a new three letter keyword (mod)?
      - Reserve let (module X) for unpacking first class modules.

    See the notes about how Ppat_constraint become parsed and attempt to unify
    those as well.
  *)

  method let_module_binding prefixText bindingName moduleExpr =
    let (argsList, return) = self#curriedFunctorPatternsAndReturnStruct moduleExpr in (
      match (argsList, return.pmod_desc) with
        (* Simple module with type constraint, no functor args. *)
        | ([], Pmod_constraint (unconstrainedRetTerm, ct)) ->
            let letPattern =
              makeList
                [makeList ~postSpace:true [atom prefixText; bindingName];
                 atom ":"]
            in
            let typeConstraint = self#module_type letPattern ct in
            let includingEqual = makeList ~postSpace:true [typeConstraint; atom "="]
            in
            formatAttachmentApplication applicationFinalWrapping (Some (true, includingEqual))
              ([self#moduleExpressionToFormattedApplicationItems unconstrainedRetTerm], None)

        (* Simple module with type no constraint, no functor args. *)
        | ([], _) ->
          self#formatSimplePatternBinding prefixText bindingName None
            ([self#moduleExpressionToFormattedApplicationItems return], None)
        | (_, _) ->
            (* A functor *)
            let (argsWithConstraint, actualReturn) = (
              match return.pmod_desc with
                (* A functor with constrained return type:
                 *
                 * let module X = (A) (B) : Ret => ...
                 * *)
                | Pmod_constraint (me, ct) ->
                  ([makeTup argsList;
                    self#non_arrowed_module_type (atom ":") ct], me)
                | _ -> ([makeTup argsList], return)
            ) in
            self#wrapCurriedFunctionBinding prefixText ~arrow:"=>"
              (makeList [bindingName; atom " ="]) argsWithConstraint
              ([self#moduleExpressionToFormattedApplicationItems actualReturn], None)
    )

    method class_opening class_keyword name pci_virt ls =
      let firstToken = if class_keyword then "class" else "and" in
      match (pci_virt, ls) with
        (* When no class params, it's a very simple formatting for the
           opener - no breaking. *)
        | (Virtual, []) ->
          (firstToken, atom "virtual", [atom name])
        | (Concrete, []) ->
          (firstToken, atom name, [])
        | (Virtual, _::_) ->
          (firstToken, atom "virtual", [atom name; self#class_params_def ls])
        | (Concrete, _::_) ->
          (firstToken, atom name, [self#class_params_def ls])


  (* TODO: TODOATTRIBUTES: Structure items don't have attributes, but each
     pstr_desc *)
  method structure_item term =
    let item = (
      match term.pstr_desc with
        | Pstr_eval (e, attrs) ->
            let {stdAttrs; jsxAttrs; uncurried} = partitionAttributes attrs in
            if uncurried then Hashtbl.add uncurriedTable e.pexp_loc true;
            let layout = self#attach_std_item_attrs stdAttrs (self#unparseUnattributedExpr e) in
            (* If there was a JSX attribute BUT JSX component wasn't detected,
               that JSX attribute needs to be pretty printed so it doesn't get
               lost *)
            (match jsxAttrs with
            | [] -> layout
            | _::_ ->
              let jsxAttrNodes = List.map self#attribute jsxAttrs in
              makeList ~sep:(Sep " ") (jsxAttrNodes @ [layout]))
        | Pstr_type (_, []) -> assert false
        | Pstr_type (rf, l)  -> (self#type_def_list (rf, l))
        | Pstr_value (rf, l) -> (self#bindings (rf, l))
        | Pstr_typext te -> (self#type_extension te)
        | Pstr_exception ed -> (self#exception_declaration ed)
        | Pstr_module x ->
            let bindingName = atom ~loc:x.pmb_name.loc x.pmb_name.txt in
            self#attach_std_item_attrs x.pmb_attributes @@
            self#let_module_binding "module" bindingName x.pmb_expr
        | Pstr_open od ->
            self#attach_std_item_attrs od.popen_attributes @@
            makeList ~postSpace:true [
              atom ("open" ^ (override od.popen_override));
              self#longident_loc od.popen_lid;
            ]
        | Pstr_modtype x ->
            let name = atom x.pmtd_name.txt in
            let letPattern = makeList ~postSpace:true [atom "module type"; name; atom "="] in
            let main = match x.pmtd_type with
              | None -> makeList ~postSpace:true [atom "module type"; name]
              | Some mt -> self#module_type letPattern mt
            in
            self#attach_std_item_attrs x.pmtd_attributes main
        | Pstr_class l -> self#class_declaration_list l
        | Pstr_class_type l -> self#class_type_declaration_list l
        | Pstr_primitive vd -> self#primitive_declaration vd
        | Pstr_include incl ->
            self#attach_std_item_attrs incl.pincl_attributes @@
            (* Kind of a hack *)
            let moduleExpr = incl.pincl_mod in
            self#moduleExpressionToFormattedApplicationItems
              ~prefix:"include"
              moduleExpr

        | Pstr_recmodule decls -> (* 3.07 *)
            let items = List.mapi (fun i xx ->
              let {stdAttrs; docAttrs} =
                partitionAttributes ~partDoc:true xx.pmb_attributes
              in
              let layout =
                self#attach_std_item_attrs stdAttrs @@
                self#let_module_binding
                  (if i == 0 then "module rec" else "and")
                  (atom xx.pmb_name.txt)
                  xx.pmb_expr
              in
              let layoutWithDocAttrs =
                self#attachDocAttrsToLayout
                 ~stdAttrs
                 ~docAttrs
                 ~loc:xx.pmb_name.loc
                 ~layout
                 ()
              in
              (extractLocModuleBinding xx, layoutWithDocAttrs)
            ) decls
            in
            makeNonIndentedBreakingList
              (groupAndPrint
                ~xf:(fun (_, layout) -> layout)
                ~getLoc:(fun (loc, _) -> loc)
                ~comments:self#comments
                items)
        | Pstr_attribute a -> self#floating_attribute a
        | Pstr_extension ((extension, PStr [item]), a) ->
          begin match item.pstr_desc with
            | Pstr_value (rf, l) -> self#bindings ~extension (rf, l)
            | _ ->
                let {stdAttrs; docAttrs} =
                  partitionAttributes ~partDoc:true a
                in
                let layout =
                  self#attach_std_item_attrs ~extension stdAttrs
                     (self#structure_item item)
                in
                makeList ~inline:(true, true) ~break:Always
                  ((List.map self#attribute docAttrs)@[layout])
          end
        | Pstr_extension (e, a) ->
          (* Notice how extensions have attributes - but not every structure
             item does. *)
          self#attach_std_item_attrs a (self#item_extension e)
    ) in
    source_map ~loc:term.pstr_loc item

  method type_extension te =
    let formatOneTypeExtStandard prepend ({ptyext_path} as te) =
      let name = self#longident_loc ptyext_path in
      let item = self#formatOneTypeExt prepend name (atom "+=") te in
      let {stdAttrs; docAttrs} =
        partitionAttributes ~partDoc:true te.ptyext_attributes
      in
      let layout = self#attach_std_item_attrs stdAttrs item in
      self#attachDocAttrsToLayout
        ~stdAttrs
        ~docAttrs
        ~loc:ptyext_path.loc
        ~layout
        ()
    in
    formatOneTypeExtStandard (atom "type") te

  (* [allowUnguardedSequenceBodies] allows sequence expressions {} to the right of `=>` to not
     be guarded in `{}` braces. *)
  method case_list ?(allowUnguardedSequenceBodies=false) l =
    let rec appendLabelToLast items rhs =
      match items with
        | hd::[] -> (label ~indent:0 ~space:true hd rhs)::[]
        | hd::tl -> hd::(appendLabelToLast tl rhs)
        | [] -> raise (NotPossible "Cannot append to last of nothing")
    in

    let case_row {pc_lhs; pc_guard; pc_rhs} =
      let theOrs = orList pc_lhs in

      (* match x with *)
      (* | AnotherReallyLongVariantName (_, _, _)   *)
      (* | AnotherReallyLongVariantName2 (_, _, _)
           when true => {                           *)

      (*   }                                        *)

      (*<sbi><X>match x with</X>   *)
      (*     <Y>everythingElse</Y> *)
      (*</sbi>                     *)



      (*     ............................................................
             :    each or segment has a spaced list <> that ties its    :
             : bar "|" to its pattern                                   :
             ...:..........................................................:.....
             :  :  each or-patterned match is grouped in SpacedBreakableInline  :
             :  :                                                          :    :
             v  v                                                          v    v
             <sbi><>|<lb><A><>     FirstThingStandalone t =></A></><B>t</B></lb></></sbi>
             <sbi><>|<C>           AnotherReallyLongVariantName (_, _, _)</C></>
             ^    <>|<lb><><lb><D>AnotherReallyLongVariantNam2 (_, _, _)</D>             (label the last in or ptn for or and label it again for arrow)
             :        ^  ^   ^     <E>when true<E></lb> =></><F>{
             :        :  :   :    </F>}</lb></sbi> ^       ^
             :        :  :   :            ^     ^   :      :
             :        :  :   :            :     :   :      :
             :        :  :   :If there is :a WHERE  :      :
             :        :  :   :an extra    :label is :      :
             :        :  :   :inserted bef:ore the  :      :
             :        :  :   :arrow.      :     :   :      :
             :        :  :   :............:.....:...:      :
             :        :  :                :     :          :
             :        :  :                :     :          :
             :        :  :                :     :          :
             :        :  :The left side of:this final label:
             :        :  :uses a list to  :append the arrow:
             :        :  :................:.....:..........:
             :        :                   :     :
             :        :                   :     :
             :        :                   :     :
             :        :Final or segment is:     :
             :        :wrapped in lbl that:     :
             :        :partitions pattern :     :
             :        :and arrow from     :     :
             :        :expression.        :     :
             :        :                   :     :
             :        :...................:     :
             :     [orsWithWhereAndArrowOnLast] :
             :                                  :
             :..................................:
                         [row]

      *)
      let bar xx = makeList ~postSpace:true [atom "|"; xx] in
      let appendWhereAndArrow p = match pc_guard with
        | None -> makeList ~postSpace:true [p; atom "=>"]
        | Some g ->
          (* when x should break as a whole - extra list added around it to make it break as one *)
          let withWhen = label ~space:true p
              (makeList ~break:Layout.Never ~inline:(true, true) ~postSpace:true
                 [label ~space:true (atom "when") (self#unparseExpr g)])
          in
          makeList ~inline:(true, true) ~postSpace:true [withWhen; atom "=>"]
      in
      let rec appendWhereAndArrowToLastOr = function
        | [] -> []
        | hd::tl ->
          let formattedHd = self#pattern hd in
          let formattedHd =
            if tl == [] then appendWhereAndArrow formattedHd else formattedHd
          in
          (formattedHd :: appendWhereAndArrowToLastOr tl)
      in
      let orsWithWhereAndArrowOnLast = appendWhereAndArrowToLastOr theOrs in
      let rhs =
        if allowUnguardedSequenceBodies then
          match (self#under_pipe#letList pc_rhs) with
          (* TODO: Still render a list with located information here so that
               comments (eol) are interleaved *)
          | [hd] -> hd
          (* In this case, we don't need any additional indentation, because there aren't
             wrapping {} which would cause zero indentation to look strange. *)
          | lst -> makeUnguardedLetSequence lst
        else self#under_pipe#unparseExpr pc_rhs
      in
      source_map
        (* Fake shift the location to accommodate for the bar, to make sure
           * the wrong comments don't make their way past the next bar. *)
        ~loc:(expandLocation ~expand:(0, 0) {
            loc_start = pc_lhs.ppat_loc.loc_start;
            loc_end = pc_rhs.pexp_loc.loc_end;
            loc_ghost = false;
          })
        (makeList ~break:Always_rec ~inline:(true, true)
           (List.map bar (appendLabelToLast orsWithWhereAndArrowOnLast rhs)))
    in
    groupAndPrint
      ~xf:case_row
      ~getLoc:(fun {pc_lhs; pc_rhs} -> {pc_lhs.ppat_loc with loc_end = pc_rhs.pexp_loc.loc_end})
      ~comments:self#comments
      l

  (* Formats a list of a single expr param in such a way that the parens of the function or
   * (poly)-variant application and the wrapping of the param stick together when the layout breaks.
   *  Example: `foo({a: 1, b: 2})` needs to be formatted as
   *  foo({
   *    a: 1,
   *    b: 2
   *  })
   *  when the line length dictates breaking. Notice how `({` and `})` 'hug'.
   *  Also see "isSingleArgParenApplication" which determines if
   *  this kind of formatting should happen. *)
  method singleArgParenApplication ?(wrap=("", "")) ?(uncurried=false) es =
    let (lwrap, rwrap) = wrap in
    let lparen = lwrap ^ (if uncurried then  "(. " else "(") in
    let rparen = ")" ^ rwrap in
    match es with
    | [{pexp_attributes = []; pexp_desc = Pexp_record (l, eo)}] ->
      self#unparseRecord ~wrap:(lparen, rparen) l eo
    | [{pexp_attributes = []; pexp_desc = Pexp_tuple l}] ->
      self#unparseSequence ~wrap:(lparen, rparen) ~construct:`Tuple l
    | [{pexp_attributes = []; pexp_desc = Pexp_array l}] ->
      self#unparseSequence ~wrap:(lparen, rparen) ~construct:`Array l
    | [{pexp_attributes = []; pexp_desc = Pexp_object cs}] ->
      self#classStructure ~wrap:(lparen, rparen) cs
    | [{pexp_attributes = []; pexp_desc = Pexp_extension (s, p)}] when s.txt = "bs.obj" ->
      self#formatBsObjExtensionSugar ~wrap:(lparen, rparen) p
    | [({pexp_attributes = []} as exp)] when (is_simple_list_expr exp) ->
          (match view_expr exp with
          | `list xs ->
              self#unparseSequence ~construct:`List ~wrap:(lparen, rparen) xs
          | `cons xs ->
              self#unparseSequence ~construct:`ES6List ~wrap:(lparen, rparen) xs
          | _ -> assert false)
    | _ -> assert false

  method formatSingleArgLabelApplication labelTerm rightExpr =
    let layout_right = match rightExpr with
    | {pexp_desc = Pexp_let _} ->
      makeLetSequence ~wrap:("({", "})") (self#letList rightExpr)
    | e when isSingleArgParenApplication [rightExpr] ->
      self#singleArgParenApplication [e]
    | {pexp_desc = Pexp_construct ( {txt= Lident"()"},_)} ->
      (* special case unit such that we don't end up with double parens *)
      self#simplifyUnparseExpr rightExpr
    | _ ->
      formatPrecedence (self#unparseExpr rightExpr)
    in
    label labelTerm layout_right

  method label_x_expression_param (l, e) =
    let term = self#unparseProtectedExpr e in
    let param = match (l, e) with
      | (Nolabel, _) -> term
      | (Labelled lbl, _) when is_punned_labelled_expression e lbl ->
        makeList [atom namedArgSym; term]
      | (Optional lbl, _) when is_punned_labelled_expression e lbl ->
        makeList [atom namedArgSym; label term (atom "?")]
      | (Labelled lbl, _) ->
        label (atom (namedArgSym ^ lbl ^ "=")) term
      | (Optional lbl, _) ->
        label (atom (namedArgSym ^ lbl ^ "=?")) term
    in
    source_map ~loc:e.pexp_loc param

  method label_x_expression_params ?wrap ?(uncurried=false) xs =
    match xs with
      (* function applications with unit as only argument should be printed differently
       * e.g. print_newline(()) should be printed as print_newline() *)
      | [(Nolabel, {pexp_attributes = []; pexp_desc = Pexp_construct ( {txt= Lident "()"}, None)})]
          -> makeList
              ~break:Never
              ?wrap
              [if uncurried then atom "(.)" else atom "()"]

      (* The following cases provide special formatting when there's only one expr_param that is a tuple/array/list/record etc.
       *  e.g. foo({a: 1, b: 2})
       *  becomes ->
       *  foo({
       *    a: 1,
       *    b: 2,
       *  })
       *  when the line-length indicates breaking.
       *)
      | [(Nolabel, exp)] when isSingleArgParenApplication [exp] ->
          self#singleArgParenApplication ?wrap ~uncurried [exp]
      | params ->
          makeTup ?wrap ~uncurried (List.map self#label_x_expression_param params)

  (*
   * Prefix represents an optional layout. When passed it will be "prefixed" to
   * the funExpr. Example, given `bar(x, y)` with prefix `foo`, we get
   * foobar(x,y). When the arguments break, the closing `)` is nicely aligned
   * on the height of the prefix:
   *  foobar(
   *    x,
   *    y,
   *  )  --> notice how `)` sits on the height of `foo` instead of `bar`
   *
   *  ~wrap -> represents optional "wrapping", might be useful in context of jsx
   *  where braces are required:
   * prop={bar(   -> `{` is formatted before the funExpr
   *   x,
   *   y,
   * )}      -> notice how the closing brace hugs: `)}`
   *)
  method formatFunAppl ?(prefix=(atom "")) ?(wrap=("", "")) ~jsxAttrs ~args ~funExpr ~applicationExpr ?(uncurried=false) () =
    let (leftWrap, rightWrap) = wrap in
    let uncurriedApplication = uncurried in
    (* If there was a JSX attribute BUT JSX component wasn't detected,
       that JSX attribute needs to be pretty printed so it doesn't get
       lost *)
    let maybeJSXAttr = List.map self#attribute jsxAttrs in
    let categorizeFunApplArgs args =
      let reverseArgs = List.rev args in
      match reverseArgs with
      | ((_, {pexp_desc = Pexp_fun _}) as callback)::args
          when
            [] == List.filter (fun (_, e) -> match e.pexp_desc with Pexp_fun _ -> true | _ -> false) args
          (* default to normal formatting if there's more than one callback *)
          -> `LastArgIsCallback(callback, List.rev args)
      | _ -> `NormalFunAppl args
    in
    let formattedFunExpr = match funExpr.pexp_desc with
      (* pipe first chain or sharpop chain as funExpr, no parens needed, we know how to parse *)
      | Pexp_apply ({pexp_desc = Pexp_ident {txt = Lident s}}, _)
        when requireNoSpaceFor s ->
        self#unparseExpr funExpr
      | Pexp_field _ -> self#unparseExpr funExpr
      | _ -> self#simplifyUnparseExpr funExpr
    in
    let formattedFunExpr = makeList [prefix; atom leftWrap; formattedFunExpr] in
    begin match categorizeFunApplArgs args with
    | `LastArgIsCallback(callbackArg, args) ->
        (* This is the following case:
         * Thing.map(foo, bar, baz, (abc, z) =>
         *   MyModuleBlah.toList(argument)
         *)
        let (argLbl, cb) = callbackArg in
        let {stdAttrs; uncurried} = partitionAttributes cb.pexp_attributes in
        let cbAttrs = stdAttrs in
        if uncurried then Hashtbl.add uncurriedTable cb.pexp_loc true;
        let (cbArgs, retCb) = self#curriedPatternsAndReturnVal {cb with pexp_attributes = []} in
        let cbArgs = if cbAttrs != [] then
            makeList ~break:IfNeed ~inline:(true, true) ~postSpace:true
              (List.map self#attribute cbAttrs @ cbArgs)
        else makeList cbArgs in
        let theCallbackArg = match argLbl with
          | Optional s -> makeList ([atom namedArgSym; atom s; atom "=?"]@[cbArgs])
          | Labelled s -> makeList ([atom namedArgSym; atom s; atom "="]@[cbArgs])
          | Nolabel -> cbArgs
        in
        let theFunc =
          source_map ~loc:funExpr.pexp_loc
            (makeList
               ~wrap:("", (if uncurriedApplication then "(." else "("))
               [formattedFunExpr])
        in
        let formattedFunAppl = begin match self#letList retCb with
        | [x] ->
          (* force breaks for test assertion style callbacks, e.g.
           *  describe("App", () => test("math", () => Expect.expect(1 + 2) |> toBe(3)));
           * should always break for readability of the tests:
           *  describe("App", () =>
           *    test("math", () =>
           *      Expect.expect(1 + 2) |> toBe(3)
           *    )
           *  );
           *)
          let forceBreak = match funExpr.pexp_desc with
          | Pexp_ident ident when
              let lastIdent = Longident.last ident.txt in
              List.mem lastIdent ["test"; "describe"; "it"; "expect"] -> true
          | _ -> false
          in
          let (leftWrap, rightWrap) as wrap = ("=> ", ")" ^ rightWrap) in
          let wrap = if self#should_preserve_requested_braces retCb then
            (leftWrap ^ "{", "}" ^ rightWrap)
          else
            wrap
          in
          let returnValueCallback =
            makeList
              ~break:(if forceBreak then Always else IfNeed)
              ~wrap
              [x]
          in
          let argsWithCallbackArgs = List.concat [(List.map self#label_x_expression_param args); [theCallbackArg]] in
          let left = label
            theFunc
            (makeList
               ~pad:(uncurriedApplication, false)
               ~wrap:("", " ") ~break:IfNeed ~inline:(true, true) ~sep:(Sep ",") ~postSpace:true
              argsWithCallbackArgs)
          in
          label left returnValueCallback
        | xs ->
          let printWidthExceeded = Reason_heuristics.funAppCallbackExceedsWidth ~printWidth:settings.width ~args ~funExpr () in
          if not printWidthExceeded then
              (*
               * Thing.map(foo, bar, baz, (abc, z) =>
               *   MyModuleBlah.toList(argument)
               * )
               *
               * To get this kind of formatting we need to construct the following tree:
               * <Label>
               * <left>Thing.map(foo, bar, baz, (abc, z)</left><right>=>
               *   MyModuleBlah.toList(argument)
               * )</right>
               * </Label>
               *
               * where left is
               * <Label><left>Thing.map(</left></right>foo, bar, baz, (abc, z) </right></Label>
               *
               * The <right> part of that label could be a <List> with wrap:("", " ") break:IfNeed inline:(true, true)
               * with items: "foo", "bar", "baz", "(abc, z)", separated by commas.
               *
               * this is also necessary to achieve the following formatting where }) hugs :
               * test("my test", () => {
               *   let x = a + b;
               *   let y = z + c;
               *   x + y
               * });
               *)
            let (leftWrap, rightWrap) as wrap = ("=> ", ")" ^ rightWrap) in
            let wrap = if self#should_preserve_requested_braces retCb then
              (leftWrap ^ "{", "}" ^ rightWrap)
            else
              wrap
            in
            let right =
              source_map ~loc:retCb.pexp_loc
                (makeList ~break:Always_rec ~wrap ~sep:(SepFinal (";", ";")) xs)
            in
            let argsWithCallbackArgs =
              List.map self#label_x_expression_param args @ [theCallbackArg]
            in
            let left = label
                theFunc
                (makeList ~wrap:("", " ") ~break:IfNeed ~inline:(true, true) ~sep:(Sep ",") ~postSpace:true
                   argsWithCallbackArgs)
            in
            label left right
          else
            (* Since the heuristic says the line length is exceeded in this case,
             * we conveniently format everything as
             * <label><left>Thing.map(</left><right><list>
             *   foo,
             *   bar,
             *   baz,
             *   <label> <left>(abc) =></left> <right><list> {
             *     let x = 1;
             *     let y = 2;
             *     x + y
             *   }</list></right></label>
             * )</list></right></label>
            *)
            let args =
              makeList ~break:Always ~wrap:("", ")" ^ rightWrap) ~sep:commaTrail (
                (List.map self#label_x_expression_param args) @
                [label ~space:true (makeList ~wrap:("", " =>") [theCallbackArg])
                   (source_map ~loc:retCb.pexp_loc (makeLetSequence xs))]
              )
            in
            label theFunc args
        end in
        maybeJSXAttr @ [formattedFunAppl]
    | `NormalFunAppl args ->
      let theFunc =
        source_map ~loc:funExpr.pexp_loc formattedFunExpr
      in
      (* reset here only because [function,match,try,sequence] are lower priority *)
      (* The "expression location" might be different than the location of the actual
       * function application because things like surrounding { } expand the
       * parsed location (in body of while loop for example).
       * We recover the most meaningful function application location we can.*)
      let (syntheticApplicationLocation, syntheticArgLoc) = match args with
        | [] -> (funExpr.pexp_loc, funExpr.pexp_loc)
        | _::_ ->
          {funExpr.pexp_loc with loc_end = applicationExpr.pexp_loc.loc_end},
          {funExpr.pexp_loc with loc_start = funExpr.pexp_loc.loc_end; loc_end = applicationExpr.pexp_loc.loc_end}
      in
      let theArgs = self#reset#label_x_expression_params ~wrap:("", rightWrap) ~uncurried args in
      maybeJSXAttr @ [source_map ~loc:syntheticApplicationLocation
                        (label theFunc (source_map ~loc:syntheticArgLoc theArgs))]
    end
end;;

let toplevel_phrase ppf x =
  match x with
  | Ptop_def s -> format_layout ppf (printer#structure s)
  | Ptop_dir _ -> print_string "(* top directives not supported *)"

let case_list ppf x =
  List.iter (format_layout ppf) (printer#case_list x)

(* Convert a Longident to a list of strings.
   E.g. M.Constructor will be ["Constructor"; "M.Constructor"]
   Also support ".Constructor" to specify access without a path.
 *)
let longident_for_arity lid =
  let rec toplevel = function
    | Lident s ->
        [s]
    | Ldot (lid, s) ->
        let append_s x = x ^ "." ^ s in
        s :: (List.map append_s (toplevel lid))
    | Lapply (_,s) ->
        toplevel s in
   match lid with
    | Lident s ->
        ("." ^ s) :: toplevel lid
    | _ ->
        toplevel lid

(* add expilcit_arity to a list of attributes
 *)
let add_explicit_arity loc attributes =
  ({txt="explicit_arity"; loc}, PStr []) ::
  normalized_attributes "explicit_arity" attributes

(* explicit_arity_exists check if expilcit_arity exists
 *)
let explicit_arity_not_exists attributes =
  not (attribute_exists "explicit_arity" attributes)

(* wrap_expr_with_tuple wraps an expression
 * with tuple as a sole argument.
 *)
let wrap_expr_with_tuple exp =
  {exp with pexp_desc = Pexp_tuple [exp]}

(* wrap_pat_with_tuple wraps an pattern
 * with tuple as a sole argument.
 *)
let wrap_pat_with_tuple pat =
  {pat with ppat_desc = Ppat_tuple [pat]}



(* explicit_arity_constructors is a set of constructors that are known to have
 * multiple arguments
 *
 *)

module StringSet = Set.Make(String);;

let built_in_explicit_arity_constructors = ["Some"; "Assert_failure"; "Match_failure"]

let explicit_arity_constructors = StringSet.of_list(built_in_explicit_arity_constructors @ (!configuredSettings).constructorLists)

let add_explicit_arity_mapper super =
  let super_expr = super.Ast_mapper.expr in
  let super_pat = super.Ast_mapper.pat in
  let expr mapper expr =
    let expr =
      match expr with
      | {pexp_desc=Pexp_construct(lid, Some sp);
         pexp_loc;
         pexp_attributes} when
          List.exists
            (fun c -> StringSet.mem c explicit_arity_constructors)
            (longident_for_arity lid.txt) &&
          explicit_arity_not_exists pexp_attributes ->
        {pexp_desc=Pexp_construct(lid, Some (wrap_expr_with_tuple sp));
         pexp_loc;
         pexp_attributes=add_explicit_arity pexp_loc pexp_attributes}
      | x -> x
    in
    super_expr mapper expr
  and pat mapper pat =
    let pat =
      match pat with
      | {ppat_desc=Ppat_construct(lid, Some sp);
         ppat_loc;
         ppat_attributes} when
          List.exists
            (fun c -> StringSet.mem c explicit_arity_constructors)
            (longident_for_arity lid.txt) &&
          explicit_arity_not_exists ppat_attributes ->
        {ppat_desc=Ppat_construct(lid, Some (wrap_pat_with_tuple sp));
         ppat_loc;
         ppat_attributes=add_explicit_arity ppat_loc ppat_attributes}
      | x -> x
    in
    super_pat mapper pat
  in
  { super with Ast_mapper. expr; pat }

let preprocessing_mapper =
  ml_to_reason_swap_operator_mapper
    (escape_stars_slashes_mapper
      (add_explicit_arity_mapper Ast_mapper.default_mapper))

let core_type ppf x =
  format_layout ppf
    (printer#core_type (apply_mapper_to_type x preprocessing_mapper))

let pattern ppf x =
  format_layout ppf
    (printer#pattern (apply_mapper_to_pattern x preprocessing_mapper))

let signature (comments : Comment.t list) ppf x =
  List.iter (fun comment -> printer#trackComment comment) comments;
  format_layout ppf ~comments
    (printer#signature (apply_mapper_to_signature x preprocessing_mapper))

let structure (comments : Comment.t list) ppf x =
  List.iter (fun comment -> printer#trackComment comment) comments;
  format_layout ppf ~comments
    (printer#structure (apply_mapper_to_structure x preprocessing_mapper))

let expression ppf x =
  format_layout ppf
    (printer#unparseExpr (apply_mapper_to_expr x preprocessing_mapper))

let case_list = case_list

end
in
object
  method core_type = Formatter.core_type
  method pattern = Formatter.pattern
  method signature = Formatter.signature
  method structure = Formatter.structure
  (* For merlin-destruct *)
  method toplevel_phrase = Formatter.toplevel_phrase
  method expression = Formatter.expression
  method case_list = Formatter.case_list
end

end
module Merlin_recovery : sig 
#1 "merlin_recovery.mli"
module Make
    (Parser : MenhirLib.IncrementalEngine.EVERYTHING)
    (Recovery : sig
       val default_value : Location.t -> 'a Parser.symbol -> 'a

       type action =
         | Abort
         | R of int
         | S : 'a Parser.symbol -> action
         | Sub of action list

       type decision =
         | Nothing
         | One of action list
         | Select of (int -> action list)

       val depth : int array

       val can_pop : 'a Parser.terminal -> bool

       val recover : int -> decision

       val guide : 'a Parser.symbol -> bool

       val token_of_terminal : 'a Parser.terminal -> 'a -> Parser.token

       val nullable : 'a Parser.nonterminal -> bool
     end) :
sig

  type 'a candidate = {
    line: int;
    min_col: int;
    max_col: int;
    env: 'a Parser.env;
  }

  type 'a candidates = {
    shifted: Parser.xsymbol option;
    final: 'a option;
    candidates: 'a candidate list;
  }

  val attempt : 'a candidates ->
    Parser.token * Lexing.position * Lexing.position ->
    [> `Accept of 'a
    | `Fail
    | `Ok of 'a Parser.checkpoint * 'a Parser.env ]

  val generate : 'a Parser.env -> 'a candidates

end

end = struct
#1 "merlin_recovery.ml"
let split_pos {Lexing. pos_lnum; pos_bol; pos_cnum; _} =
  (pos_lnum, pos_cnum - pos_bol)

let rev_filter ~f xs =
  let rec aux f acc = function
    | x :: xs when f x -> aux f (x :: acc) xs
    | _ :: xs -> aux f acc xs
    | [] -> acc
  in
  aux f [] xs

let rec rev_scan_left acc ~f ~init = function
  | [] -> acc
  | x :: xs ->
    let init = f init x in
    rev_scan_left (init :: acc) ~f ~init xs

module Make
    (Parser : MenhirLib.IncrementalEngine.EVERYTHING)
    (Recovery : sig
       val default_value : Location.t -> 'a Parser.symbol -> 'a

       type action =
         | Abort
         | R of int
         | S : 'a Parser.symbol -> action
         | Sub of action list

       type decision =
         | Nothing
         | One of action list
         | Select of (int -> action list)

       val depth : int array

       val recover : int -> decision

       val guide : 'a Parser.symbol -> bool

       val token_of_terminal : 'a Parser.terminal -> 'a -> Parser.token

       val nullable : 'a Parser.nonterminal -> bool
     end) =
struct

  type 'a candidate = {
    line: int;
    min_col: int;
    max_col: int;
    env: 'a Parser.env;
  }

  type 'a candidates = {
    shifted: Parser.xsymbol option;
    final: 'a option;
    candidates: 'a candidate list;
  }

  module T = struct
    [@@@ocaml.warning "-37"]

    type 'a checkpoint =
      | InputNeeded of 'a Parser.env
      | Shifting of 'a Parser.env * 'a Parser.env * bool
      | AboutToReduce of 'a Parser.env * Parser.production
      | HandlingError of 'a Parser.env
      | Accepted of 'a
      | Rejected
    external inj : 'a checkpoint -> 'a Parser.checkpoint = "%identity"
  end

  let feed_token ~allow_reduction token env =
    let rec aux allow_reduction = function
      | Parser.HandlingError _ | Parser.Rejected -> `Fail
      | Parser.AboutToReduce _ when not allow_reduction -> `Fail
      | Parser.Accepted v -> `Accept v
      | Parser.Shifting _ | Parser.AboutToReduce _ as checkpoint ->
        aux true (Parser.resume checkpoint)
      | Parser.InputNeeded env as checkpoint -> `Recovered (checkpoint, env)
    in
    aux allow_reduction (Parser.offer (T.inj (T.InputNeeded env)) token)

  let rec follow_guide col env = match Parser.top env with
    | None -> col
    | Some (Parser.Element (state, _, pos, _)) ->
      if Recovery.guide (Parser.incoming_symbol state) then
        match Parser.pop env with
        | None -> col
        | Some env -> follow_guide (snd (split_pos pos)) env
      else
        col

  let candidate env =
    let line, min_col, max_col =
      match Parser.top env with
      | None -> 1, 0, 0
      | Some (Parser.Element (state, _, pos, _)) ->
        let depth = Recovery.depth.(Parser.number state) in
        let line, col = split_pos pos in
        if depth = 0 then
          line, col, col
        else
          let col' = match Parser.pop_many depth env with
            | None -> max_int
            | Some env ->
              match Parser.top env with
              | None -> max_int
              | Some (Parser.Element (_, _, pos, _)) ->
                follow_guide (snd (split_pos pos)) env
          in
          line, min col col', max col col'
    in
    { line; min_col; max_col; env }

  let attempt r token =
    let _, startp, _ = token in
    let line, col = split_pos startp in
    let more_indented candidate =
      line <> candidate.line && candidate.min_col > col in
    let recoveries =
      let rec aux = function
        | x :: xs when more_indented x -> aux xs
        | xs -> xs
      in
      aux r.candidates
    in
    let same_indented candidate =
      line = candidate.line ||
      (candidate.min_col <= col && col <= candidate.max_col)
    in
    let recoveries =
      let rec aux = function
        | x :: xs when same_indented x -> x :: aux xs
        | _ -> []
      in
      aux recoveries
    in
    let rec aux = function
      | [] -> `Fail
      | x :: xs -> match feed_token ~allow_reduction:true token x.env with
        | `Fail ->
          aux xs
        | `Recovered (checkpoint, _) -> `Ok (checkpoint, x.env)
        | `Accept v ->
          begin match aux xs with
            | `Fail -> `Accept v
            | x -> x
          end
    in
    aux recoveries

  let decide env =
    let rec nth_state env n =
      if n = 0 then
        match Parser.top env with
        | None -> -1 (*allow giving up recovery on empty files*)
        | Some (Parser.Element (state, _, _, _)) -> Parser.number state
      else
        match Parser.pop env with
        | None -> assert (n = 1); -1
        | Some env -> nth_state env (n - 1)
    in
    let st = nth_state env 0 in
    match Recovery.recover st with
    | Recovery.Nothing -> []
    | Recovery.One actions -> actions
    | Recovery.Select f -> f (nth_state env Recovery.depth.(st))

  let generate (type a) (env : a Parser.env) =
    let module E = struct
      exception Result of a
    end in
    let shifted = ref None in
    let rec aux acc env =
      match Parser.top env with
      | None -> None, acc
      | Some (Parser.Element (_state, _, _startp, endp)) ->
        let actions = decide env in
        let candidate0 = candidate env in
        let rec eval (env : a Parser.env) : Recovery.action -> a Parser.env = function
          | Recovery.Abort ->
            raise Not_found
          | Recovery.R prod ->
            let prod = Parser.find_production prod in
            Parser.force_reduction prod env
          | Recovery.S (Parser.N n as sym) ->
            let xsym = Parser.X sym in
            if !shifted = None && not (Recovery.nullable n) then
              shifted := Some xsym;
            let loc = {Location. loc_start = endp; loc_end = endp; loc_ghost = true} in
            let v = Recovery.default_value loc sym in
            Parser.feed sym endp v endp env
          | Recovery.S (Parser.T t as sym) ->
            let xsym = Parser.X sym in
            if !shifted = None then shifted := Some xsym;
            let loc = {Location. loc_start = endp; loc_end = endp; loc_ghost = true} in
            let v = Recovery.default_value loc sym in
            let token = (Recovery.token_of_terminal t v, endp, endp) in
            begin match feed_token ~allow_reduction:true token env with
              | `Fail -> assert false
              | `Accept v -> raise (E.Result v)
              | `Recovered (_,env) -> env
            end
          | Recovery.Sub actions ->
            List.fold_left eval env actions
        in
        match
          rev_scan_left [] ~f:eval ~init:env actions
          |> List.map (fun env -> {candidate0 with env})
        with
        | exception Not_found -> None, acc
        | exception (E.Result v) -> Some v, acc
        | [] -> None, acc
        | (candidate :: _) as candidates ->
          aux (candidates @ acc) candidate.env
    in
    let final, candidates = aux [] env in
    (!shifted, final, candidates)

  let generate env =
    let shifted, final, candidates = generate env in
    let candidates = rev_filter candidates
        ~f:(fun t -> not (Parser.env_has_default_reduction t.env))
    in
    { shifted; final; candidates = (candidate env) :: candidates }

end

end
module Reason_single_parser : sig 
#1 "reason_single_parser.mli"
type 'a parser

val initial :
  (Lexing.position -> 'a Reason_parser.MenhirInterpreter.checkpoint) ->
  Lexing.position -> 'a parser

type 'a step =
  | Intermediate of 'a parser
  | Success of 'a * Reason_lexer.invalid_docstrings
  | Error

val step : 'a parser -> Reason_parser.token Reason_lexer.positioned -> 'a step

(* Interface for recovery *)

val recover :
  'a Reason_parser.MenhirInterpreter.checkpoint ->
  Reason_lexer.invalid_docstrings ->
  'a parser

val recovery_env :
  'a parser ->
  'a Reason_parser.MenhirInterpreter.env * Reason_lexer.invalid_docstrings

end = struct
#1 "reason_single_parser.ml"
module I = Reason_parser.MenhirInterpreter

type token = Reason_parser.token
type invalid_docstrings = Reason_lexer.invalid_docstrings

module Step : sig
  type 'a parser
  type 'a step =
    | Intermediate of 'a parser
    | Success of 'a * invalid_docstrings
    | Error

  val initialize : 'a I.checkpoint -> 'a step
  val offer : 'a parser -> token Reason_lexer.positioned -> 'a step
  val add_docstring :
    string -> Lexing.position -> Lexing.position -> 'a parser -> 'a parser

  val recover : 'a I.checkpoint -> invalid_docstrings -> 'a parser
  val recovery_env : 'a parser -> 'a I.env * invalid_docstrings
end = struct

  type 'a postfix_state = {
    checkpoint: 'a I.checkpoint;
    docstrings: invalid_docstrings;
    fallback: 'a I.checkpoint;
    postfix_ops: int;
    postfix_pos: Lexing.position;
  }

  type 'a parser =
    | Normal of 'a I.checkpoint * invalid_docstrings
    | After_potential_postfix of 'a postfix_state

  type 'a step =
    | Intermediate of 'a parser
    | Success of 'a * invalid_docstrings
    | Error

  let mark_potential_postfix token fallback =
    let string_forall f s =
      let i = ref 0 in
      let len = String.length s in
      let valid = ref true in
      while !i < len && !valid do
        valid := f s.[!i];
        incr i;
      done;
      !valid
    in
    match token with
    | (Reason_parser.INFIXOP1 s, pos, _)
      when string_forall ((=) '^') s ->
      (fun checkpoint docstrings ->
         After_potential_postfix {
           checkpoint; fallback; docstrings;
           postfix_ops = String.length s;
           postfix_pos = pos;
         })
    | _ ->
      (fun checkpoint docstrings ->
         Normal (checkpoint, docstrings))

  let rec offer_postfix count pos = function
    | I.Shifting _ | I.AboutToReduce _ as checkpoint ->
      offer_postfix count pos (I.resume checkpoint)
    | I.InputNeeded _ as checkpoint ->
      if count <= 0 then checkpoint else (
        let pos_cnum = pos.Lexing.pos_cnum in
        let pos' = {pos with Lexing.pos_cnum = pos_cnum + 1} in
        offer_postfix (count - 1) pos'
          (I.offer checkpoint (Reason_parser.POSTFIXOP "^", pos, pos'))
      )
    | other -> other

  let rec step mark_potential_postfix safepoint docstrings = function
    | I.Shifting _ | I.AboutToReduce _ as checkpoint ->
       step mark_potential_postfix safepoint docstrings (I.resume checkpoint)
    | I.InputNeeded _ as checkpoint ->
      Intermediate (mark_potential_postfix checkpoint docstrings)
    | I.Accepted x -> Success (x, docstrings)
    | I.Rejected | I.HandlingError _ -> Error

  let offer parser token =
    match parser with
    | Normal (checkpoint, docstrings) ->
      step (mark_potential_postfix token checkpoint) checkpoint
        docstrings (I.offer checkpoint token)
    | After_potential_postfix r ->
      match step (mark_potential_postfix token r.checkpoint) r.checkpoint
              r.docstrings (I.offer r.checkpoint token)
      with
      | Error ->
        begin (* Try applying postfix operators on fallback parser *)
          match offer_postfix r.postfix_ops r.postfix_pos r.fallback with
          | I.InputNeeded _ as checkpoint ->
            step (mark_potential_postfix token checkpoint) checkpoint
              r.docstrings (I.offer checkpoint token)
          | _ -> Error
        end
      | result -> result

  let add_docstring text startp endp parser =
    match parser with
    | Normal (checkpoint, docstrings) ->
      let docstrings =
        Reason_lexer.add_invalid_docstring text startp endp docstrings
      in
      Normal (checkpoint, docstrings)
    | After_potential_postfix r ->
      let docstrings =
        Reason_lexer.add_invalid_docstring text startp endp r.docstrings
      in
      After_potential_postfix {r with docstrings}

  let initialize checkpoint =
    step (fun parser ds -> Normal (parser, ds)) checkpoint
      Reason_lexer.empty_invalid_docstrings checkpoint

  let recover cp ds =
    begin match cp with
      | I.InputNeeded _ -> ()
      | _ -> assert false
    end;
    Normal (cp, ds)

  let recovery_env parser =
    let cp, ds = match parser with
      | Normal (cp, ds) -> (cp, ds)
      | After_potential_postfix r -> (r.checkpoint, r.docstrings)
    in
    match cp with
    | I.InputNeeded env -> (env, ds)
    | _ -> assert false
end

type 'a parser = 'a Step.parser
type 'a step = 'a Step.step =
  | Intermediate of 'a parser
  | Success of 'a * invalid_docstrings
  | Error

let initial entry position =
  match Step.initialize (entry position) with
  | Step.Intermediate parser -> parser
  | _ -> assert false

let rec offer_many parser = function
  | [] -> Step.Intermediate parser
  | [token] -> Step.offer parser token
  | token :: tokens ->
     match Step.offer parser token with
     | Step.Intermediate parser -> offer_many parser tokens
     | other -> other

(* Logic for inserting ';' *)

let try_insert_semi_on = function
  | Reason_parser.LET | Reason_parser.TYPE | Reason_parser.MODULE
  | Reason_parser.OPEN | Reason_parser.EXCEPTION
  | Reason_parser.INCLUDE | Reason_parser.DOCSTRING _
  | Reason_parser.LIDENT _ | Reason_parser.UIDENT _
  | Reason_parser.IF | Reason_parser.WHILE
  | Reason_parser.FOR | Reason_parser.SWITCH
  | Reason_parser.TRY | Reason_parser.ASSERT
  | Reason_parser.EXTERNAL | Reason_parser.LAZY
  | Reason_parser.LBRACKETAT -> true
  | _ -> false

(* Logic for splitting '=?...' operators into '=' '?' '...' *)

let token_for_label_operator = function
  | "-" -> Some Reason_parser.MINUS
  | "-." -> Some Reason_parser.MINUSDOT
  | "+" -> Some Reason_parser.PLUS
  | "+." -> Some Reason_parser.PLUSDOT
  | "!" -> Some Reason_parser.BANG
  | _ -> None

let split_label s =
  let is_optional = String.length s > 1 && s.[1] == '?' in
  let idx = if is_optional then 2 else 1 in
  let operator = String.sub s idx (String.length s - idx) in
  (token_for_label_operator operator, is_optional)

let try_split_label (tok_kind, pos0, posn) =
  match tok_kind with
  | Reason_parser.INFIXOP0 s when s.[0] == '=' ->
    begin match split_label s with
    | None, _ -> []
    | Some new_token, is_optional ->
      let advance p n = {p with Lexing.pos_cnum = p.Lexing.pos_cnum + n} in
      let pos1 = advance pos0 1 in
      let pos2 = if is_optional then advance pos1 1 else pos1 in
      let token0 = (Reason_parser.EQUAL, pos0, pos1) in
      let token2 = (new_token, pos2, posn) in
      if is_optional then
        let token1 = (Reason_parser.QUESTION, pos1, pos2) in
        [token0; token1; token2]
      else
        [token0; token2]
    end
  | _ -> []

(* Logic for attempting to consume a token
   and try alternatives on failure *)

let step parser token =
  match Step.offer parser token with
  | (Success _ | Intermediate _) as step -> step
  | Error ->
     let try_alternative_tokens = function
       | [] -> Error
       | tokens ->
          match offer_many parser tokens with
          | (Step.Intermediate _ | Step.Success _) as result -> result
          (* Alternative failed... Return original failure *)
          | Step.Error -> Error
     in
     let alternative =
       match token with
       | tok_kind, pos, _ when try_insert_semi_on tok_kind ->
         try_alternative_tokens [(Reason_parser.SEMI, pos, pos); token]
       | _ -> try_alternative_tokens (try_split_label token)
     in
     match alternative, token with
     | Error, (Reason_parser.DOCSTRING text, startp, endp) ->
       Intermediate (Step.add_docstring text startp endp parser)
     | _ -> alternative

(* Interface for recovery *)

let recover = Step.recover
let recovery_env = Step.recovery_env

end
module Reason_multi_parser : sig 
#1 "reason_multi_parser.mli"
type 'a parser

val initial :
  (Lexing.position -> 'a Reason_parser.MenhirInterpreter.checkpoint) ->
  Lexing.position -> 'a parser

type 'a step =
  | Intermediate of 'a parser
  | Success of 'a * Reason_lexer.invalid_docstrings
  | Error

val step : 'a parser -> Reason_parser.token Reason_lexer.positioned -> 'a step

(* Interface for recovery *)

val recover :
  'a Reason_parser.MenhirInterpreter.checkpoint ->
  Reason_lexer.invalid_docstrings ->
  'a parser

val recovery_env :
  'a parser ->
  'a Reason_parser.MenhirInterpreter.env * Reason_lexer.invalid_docstrings

end = struct
#1 "reason_multi_parser.ml"
module S = Reason_single_parser

type 'a parser = 'a S.parser list

let initial entry_point position =
  [S.initial entry_point position]

type 'a step =
  | Intermediate of 'a parser
  | Success of 'a * Reason_lexer.invalid_docstrings
  | Error

let rec fork token = function
  | [] -> []
  | x :: xs ->
    begin match S.step x token with
    | S.Intermediate x' -> x :: x' :: fork token xs
    | _ -> x :: fork token xs
    end

let rec progress_successful token acc = function
  | [] -> Intermediate (List.rev acc)
  | x :: xs ->
    begin match S.step x token with
      | S.Intermediate p ->
        progress_successful token (p :: acc) xs
      | S.Error ->
        progress_successful token acc xs
      | S.Success (result, ds) -> Success (result, ds)
    end

let step parsers token =
  match token with
  | (Reason_parser.ES6_FUN, _, _) ->
    (* Fork case *)
    Intermediate (fork token parsers)
  | _ ->
    (* Regular case *)
    match parsers with
    | [x] ->
      (* Fast-path: One parser *)
      begin match S.step x token with
        | S.Intermediate parser -> Intermediate [parser]
        | S.Success (result, ds) -> Success (result, ds)
        | S.Error -> Error
      end
    (* Parallel parsing case *)
    | x :: xs ->
      begin match S.step x token with
        | S.Intermediate p -> progress_successful token [p] xs
        | S.Success (result, ds) -> Success (result, ds)
        | S.Error ->
          begin match progress_successful token [] xs with
            | Intermediate [] -> Error
            | result -> result
          end
      end
    (* Impossible case *)
    | [] -> assert false

(* Interface for recovery *)

let recover cp ds =
  [S.recover cp ds]

let recovery_env = function
  | [] -> assert false
  | x :: _xs -> S.recovery_env x

end
module Reason_parser_explain_raw
= struct
#1 "reason_parser_explain_raw.ml"
let transitions_on_lident = function
  | 2357
  | 2354
  | 2349
  | 2334
  | 2333
  | 2332
  | 2328
  | 2324
  | 2320
  | 2311
  | 2310
  | 2308
  | 2305
  | 2304
  | 2303
  | 2302
  | 2300
  | 2298
  | 2296
  | 2294
  | 2292
  | 2290
  | 2289
  | 2288
  | 2286
  | 2285
  | 2281
  | 2278
  | 2272
  | 2265
  | 2247
  | 2242
  | 2224
  | 2223
  | 2221
  | 2193
  | 2189
  | 2184
  | 2183
  | 2173
  | 2167
  | 2148
  | 2146
  | 2140
  | 2138
  | 2137
  | 2135
  | 2134
  | 2132
  | 2131
  | 2130
  | 2126
  | 2123
  | 2118
  | 2116
  | 2113
  | 2111
  | 2110
  | 2104
  | 2103
  | 2101
  | 2100
  | 2098
  | 2097
  | 2094
  | 2091
  | 2088
  | 2085
  | 2081
  | 2080
  | 2078
  | 2076
  | 2075
  | 2074
  | 2071
  | 2070
  | 2068
  | 2067
  | 2066
  | 2064
  | 2063
  | 2061
  | 2060
  | 2058
  | 2056
  | 2043
  | 2039
  | 2035
  | 2032
  | 2029
  | 2024
  | 2021
  | 2020
  | 2019
  | 2013
  | 2010
  | 2009
  | 2001
  | 1999
  | 1998
  | 1996
  | 1995
  | 1993
  | 1991
  | 1990
  | 1988
  | 1983
  | 1981
  | 1979
  | 1975
  | 1968
  | 1966
  | 1965
  | 1964
  | 1961
  | 1957
  | 1955
  | 1952
  | 1950
  | 1949
  | 1947
  | 1946
  | 1943
  | 1942
  | 1939
  | 1938
  | 1936
  | 1924
  | 1923
  | 1922
  | 1919
  | 1909
  | 1906
  | 1904
  | 1903
  | 1902
  | 1901
  | 1900
  | 1899
  | 1898
  | 1897
  | 1896
  | 1893
  | 1891
  | 1890
  | 1888
  | 1885
  | 1883
  | 1881
  | 1879
  | 1878
  | 1876
  | 1875
  | 1874
  | 1873
  | 1872
  | 1871
  | 1865
  | 1829
  | 1828
  | 1827
  | 1826
  | 1823
  | 1809
  | 1805
  | 1802
  | 1799
  | 1795
  | 1793
  | 1790
  | 1789
  | 1787
  | 1784
  | 1782
  | 1781
  | 1779
  | 1776
  | 1775
  | 1773
  | 1771
  | 1769
  | 1767
  | 1764
  | 1763
  | 1761
  | 1759
  | 1757
  | 1755
  | 1753
  | 1751
  | 1749
  | 1747
  | 1745
  | 1743
  | 1741
  | 1739
  | 1737
  | 1735
  | 1733
  | 1731
  | 1729
  | 1727
  | 1725
  | 1724
  | 1721
  | 1719
  | 1716
  | 1714
  | 1711
  | 1693
  | 1690
  | 1680
  | 1674
  | 1669
  | 1664
  | 1657
  | 1654
  | 1652
  | 1648
  | 1645
  | 1640
  | 1637
  | 1636
  | 1628
  | 1626
  | 1625
  | 1622
  | 1620
  | 1619
  | 1618
  | 1615
  | 1612
  | 1611
  | 1609
  | 1607
  | 1606
  | 1605
  | 1603
  | 1600
  | 1598
  | 1596
  | 1593
  | 1591
  | 1590
  | 1589
  | 1587
  | 1581
  | 1578
  | 1575
  | 1570
  | 1565
  | 1563
  | 1561
  | 1556
  | 1554
  | 1548
  | 1547
  | 1546
  | 1544
  | 1543
  | 1542
  | 1541
  | 1540
  | 1539
  | 1538
  | 1535
  | 1533
  | 1531
  | 1530
  | 1528
  | 1511
  | 1510
  | 1503
  | 1501
  | 1499
  | 1497
  | 1495
  | 1492
  | 1491
  | 1482
  | 1474
  | 1473
  | 1467
  | 1465
  | 1448
  | 1431
  | 1428
  | 1425
  | 1421
  | 1418
  | 1413
  | 1410
  | 1405
  | 1401
  | 1392
  | 1391
  | 1388
  | 1386
  | 1384
  | 1382
  | 1381
  | 1379
  | 1377
  | 1376
  | 1374
  | 1370
  | 1367
  | 1365
  | 1364
  | 1362
  | 1354
  | 1350
  | 1347
  | 1345
  | 1343
  | 1342
  | 1340
  | 1338
  | 1337
  | 1336
  | 1334
  | 1332
  | 1330
  | 1329
  | 1328
  | 1327
  | 1326
  | 1325
  | 1315
  | 1309
  | 1308
  | 1307
  | 1306
  | 1299
  | 1297
  | 1295
  | 1294
  | 1292
  | 1290
  | 1288
  | 1286
  | 1259
  | 1255
  | 1253
  | 1251
  | 1249
  | 1247
  | 1245
  | 1243
  | 1235
  | 1233
  | 1231
  | 1228
  | 1225
  | 1224
  | 1222
  | 1221
  | 1219
  | 1218
  | 1217
  | 1213
  | 1211
  | 1210
  | 1208
  | 1206
  | 1205
  | 1203
  | 1200
  | 1199
  | 1198
  | 1197
  | 1192
  | 1187
  | 1184
  | 1182
  | 1180
  | 1177
  | 1175
  | 1174
  | 1172
  | 1170
  | 1169
  | 1168
  | 1167
  | 1165
  | 1164
  | 1163
  | 1159
  | 1157
  | 1154
  | 1153
  | 1152
  | 1151
  | 1150
  | 1149
  | 1148
  | 1141
  | 1138
  | 1136
  | 1135
  | 1130
  | 1125
  | 1122
  | 1120
  | 1118
  | 1115
  | 1112
  | 1110
  | 1108
  | 1107
  | 1106
  | 1104
  | 1102
  | 1100
  | 1098
  | 1097
  | 1094
  | 1093
  | 1091
  | 1090
  | 1089
  | 1086
  | 1085
  | 1083
  | 1080
  | 1076
  | 1074
  | 1071
  | 1070
  | 1068
  | 1065
  | 1056
  | 1054
  | 1053
  | 1050
  | 1042
  | 1040
  | 1039
  | 1037
  | 1035
  | 1022
  | 1020
  | 1019
  | 1015
  | 1013
  | 1008
  | 1006
  | 1003
  | 1001
  | 1000
  | 997
  | 995
  | 994
  | 992
  | 991
  | 987
  | 984
  | 982
  | 979
  | 977
  | 976
  | 974
  | 973
  | 972
  | 970
  | 969
  | 967
  | 964
  | 962
  | 961
  | 959
  | 958
  | 957
  | 955
  | 953
  | 952
  | 951
  | 950
  | 949
  | 947
  | 944
  | 941
  | 938
  | 937
  | 936
  | 932
  | 930
  | 928
  | 926
  | 924
  | 922
  | 919
  | 918
  | 916
  | 914
  | 912
  | 910
  | 908
  | 906
  | 904
  | 902
  | 900
  | 898
  | 896
  | 894
  | 892
  | 890
  | 888
  | 886
  | 884
  | 882
  | 881
  | 879
  | 876
  | 874
  | 873
  | 872
  | 870
  | 869
  | 868
  | 866
  | 865
  | 864
  | 862
  | 854
  | 853
  | 846
  | 842
  | 830
  | 827
  | 825
  | 812
  | 803
  | 802
  | 801
  | 800
  | 799
  | 798
  | 796
  | 795
  | 794
  | 793
  | 791
  | 790
  | 789
  | 779
  | 775
  | 773
  | 771
  | 770
  | 768
  | 764
  | 760
  | 758
  | 756
  | 755
  | 752
  | 748
  | 746
  | 735
  | 725
  | 721
  | 718
  | 714
  | 712
  | 707
  | 704
  | 699
  | 695
  | 692
  | 691
  | 690
  | 688
  | 683
  | 679
  | 678
  | 675
  | 673
  | 662
  | 661
  | 660
  | 659
  | 658
  | 657
  | 656
  | 651
  | 649
  | 648
  | 647
  | 646
  | 642
  | 641
  | 640
  | 636
  | 635
  | 634
  | 629
  | 621
  | 619
  | 618
  | 617
  | 615
  | 613
  | 612
  | 608
  | 605
  | 600
  | 586
  | 583
  | 582
  | 579
  | 578
  | 576
  | 575
  | 569
  | 567
  | 566
  | 562
  | 555
  | 549
  | 540
  | 536
  | 534
  | 485
  | 477
  | 470
  | 467
  | 465
  | 463
  | 461
  | 460
  | 458
  | 450
  | 444
  | 437
  | 426
  | 425
  | 420
  | 416
  | 414
  | 406
  | 403
  | 401
  | 394
  | 390
  | 386
  | 381
  | 380
  | 373
  | 369
  | 368
  | 366
  | 362
  | 360
  | 359
  | 354
  | 351
  | 344
  | 343
  | 341
  | 340
  | 339
  | 338
  | 334
  | 332
  | 331
  | 329
  | 326
  | 325
  | 322
  | 317
  | 316
  | 314
  | 313
  | 311
  | 288
  | 287
  | 285
  | 284
  | 283
  | 282
  | 281
  | 280
  | 279
  | 278
  | 277
  | 276
  | 275
  | 274
  | 273
  | 272
  | 271
  | 270
  | 269
  | 268
  | 267
  | 266
  | 265
  | 264
  | 261
  | 257
  | 251
  | 250
  | 249
  | 248
  | 246
  | 245
  | 244
  | 243
  | 242
  | 241
  | 240
  | 239
  | 238
  | 237
  | 236
  | 235
  | 233
  | 231
  | 230
  | 229
  | 228
  | 227
  | 224
  | 223
  | 222
  | 221
  | 220
  | 219
  | 218
  | 217
  | 216
  | 215
  | 213
  | 212
  | 208
  | 207
  | 206
  | 205
  | 203
  | 201
  | 200
  | 199
  | 198
  | 193
  | 192
  | 189
  | 188
  | 187
  | 186
  | 185
  | 184
  | 182
  | 181
  | 180
  | 178
  | 177
  | 175
  | 173
  | 172
  | 169
  | 168
  | 167
  | 166
  | 165
  | 164
  | 163
  | 162
  | 161
  | 160
  | 159
  | 158
  | 157
  | 155
  | 154
  | 153
  | 152
  | 151
  | 150
  | 149
  | 148
  | 146
  | 145
  | 144
  | 143
  | 142
  | 141
  | 140
  | 139
  | 138
  | 137
  | 136
  | 135
  | 133
  | 122
  | 118
  | 114
  | 110
  | 109
  | 108
  | 107
  | 106
  | 105
  | 103
  | 101
  | 99
  | 98
  | 97
  | 96
  | 94
  | 93
  | 92
  | 90
  | 89
  | 88
  | 87
  | 85
  | 84
  | 82
  | 78
  | 75
  | 73
  | 69
  | 67
  | 65
  | 64
  | 63
  | 62
  | 61
  | 58
  | 56
  | 55
  | 54
  | 53
  | 52
  | 51
  | 50
  | 49
  | 48
  | 47
  | 46
  | 45
  | 44
  | 43
  | 42
  | 41
  | 40
  | 39
  | 38
  | 37
  | 36
  | 35
  | 34
  | 33
  | 32
  | 31
  | 30
  | 29
  | 28
  | 27
  | 26
  | 25
  | 24
  | 23
  | 22
  | 21
  | 20
  | 19
  | 18
  | 17
  | 16
  | 15
  | 14
  | 13
  | 12
  | 11
  | 10
  | 9
  | 8
  | 7
  | 6
  | 5
  | 4
  | 3
  | 2
  | 0
      -> true
  | _ -> false

let transitions_on_uident = function
  | 2357
  | 2354
  | 2349
  | 2334
  | 2333
  | 2332
  | 2328
  | 2324
  | 2320
  | 2311
  | 2310
  | 2308
  | 2305
  | 2304
  | 2303
  | 2302
  | 2300
  | 2298
  | 2296
  | 2294
  | 2292
  | 2290
  | 2289
  | 2288
  | 2286
  | 2285
  | 2281
  | 2278
  | 2272
  | 2269
  | 2268
  | 2265
  | 2262
  | 2261
  | 2254
  | 2249
  | 2246
  | 2245
  | 2242
  | 2225
  | 2224
  | 2223
  | 2221
  | 2204
  | 2200
  | 2193
  | 2189
  | 2184
  | 2183
  | 2173
  | 2167
  | 2140
  | 2138
  | 2137
  | 2135
  | 2134
  | 2132
  | 2131
  | 2130
  | 2126
  | 2123
  | 2118
  | 2116
  | 2113
  | 2111
  | 2110
  | 2104
  | 2103
  | 2101
  | 2100
  | 2098
  | 2097
  | 2094
  | 2091
  | 2088
  | 2085
  | 2081
  | 2080
  | 2078
  | 2076
  | 2075
  | 2074
  | 2070
  | 2068
  | 2067
  | 2066
  | 2064
  | 2063
  | 2061
  | 2060
  | 2058
  | 2056
  | 2043
  | 2035
  | 2032
  | 2029
  | 2024
  | 2022
  | 2021
  | 2020
  | 2019
  | 2013
  | 2010
  | 2009
  | 2001
  | 1999
  | 1998
  | 1996
  | 1995
  | 1993
  | 1991
  | 1990
  | 1988
  | 1986
  | 1985
  | 1983
  | 1981
  | 1979
  | 1975
  | 1973
  | 1972
  | 1968
  | 1966
  | 1965
  | 1964
  | 1961
  | 1957
  | 1955
  | 1950
  | 1949
  | 1947
  | 1946
  | 1943
  | 1942
  | 1939
  | 1938
  | 1936
  | 1924
  | 1923
  | 1922
  | 1919
  | 1909
  | 1906
  | 1904
  | 1903
  | 1902
  | 1901
  | 1900
  | 1899
  | 1898
  | 1897
  | 1896
  | 1893
  | 1891
  | 1890
  | 1886
  | 1885
  | 1883
  | 1881
  | 1878
  | 1877
  | 1876
  | 1875
  | 1874
  | 1873
  | 1872
  | 1871
  | 1869
  | 1868
  | 1865
  | 1854
  | 1853
  | 1850
  | 1849
  | 1840
  | 1839
  | 1835
  | 1834
  | 1833
  | 1832
  | 1829
  | 1828
  | 1827
  | 1826
  | 1823
  | 1820
  | 1816
  | 1809
  | 1807
  | 1805
  | 1802
  | 1799
  | 1795
  | 1793
  | 1790
  | 1789
  | 1787
  | 1784
  | 1782
  | 1781
  | 1779
  | 1776
  | 1775
  | 1773
  | 1771
  | 1769
  | 1767
  | 1764
  | 1763
  | 1761
  | 1759
  | 1757
  | 1755
  | 1753
  | 1751
  | 1749
  | 1747
  | 1745
  | 1743
  | 1741
  | 1739
  | 1737
  | 1735
  | 1733
  | 1731
  | 1729
  | 1727
  | 1725
  | 1724
  | 1721
  | 1719
  | 1716
  | 1693
  | 1690
  | 1680
  | 1674
  | 1669
  | 1664
  | 1657
  | 1654
  | 1652
  | 1648
  | 1645
  | 1637
  | 1636
  | 1628
  | 1625
  | 1622
  | 1615
  | 1612
  | 1611
  | 1609
  | 1607
  | 1606
  | 1605
  | 1603
  | 1600
  | 1596
  | 1593
  | 1581
  | 1575
  | 1570
  | 1565
  | 1563
  | 1561
  | 1556
  | 1554
  | 1548
  | 1547
  | 1546
  | 1544
  | 1543
  | 1542
  | 1541
  | 1538
  | 1535
  | 1533
  | 1528
  | 1517
  | 1508
  | 1503
  | 1499
  | 1497
  | 1492
  | 1491
  | 1489
  | 1488
  | 1486
  | 1485
  | 1482
  | 1478
  | 1477
  | 1474
  | 1473
  | 1467
  | 1465
  | 1459
  | 1455
  | 1448
  | 1444
  | 1425
  | 1421
  | 1405
  | 1401
  | 1392
  | 1391
  | 1388
  | 1386
  | 1384
  | 1379
  | 1370
  | 1367
  | 1365
  | 1364
  | 1362
  | 1354
  | 1350
  | 1347
  | 1345
  | 1340
  | 1336
  | 1334
  | 1325
  | 1315
  | 1304
  | 1299
  | 1295
  | 1294
  | 1292
  | 1290
  | 1288
  | 1281
  | 1278
  | 1275
  | 1271
  | 1267
  | 1263
  | 1261
  | 1259
  | 1255
  | 1253
  | 1249
  | 1247
  | 1245
  | 1243
  | 1235
  | 1233
  | 1231
  | 1228
  | 1227
  | 1225
  | 1224
  | 1222
  | 1221
  | 1219
  | 1218
  | 1217
  | 1213
  | 1211
  | 1210
  | 1208
  | 1206
  | 1205
  | 1203
  | 1198
  | 1197
  | 1192
  | 1187
  | 1184
  | 1182
  | 1180
  | 1177
  | 1175
  | 1174
  | 1172
  | 1170
  | 1169
  | 1168
  | 1167
  | 1165
  | 1164
  | 1163
  | 1159
  | 1157
  | 1154
  | 1153
  | 1152
  | 1151
  | 1150
  | 1149
  | 1148
  | 1141
  | 1138
  | 1136
  | 1135
  | 1130
  | 1125
  | 1122
  | 1120
  | 1118
  | 1115
  | 1112
  | 1110
  | 1108
  | 1107
  | 1106
  | 1104
  | 1102
  | 1100
  | 1098
  | 1097
  | 1094
  | 1093
  | 1091
  | 1090
  | 1089
  | 1086
  | 1085
  | 1083
  | 1080
  | 1076
  | 1074
  | 1071
  | 1070
  | 1068
  | 1065
  | 1056
  | 1054
  | 1053
  | 1050
  | 1042
  | 1040
  | 1039
  | 1037
  | 1035
  | 1022
  | 1020
  | 1019
  | 1015
  | 1013
  | 1008
  | 1006
  | 1003
  | 1001
  | 1000
  | 997
  | 995
  | 994
  | 992
  | 991
  | 987
  | 984
  | 982
  | 976
  | 974
  | 973
  | 972
  | 970
  | 969
  | 967
  | 964
  | 962
  | 961
  | 959
  | 958
  | 957
  | 955
  | 953
  | 952
  | 951
  | 950
  | 947
  | 944
  | 941
  | 937
  | 936
  | 932
  | 930
  | 928
  | 926
  | 924
  | 922
  | 919
  | 918
  | 916
  | 914
  | 912
  | 910
  | 908
  | 906
  | 904
  | 902
  | 900
  | 898
  | 896
  | 894
  | 892
  | 890
  | 888
  | 886
  | 884
  | 882
  | 881
  | 879
  | 876
  | 874
  | 873
  | 872
  | 870
  | 869
  | 868
  | 867
  | 866
  | 865
  | 864
  | 862
  | 859
  | 854
  | 853
  | 846
  | 842
  | 837
  | 834
  | 830
  | 827
  | 825
  | 821
  | 812
  | 809
  | 804
  | 803
  | 802
  | 801
  | 800
  | 799
  | 796
  | 795
  | 794
  | 793
  | 791
  | 790
  | 789
  | 779
  | 775
  | 773
  | 770
  | 768
  | 764
  | 760
  | 755
  | 752
  | 748
  | 746
  | 725
  | 721
  | 718
  | 712
  | 707
  | 704
  | 699
  | 695
  | 692
  | 691
  | 690
  | 688
  | 684
  | 683
  | 682
  | 679
  | 678
  | 675
  | 674
  | 673
  | 662
  | 661
  | 660
  | 659
  | 658
  | 657
  | 656
  | 651
  | 649
  | 648
  | 647
  | 646
  | 642
  | 641
  | 640
  | 636
  | 635
  | 634
  | 631
  | 629
  | 621
  | 619
  | 618
  | 617
  | 615
  | 613
  | 608
  | 605
  | 600
  | 593
  | 590
  | 588
  | 586
  | 583
  | 582
  | 579
  | 578
  | 576
  | 575
  | 569
  | 567
  | 566
  | 565
  | 563
  | 562
  | 561
  | 559
  | 558
  | 555
  | 549
  | 540
  | 536
  | 534
  | 523
  | 522
  | 519
  | 518
  | 509
  | 508
  | 504
  | 503
  | 485
  | 477
  | 467
  | 463
  | 450
  | 444
  | 437
  | 426
  | 425
  | 406
  | 403
  | 394
  | 390
  | 386
  | 381
  | 380
  | 373
  | 369
  | 368
  | 366
  | 362
  | 360
  | 359
  | 354
  | 351
  | 344
  | 343
  | 340
  | 339
  | 338
  | 334
  | 332
  | 331
  | 326
  | 325
  | 323
  | 322
  | 321
  | 317
  | 316
  | 314
  | 313
  | 311
  | 288
  | 287
  | 285
  | 284
  | 283
  | 282
  | 281
  | 280
  | 279
  | 278
  | 277
  | 276
  | 275
  | 274
  | 273
  | 272
  | 271
  | 270
  | 269
  | 268
  | 267
  | 266
  | 265
  | 264
  | 261
  | 257
  | 251
  | 250
  | 249
  | 248
  | 247
  | 246
  | 245
  | 244
  | 243
  | 242
  | 241
  | 240
  | 239
  | 238
  | 237
  | 236
  | 235
  | 233
  | 231
  | 230
  | 229
  | 228
  | 227
  | 224
  | 223
  | 222
  | 221
  | 220
  | 219
  | 218
  | 217
  | 216
  | 215
  | 212
  | 208
  | 207
  | 206
  | 205
  | 203
  | 201
  | 200
  | 199
  | 198
  | 197
  | 196
  | 193
  | 192
  | 189
  | 188
  | 187
  | 186
  | 185
  | 184
  | 182
  | 181
  | 180
  | 177
  | 174
  | 173
  | 172
  | 169
  | 168
  | 167
  | 166
  | 165
  | 164
  | 163
  | 162
  | 161
  | 160
  | 159
  | 158
  | 157
  | 151
  | 150
  | 149
  | 148
  | 146
  | 145
  | 144
  | 143
  | 142
  | 141
  | 140
  | 139
  | 138
  | 137
  | 136
  | 135
  | 133
  | 122
  | 118
  | 114
  | 112
  | 110
  | 109
  | 108
  | 107
  | 106
  | 105
  | 103
  | 101
  | 99
  | 98
  | 97
  | 96
  | 94
  | 93
  | 92
  | 90
  | 89
  | 88
  | 87
  | 79
  | 76
  | 74
  | 72
  | 70
  | 67
  | 61
  | 58
  | 56
  | 55
  | 54
  | 53
  | 52
  | 51
  | 50
  | 49
  | 48
  | 47
  | 46
  | 45
  | 44
  | 43
  | 42
  | 41
  | 40
  | 39
  | 38
  | 37
  | 36
  | 35
  | 34
  | 33
  | 32
  | 31
  | 30
  | 29
  | 28
  | 27
  | 26
  | 25
  | 24
  | 23
  | 22
  | 21
  | 20
  | 19
  | 18
  | 17
  | 16
  | 15
  | 14
  | 13
  | 12
  | 11
  | 10
  | 9
  | 8
  | 7
  | 6
  | 5
  | 4
  | 3
  | 2
  | 0
      -> true
  | _ -> false

let transitions_on_semi = function
  | 2356
  | 2353
  | 2346
  | 2344
  | 2341
  | 2340
  | 2339
  | 2338
  | 2337
  | 2336
  | 2335
  | 2334
  | 2312
  | 2306
  | 2304
  | 2302
  | 2301
  | 2300
  | 2298
  | 2296
  | 2294
  | 2292
  | 2289
  | 2287
  | 2285
  | 2284
  | 2283
  | 2282
  | 2279
  | 2277
  | 2275
  | 2272
  | 2270
  | 2263
  | 2260
  | 2259
  | 2258
  | 2257
  | 2256
  | 2255
  | 2253
  | 2252
  | 2251
  | 2250
  | 2248
  | 2244
  | 2243
  | 2241
  | 2240
  | 2239
  | 2238
  | 2237
  | 2236
  | 2235
  | 2234
  | 2233
  | 2232
  | 2230
  | 2229
  | 2228
  | 2227
  | 2226
  | 2222
  | 2220
  | 2219
  | 2218
  | 2217
  | 2216
  | 2215
  | 2214
  | 2213
  | 2211
  | 2210
  | 2208
  | 2207
  | 2206
  | 2205
  | 2201
  | 2199
  | 2198
  | 2197
  | 2196
  | 2195
  | 2194
  | 2192
  | 2186
  | 2185
  | 2182
  | 2181
  | 2180
  | 2178
  | 2170
  | 2167
  | 2165
  | 2157
  | 2145
  | 2140
  | 2138
  | 2137
  | 2135
  | 2134
  | 2132
  | 2130
  | 2126
  | 2123
  | 2120
  | 2113
  | 2110
  | 2108
  | 2106
  | 2095
  | 2094
  | 2091
  | 2088
  | 2086
  | 2085
  | 2082
  | 2080
  | 2078
  | 2076
  | 2074
  | 2070
  | 2068
  | 2066
  | 2063
  | 2060
  | 2058
  | 2054
  | 2019
  | 2007
  | 2001
  | 1999
  | 1998
  | 1996
  | 1995
  | 1991
  | 1990
  | 1987
  | 1978
  | 1974
  | 1967
  | 1949
  | 1946
  | 1942
  | 1936
  | 1922
  | 1915
  | 1914
  | 1912
  | 1906
  | 1905
  | 1903
  | 1902
  | 1901
  | 1899
  | 1898
  | 1896
  | 1895
  | 1893
  | 1891
  | 1890
  | 1889
  | 1887
  | 1885
  | 1883
  | 1882
  | 1878
  | 1875
  | 1874
  | 1870
  | 1863
  | 1862
  | 1861
  | 1860
  | 1859
  | 1858
  | 1857
  | 1856
  | 1855
  | 1851
  | 1848
  | 1847
  | 1846
  | 1845
  | 1844
  | 1843
  | 1842
  | 1841
  | 1837
  | 1836
  | 1831
  | 1830
  | 1828
  | 1827
  | 1826
  | 1825
  | 1824
  | 1823
  | 1822
  | 1818
  | 1815
  | 1813
  | 1812
  | 1811
  | 1808
  | 1805
  | 1803
  | 1801
  | 1800
  | 1798
  | 1794
  | 1792
  | 1788
  | 1786
  | 1783
  | 1782
  | 1781
  | 1778
  | 1777
  | 1775
  | 1774
  | 1772
  | 1770
  | 1768
  | 1766
  | 1765
  | 1762
  | 1760
  | 1758
  | 1756
  | 1754
  | 1752
  | 1750
  | 1748
  | 1746
  | 1744
  | 1742
  | 1740
  | 1738
  | 1736
  | 1734
  | 1732
  | 1728
  | 1726
  | 1724
  | 1723
  | 1722
  | 1720
  | 1718
  | 1717
  | 1716
  | 1715
  | 1712
  | 1710
  | 1709
  | 1708
  | 1704
  | 1703
  | 1699
  | 1695
  | 1692
  | 1686
  | 1682
  | 1677
  | 1676
  | 1675
  | 1673
  | 1671
  | 1668
  | 1666
  | 1664
  | 1661
  | 1660
  | 1659
  | 1658
  | 1655
  | 1653
  | 1652
  | 1651
  | 1650
  | 1648
  | 1647
  | 1646
  | 1642
  | 1641
  | 1639
  | 1638
  | 1637
  | 1636
  | 1635
  | 1634
  | 1633
  | 1630
  | 1623
  | 1617
  | 1616
  | 1614
  | 1613
  | 1610
  | 1608
  | 1604
  | 1601
  | 1597
  | 1594
  | 1588
  | 1586
  | 1582
  | 1580
  | 1579
  | 1577
  | 1576
  | 1571
  | 1566
  | 1562
  | 1560
  | 1559
  | 1558
  | 1557
  | 1552
  | 1551
  | 1550
  | 1549
  | 1545
  | 1542
  | 1538
  | 1528
  | 1526
  | 1525
  | 1524
  | 1523
  | 1522
  | 1521
  | 1519
  | 1518
  | 1515
  | 1514
  | 1513
  | 1512
  | 1509
  | 1507
  | 1505
  | 1504
  | 1500
  | 1498
  | 1494
  | 1493
  | 1490
  | 1487
  | 1480
  | 1479
  | 1476
  | 1475
  | 1473
  | 1472
  | 1471
  | 1464
  | 1463
  | 1462
  | 1461
  | 1457
  | 1454
  | 1451
  | 1450
  | 1449
  | 1446
  | 1445
  | 1442
  | 1441
  | 1439
  | 1437
  | 1436
  | 1435
  | 1434
  | 1433
  | 1432
  | 1429
  | 1427
  | 1426
  | 1423
  | 1422
  | 1417
  | 1416
  | 1415
  | 1414
  | 1411
  | 1409
  | 1408
  | 1407
  | 1406
  | 1404
  | 1401
  | 1400
  | 1399
  | 1396
  | 1394
  | 1393
  | 1392
  | 1391
  | 1390
  | 1389
  | 1387
  | 1385
  | 1380
  | 1375
  | 1373
  | 1371
  | 1369
  | 1368
  | 1364
  | 1363
  | 1361
  | 1360
  | 1359
  | 1358
  | 1353
  | 1352
  | 1351
  | 1348
  | 1346
  | 1341
  | 1336
  | 1335
  | 1331
  | 1325
  | 1305
  | 1303
  | 1301
  | 1300
  | 1296
  | 1293
  | 1289
  | 1285
  | 1284
  | 1283
  | 1282
  | 1280
  | 1279
  | 1277
  | 1276
  | 1274
  | 1272
  | 1270
  | 1268
  | 1266
  | 1265
  | 1262
  | 1260
  | 1259
  | 1258
  | 1257
  | 1255
  | 1254
  | 1250
  | 1240
  | 1239
  | 1238
  | 1234
  | 1232
  | 1228
  | 1226
  | 1223
  | 1222
  | 1219
  | 1218
  | 1215
  | 1214
  | 1212
  | 1211
  | 1206
  | 1197
  | 1192
  | 1187
  | 1183
  | 1182
  | 1181
  | 1175
  | 1166
  | 1164
  | 1163
  | 1161
  | 1153
  | 1152
  | 1146
  | 1145
  | 1144
  | 1143
  | 1142
  | 1135
  | 1130
  | 1125
  | 1121
  | 1120
  | 1119
  | 1111
  | 1103
  | 1099
  | 1098
  | 1097
  | 1093
  | 1089
  | 1087
  | 1086
  | 1085
  | 1084
  | 1082
  | 1081
  | 1079
  | 1075
  | 1073
  | 1069
  | 1067
  | 1065
  | 1061
  | 1058
  | 1057
  | 1055
  | 1051
  | 1047
  | 1044
  | 1043
  | 1041
  | 1037
  | 1035
  | 1025
  | 1023
  | 1021
  | 1017
  | 1016
  | 1014
  | 993
  | 991
  | 982
  | 976
  | 974
  | 972
  | 969
  | 967
  | 961
  | 957
  | 953
  | 951
  | 950
  | 941
  | 936
  | 932
  | 931
  | 929
  | 927
  | 925
  | 923
  | 921
  | 920
  | 917
  | 915
  | 913
  | 911
  | 909
  | 907
  | 905
  | 903
  | 901
  | 899
  | 897
  | 895
  | 893
  | 891
  | 887
  | 885
  | 883
  | 881
  | 877
  | 875
  | 873
  | 872
  | 871
  | 870
  | 869
  | 864
  | 860
  | 841
  | 838
  | 836
  | 823
  | 819
  | 818
  | 815
  | 814
  | 807
  | 801
  | 799
  | 797
  | 794
  | 792
  | 750
  | 743
  | 738
  | 733
  | 732
  | 729
  | 728
  | 727
  | 724
  | 722
  | 720
  | 717
  | 715
  | 713
  | 712
  | 711
  | 710
  | 709
  | 706
  | 703
  | 698
  | 693
  | 691
  | 682
  | 681
  | 680
  | 678
  | 677
  | 676
  | 673
  | 672
  | 671
  | 669
  | 668
  | 667
  | 666
  | 665
  | 664
  | 663
  | 661
  | 644
  | 638
  | 633
  | 628
  | 627
  | 625
  | 624
  | 622
  | 620
  | 616
  | 611
  | 610
  | 609
  | 607
  | 606
  | 603
  | 602
  | 601
  | 598
  | 596
  | 595
  | 594
  | 591
  | 587
  | 585
  | 584
  | 579
  | 576
  | 573
  | 572
  | 571
  | 570
  | 568
  | 564
  | 560
  | 553
  | 552
  | 551
  | 550
  | 547
  | 546
  | 545
  | 544
  | 543
  | 542
  | 541
  | 539
  | 538
  | 537
  | 533
  | 532
  | 531
  | 530
  | 529
  | 528
  | 527
  | 526
  | 525
  | 524
  | 520
  | 517
  | 516
  | 515
  | 514
  | 513
  | 512
  | 511
  | 510
  | 506
  | 505
  | 502
  | 501
  | 500
  | 499
  | 498
  | 497
  | 495
  | 494
  | 492
  | 491
  | 490
  | 489
  | 488
  | 487
  | 486
  | 484
  | 483
  | 482
  | 475
  | 473
  | 447
  | 444
  | 424
  | 422
  | 419
  | 397
  | 392
  | 391
  | 387
  | 374
  | 371
  | 370
  | 369
  | 368
  | 367
  | 365
  | 364
  | 363
  | 360
  | 357
  | 356
  | 355
  | 353
  | 348
  | 347
  | 346
  | 345
  | 344
  | 333
  | 328
  | 324
  | 320
  | 318
  | 316
  | 311
  | 284
  | 281
  | 279
  | 278
  | 276
  | 275
  | 274
  | 273
  | 272
  | 271
  | 270
  | 264
  | 244
  | 243
  | 242
  | 241
  | 240
  | 239
  | 238
  | 237
  | 236
  | 232
  | 231
  | 230
  | 229
  | 228
  | 224
  | 222
  | 220
  | 219
  | 218
  | 217
  | 212
  | 208
  | 203
  | 199
  | 172
  | 168
  | 161
  | 151
  | 144
  | 143
  | 136
  | 134
  | 132
  | 125
  | 111
  | 109
  | 108
  | 102
  | 100
  | 99
  | 98
  | 95
  | 94
  | 93
  | 90
  | 89
  | 84
  | 82
  | 78
  | 75
  | 73
  | 69
  | 68
  | 61
      -> true
  | _ -> false

let transitions_on_rbracket = function
  | 2312
  | 2306
  | 2304
  | 2302
  | 2300
  | 2298
  | 2296
  | 2294
  | 2292
  | 2289
  | 2285
  | 2277
  | 2275
  | 2272
  | 2271
  | 2270
  | 2263
  | 2260
  | 2259
  | 2258
  | 2257
  | 2256
  | 2255
  | 2253
  | 2252
  | 2251
  | 2250
  | 2248
  | 2244
  | 2243
  | 2241
  | 2240
  | 2239
  | 2238
  | 2237
  | 2236
  | 2235
  | 2234
  | 2233
  | 2232
  | 2230
  | 2229
  | 2228
  | 2227
  | 2226
  | 2224
  | 2222
  | 2220
  | 2219
  | 2218
  | 2217
  | 2216
  | 2215
  | 2214
  | 2213
  | 2212
  | 2211
  | 2210
  | 2208
  | 2207
  | 2206
  | 2205
  | 2203
  | 2201
  | 2199
  | 2198
  | 2197
  | 2196
  | 2195
  | 2194
  | 2193
  | 2192
  | 2186
  | 2185
  | 2182
  | 2181
  | 2180
  | 2178
  | 2177
  | 2176
  | 2175
  | 2174
  | 2171
  | 2170
  | 2169
  | 2168
  | 2167
  | 2166
  | 2165
  | 2157
  | 2145
  | 2140
  | 2138
  | 2137
  | 2135
  | 2134
  | 2133
  | 2132
  | 2131
  | 2130
  | 2129
  | 2128
  | 2126
  | 2123
  | 2121
  | 2120
  | 2113
  | 2110
  | 2108
  | 2106
  | 2095
  | 2094
  | 2092
  | 2091
  | 2088
  | 2086
  | 2085
  | 2082
  | 2080
  | 2078
  | 2076
  | 2074
  | 2070
  | 2069
  | 2068
  | 2067
  | 2066
  | 2063
  | 2062
  | 2060
  | 2058
  | 2054
  | 2037
  | 2035
  | 2030
  | 2019
  | 2011
  | 2007
  | 2001
  | 1999
  | 1998
  | 1996
  | 1995
  | 1991
  | 1990
  | 1958
  | 1949
  | 1946
  | 1943
  | 1942
  | 1936
  | 1922
  | 1915
  | 1914
  | 1912
  | 1911
  | 1910
  | 1907
  | 1906
  | 1905
  | 1903
  | 1902
  | 1901
  | 1899
  | 1898
  | 1896
  | 1895
  | 1893
  | 1891
  | 1890
  | 1889
  | 1887
  | 1885
  | 1883
  | 1878
  | 1875
  | 1874
  | 1870
  | 1863
  | 1862
  | 1861
  | 1860
  | 1859
  | 1858
  | 1857
  | 1856
  | 1855
  | 1851
  | 1848
  | 1847
  | 1846
  | 1845
  | 1844
  | 1843
  | 1842
  | 1841
  | 1837
  | 1836
  | 1831
  | 1830
  | 1828
  | 1827
  | 1826
  | 1825
  | 1824
  | 1823
  | 1822
  | 1818
  | 1815
  | 1813
  | 1812
  | 1811
  | 1808
  | 1805
  | 1803
  | 1801
  | 1800
  | 1798
  | 1794
  | 1792
  | 1791
  | 1788
  | 1786
  | 1785
  | 1783
  | 1782
  | 1781
  | 1780
  | 1779
  | 1778
  | 1777
  | 1775
  | 1774
  | 1772
  | 1770
  | 1768
  | 1766
  | 1765
  | 1762
  | 1760
  | 1758
  | 1756
  | 1754
  | 1752
  | 1750
  | 1748
  | 1746
  | 1744
  | 1742
  | 1740
  | 1738
  | 1736
  | 1734
  | 1732
  | 1728
  | 1726
  | 1724
  | 1723
  | 1722
  | 1720
  | 1718
  | 1717
  | 1716
  | 1715
  | 1712
  | 1710
  | 1709
  | 1708
  | 1704
  | 1703
  | 1699
  | 1695
  | 1692
  | 1686
  | 1682
  | 1677
  | 1676
  | 1675
  | 1673
  | 1671
  | 1668
  | 1666
  | 1664
  | 1661
  | 1660
  | 1659
  | 1658
  | 1655
  | 1653
  | 1652
  | 1648
  | 1637
  | 1636
  | 1608
  | 1576
  | 1571
  | 1566
  | 1562
  | 1560
  | 1559
  | 1558
  | 1557
  | 1552
  | 1551
  | 1550
  | 1549
  | 1542
  | 1538
  | 1529
  | 1528
  | 1527
  | 1526
  | 1525
  | 1524
  | 1523
  | 1522
  | 1521
  | 1519
  | 1518
  | 1515
  | 1514
  | 1513
  | 1512
  | 1509
  | 1507
  | 1505
  | 1500
  | 1498
  | 1494
  | 1493
  | 1490
  | 1487
  | 1480
  | 1479
  | 1476
  | 1475
  | 1473
  | 1472
  | 1471
  | 1464
  | 1463
  | 1462
  | 1461
  | 1457
  | 1454
  | 1451
  | 1450
  | 1449
  | 1446
  | 1445
  | 1442
  | 1441
  | 1440
  | 1439
  | 1438
  | 1437
  | 1436
  | 1435
  | 1434
  | 1433
  | 1432
  | 1429
  | 1427
  | 1426
  | 1423
  | 1422
  | 1417
  | 1416
  | 1415
  | 1414
  | 1411
  | 1409
  | 1408
  | 1407
  | 1406
  | 1404
  | 1401
  | 1399
  | 1392
  | 1391
  | 1364
  | 1363
  | 1360
  | 1359
  | 1358
  | 1353
  | 1352
  | 1351
  | 1348
  | 1336
  | 1325
  | 1305
  | 1303
  | 1301
  | 1296
  | 1294
  | 1293
  | 1289
  | 1285
  | 1284
  | 1283
  | 1282
  | 1280
  | 1279
  | 1277
  | 1276
  | 1274
  | 1273
  | 1272
  | 1270
  | 1268
  | 1266
  | 1265
  | 1262
  | 1260
  | 1259
  | 1258
  | 1257
  | 1255
  | 1250
  | 1240
  | 1239
  | 1238
  | 1234
  | 1232
  | 1228
  | 1226
  | 1223
  | 1222
  | 1219
  | 1218
  | 1215
  | 1214
  | 1212
  | 1211
  | 1206
  | 1197
  | 1192
  | 1187
  | 1183
  | 1182
  | 1181
  | 1175
  | 1166
  | 1164
  | 1163
  | 1161
  | 1153
  | 1152
  | 1147
  | 1146
  | 1145
  | 1144
  | 1143
  | 1142
  | 1135
  | 1130
  | 1125
  | 1121
  | 1120
  | 1119
  | 1111
  | 1103
  | 1099
  | 1098
  | 1097
  | 1093
  | 1092
  | 1089
  | 1088
  | 1087
  | 1086
  | 1085
  | 1084
  | 1082
  | 1081
  | 1079
  | 1075
  | 1073
  | 1072
  | 1069
  | 1067
  | 1066
  | 1065
  | 1037
  | 1035
  | 991
  | 982
  | 976
  | 975
  | 974
  | 973
  | 972
  | 969
  | 967
  | 961
  | 960
  | 957
  | 956
  | 954
  | 953
  | 951
  | 950
  | 946
  | 943
  | 941
  | 940
  | 936
  | 932
  | 931
  | 929
  | 927
  | 925
  | 923
  | 921
  | 920
  | 917
  | 915
  | 913
  | 911
  | 909
  | 907
  | 905
  | 903
  | 901
  | 899
  | 897
  | 895
  | 893
  | 891
  | 887
  | 885
  | 883
  | 881
  | 877
  | 875
  | 873
  | 872
  | 871
  | 870
  | 869
  | 864
  | 860
  | 841
  | 838
  | 836
  | 823
  | 819
  | 818
  | 815
  | 814
  | 807
  | 801
  | 799
  | 797
  | 794
  | 792
  | 751
  | 750
  | 743
  | 741
  | 740
  | 739
  | 738
  | 733
  | 732
  | 729
  | 728
  | 727
  | 724
  | 723
  | 722
  | 721
  | 720
  | 717
  | 715
  | 713
  | 712
  | 711
  | 710
  | 709
  | 706
  | 705
  | 704
  | 703
  | 698
  | 693
  | 691
  | 682
  | 681
  | 680
  | 678
  | 677
  | 676
  | 673
  | 672
  | 671
  | 669
  | 668
  | 667
  | 666
  | 665
  | 664
  | 663
  | 661
  | 646
  | 645
  | 644
  | 643
  | 642
  | 638
  | 633
  | 628
  | 627
  | 625
  | 624
  | 622
  | 620
  | 618
  | 616
  | 611
  | 610
  | 609
  | 607
  | 606
  | 603
  | 602
  | 601
  | 598
  | 596
  | 595
  | 594
  | 591
  | 587
  | 585
  | 584
  | 579
  | 576
  | 573
  | 572
  | 571
  | 570
  | 568
  | 564
  | 560
  | 553
  | 552
  | 551
  | 550
  | 547
  | 546
  | 545
  | 544
  | 543
  | 542
  | 541
  | 539
  | 538
  | 537
  | 533
  | 532
  | 531
  | 530
  | 529
  | 528
  | 527
  | 526
  | 525
  | 524
  | 520
  | 517
  | 516
  | 515
  | 514
  | 513
  | 512
  | 511
  | 510
  | 506
  | 505
  | 502
  | 501
  | 500
  | 499
  | 498
  | 497
  | 496
  | 495
  | 494
  | 492
  | 491
  | 490
  | 489
  | 488
  | 487
  | 486
  | 484
  | 483
  | 482
  | 475
  | 473
  | 457
  | 456
  | 454
  | 453
  | 452
  | 451
  | 448
  | 447
  | 446
  | 445
  | 444
  | 443
  | 442
  | 441
  | 440
  | 438
  | 435
  | 434
  | 433
  | 431
  | 430
  | 427
  | 424
  | 422
  | 419
  | 397
  | 387
  | 374
  | 371
  | 370
  | 369
  | 368
  | 367
  | 365
  | 364
  | 363
  | 360
  | 357
  | 356
  | 355
  | 353
  | 348
  | 347
  | 346
  | 345
  | 344
  | 328
  | 324
  | 320
  | 318
  | 316
  | 311
  | 284
  | 281
  | 279
  | 278
  | 276
  | 275
  | 274
  | 273
  | 272
  | 271
  | 270
  | 264
  | 244
  | 243
  | 242
  | 241
  | 240
  | 239
  | 238
  | 237
  | 236
  | 234
  | 232
  | 231
  | 230
  | 229
  | 228
  | 224
  | 222
  | 220
  | 219
  | 218
  | 217
  | 212
  | 211
  | 210
  | 209
  | 208
  | 207
  | 205
  | 203
  | 199
  | 172
  | 168
  | 161
  | 151
  | 144
  | 143
  | 140
  | 138
  | 136
  | 134
  | 132
  | 125
  | 111
  | 109
  | 108
  | 107
  | 102
  | 100
  | 99
  | 98
  | 95
  | 94
  | 93
  | 90
  | 89
  | 84
  | 82
  | 78
  | 75
  | 73
  | 69
  | 68
  | 61
  | 55
  | 53
  | 52
  | 51
  | 50
  | 49
  | 48
  | 47
  | 46
  | 45
  | 44
  | 43
  | 42
  | 41
  | 40
  | 39
  | 38
  | 37
  | 36
  | 35
  | 34
  | 33
  | 32
  | 31
  | 30
  | 29
  | 28
  | 27
  | 26
  | 25
  | 24
  | 23
  | 22
  | 21
  | 20
  | 19
  | 18
  | 17
  | 16
  | 15
  | 14
  | 13
  | 12
  | 11
  | 10
  | 9
  | 8
  | 7
  | 6
  | 5
  | 4
  | 3
      -> true
  | _ -> false

let transitions_on_rparen = function
  | 2309
  | 2307
  | 2306
  | 2304
  | 2302
  | 2300
  | 2298
  | 2296
  | 2294
  | 2292
  | 2289
  | 2285
  | 2277
  | 2275
  | 2274
  | 2273
  | 2272
  | 2223
  | 2209
  | 2202
  | 2192
  | 2191
  | 2190
  | 2189
  | 2188
  | 2187
  | 2184
  | 2179
  | 2178
  | 2170
  | 2158
  | 2157
  | 2145
  | 2140
  | 2138
  | 2137
  | 2136
  | 2135
  | 2134
  | 2132
  | 2130
  | 2126
  | 2123
  | 2120
  | 2119
  | 2114
  | 2113
  | 2112
  | 2110
  | 2109
  | 2108
  | 2107
  | 2106
  | 2105
  | 2102
  | 2099
  | 2096
  | 2095
  | 2094
  | 2091
  | 2088
  | 2086
  | 2085
  | 2084
  | 2083
  | 2082
  | 2080
  | 2078
  | 2076
  | 2074
  | 2070
  | 2068
  | 2066
  | 2063
  | 2060
  | 2059
  | 2058
  | 2057
  | 2054
  | 2027
  | 2025
  | 2019
  | 2001
  | 1999
  | 1998
  | 1996
  | 1995
  | 1991
  | 1990
  | 1949
  | 1946
  | 1942
  | 1941
  | 1940
  | 1938
  | 1937
  | 1936
  | 1935
  | 1934
  | 1933
  | 1932
  | 1931
  | 1930
  | 1929
  | 1928
  | 1927
  | 1926
  | 1925
  | 1922
  | 1921
  | 1920
  | 1917
  | 1916
  | 1915
  | 1914
  | 1906
  | 1903
  | 1902
  | 1901
  | 1899
  | 1898
  | 1896
  | 1893
  | 1891
  | 1890
  | 1885
  | 1883
  | 1878
  | 1875
  | 1874
  | 1828
  | 1827
  | 1826
  | 1823
  | 1805
  | 1782
  | 1781
  | 1775
  | 1724
  | 1716
  | 1706
  | 1705
  | 1701
  | 1700
  | 1697
  | 1696
  | 1693
  | 1690
  | 1688
  | 1687
  | 1684
  | 1683
  | 1680
  | 1671
  | 1670
  | 1668
  | 1667
  | 1666
  | 1664
  | 1652
  | 1648
  | 1637
  | 1636
  | 1576
  | 1573
  | 1572
  | 1571
  | 1568
  | 1567
  | 1566
  | 1563
  | 1562
  | 1560
  | 1559
  | 1558
  | 1557
  | 1554
  | 1552
  | 1551
  | 1550
  | 1549
  | 1542
  | 1538
  | 1533
  | 1473
  | 1426
  | 1422
  | 1404
  | 1401
  | 1399
  | 1392
  | 1391
  | 1364
  | 1363
  | 1360
  | 1359
  | 1358
  | 1357
  | 1356
  | 1355
  | 1353
  | 1352
  | 1351
  | 1348
  | 1336
  | 1325
  | 1322
  | 1321
  | 1320
  | 1319
  | 1318
  | 1317
  | 1316
  | 1269
  | 1264
  | 1259
  | 1255
  | 1248
  | 1228
  | 1222
  | 1219
  | 1218
  | 1215
  | 1214
  | 1212
  | 1211
  | 1206
  | 1197
  | 1194
  | 1193
  | 1192
  | 1189
  | 1188
  | 1187
  | 1184
  | 1182
  | 1177
  | 1175
  | 1164
  | 1163
  | 1162
  | 1160
  | 1155
  | 1154
  | 1153
  | 1152
  | 1146
  | 1145
  | 1144
  | 1143
  | 1142
  | 1135
  | 1132
  | 1131
  | 1130
  | 1127
  | 1126
  | 1125
  | 1122
  | 1121
  | 1120
  | 1119
  | 1113
  | 1111
  | 1109
  | 1103
  | 1099
  | 1098
  | 1097
  | 1093
  | 1089
  | 1087
  | 1086
  | 1085
  | 1084
  | 1082
  | 1081
  | 1079
  | 1075
  | 1073
  | 1069
  | 1067
  | 1065
  | 1037
  | 1035
  | 991
  | 982
  | 976
  | 974
  | 972
  | 969
  | 967
  | 961
  | 957
  | 953
  | 951
  | 950
  | 941
  | 936
  | 935
  | 934
  | 933
  | 932
  | 931
  | 929
  | 927
  | 925
  | 923
  | 921
  | 920
  | 917
  | 915
  | 913
  | 911
  | 909
  | 907
  | 905
  | 903
  | 901
  | 899
  | 897
  | 895
  | 893
  | 891
  | 887
  | 885
  | 883
  | 881
  | 880
  | 879
  | 878
  | 877
  | 875
  | 873
  | 872
  | 871
  | 870
  | 869
  | 868
  | 867
  | 866
  | 865
  | 864
  | 863
  | 861
  | 860
  | 855
  | 850
  | 848
  | 847
  | 846
  | 845
  | 844
  | 842
  | 841
  | 840
  | 839
  | 838
  | 836
  | 835
  | 831
  | 830
  | 828
  | 826
  | 825
  | 823
  | 822
  | 821
  | 820
  | 819
  | 818
  | 817
  | 816
  | 815
  | 814
  | 813
  | 811
  | 810
  | 809
  | 807
  | 801
  | 799
  | 797
  | 794
  | 792
  | 785
  | 784
  | 783
  | 781
  | 780
  | 779
  | 778
  | 777
  | 775
  | 773
  | 765
  | 763
  | 762
  | 761
  | 759
  | 757
  | 755
  | 750
  | 749
  | 744
  | 743
  | 738
  | 733
  | 732
  | 731
  | 730
  | 729
  | 728
  | 727
  | 724
  | 722
  | 720
  | 717
  | 716
  | 715
  | 713
  | 712
  | 711
  | 710
  | 709
  | 706
  | 703
  | 698
  | 697
  | 696
  | 695
  | 694
  | 693
  | 691
  | 689
  | 687
  | 686
  | 683
  | 682
  | 681
  | 680
  | 678
  | 677
  | 676
  | 675
  | 673
  | 672
  | 671
  | 669
  | 668
  | 667
  | 666
  | 665
  | 664
  | 663
  | 661
  | 658
  | 644
  | 639
  | 638
  | 637
  | 633
  | 632
  | 630
  | 629
  | 628
  | 627
  | 625
  | 624
  | 622
  | 620
  | 609
  | 607
  | 606
  | 603
  | 602
  | 601
  | 598
  | 596
  | 595
  | 594
  | 591
  | 587
  | 585
  | 584
  | 579
  | 576
  | 572
  | 571
  | 570
  | 539
  | 538
  | 537
  | 493
  | 486
  | 481
  | 480
  | 479
  | 478
  | 477
  | 476
  | 474
  | 473
  | 447
  | 444
  | 424
  | 422
  | 419
  | 397
  | 387
  | 383
  | 382
  | 380
  | 379
  | 378
  | 377
  | 376
  | 375
  | 374
  | 371
  | 370
  | 369
  | 368
  | 367
  | 365
  | 364
  | 363
  | 360
  | 357
  | 356
  | 355
  | 353
  | 352
  | 351
  | 350
  | 349
  | 348
  | 347
  | 346
  | 345
  | 328
  | 316
  | 312
  | 311
  | 310
  | 309
  | 308
  | 307
  | 306
  | 305
  | 304
  | 303
  | 302
  | 301
  | 300
  | 299
  | 298
  | 297
  | 296
  | 295
  | 293
  | 292
  | 291
  | 290
  | 289
  | 286
  | 284
  | 283
  | 282
  | 281
  | 279
  | 278
  | 276
  | 275
  | 274
  | 273
  | 272
  | 271
  | 270
  | 264
  | 244
  | 243
  | 242
  | 241
  | 240
  | 239
  | 238
  | 237
  | 236
  | 232
  | 231
  | 230
  | 229
  | 228
  | 224
  | 223
  | 222
  | 220
  | 219
  | 218
  | 217
  | 212
  | 208
  | 203
  | 199
  | 197
  | 195
  | 194
  | 193
  | 192
  | 191
  | 190
  | 189
  | 183
  | 173
  | 172
  | 171
  | 170
  | 169
  | 168
  | 162
  | 161
  | 151
  | 148
  | 144
  | 143
  | 136
  | 131
  | 130
  | 129
  | 128
  | 127
  | 126
  | 124
  | 123
  | 121
  | 119
  | 117
  | 115
  | 113
  | 109
  | 108
  | 103
  | 102
  | 100
  | 99
  | 98
  | 95
  | 94
  | 93
  | 90
  | 89
  | 84
  | 83
  | 82
  | 81
  | 80
  | 78
  | 77
  | 75
  | 73
  | 71
  | 69
  | 68
  | 61
      -> true
  | _ -> false

let transitions_on_rbrace = function
  | 2312
  | 2306
  | 2304
  | 2302
  | 2301
  | 2300
  | 2299
  | 2298
  | 2297
  | 2296
  | 2295
  | 2294
  | 2293
  | 2292
  | 2291
  | 2290
  | 2289
  | 2288
  | 2287
  | 2285
  | 2284
  | 2283
  | 2282
  | 2279
  | 2277
  | 2275
  | 2272
  | 2270
  | 2263
  | 2260
  | 2259
  | 2258
  | 2257
  | 2256
  | 2255
  | 2253
  | 2252
  | 2251
  | 2250
  | 2248
  | 2244
  | 2243
  | 2241
  | 2240
  | 2239
  | 2238
  | 2237
  | 2236
  | 2235
  | 2234
  | 2233
  | 2232
  | 2230
  | 2229
  | 2228
  | 2227
  | 2226
  | 2222
  | 2220
  | 2219
  | 2218
  | 2217
  | 2216
  | 2215
  | 2214
  | 2213
  | 2211
  | 2210
  | 2208
  | 2207
  | 2206
  | 2205
  | 2201
  | 2199
  | 2198
  | 2197
  | 2196
  | 2195
  | 2194
  | 2192
  | 2186
  | 2185
  | 2182
  | 2181
  | 2180
  | 2178
  | 2170
  | 2167
  | 2165
  | 2164
  | 2163
  | 2157
  | 2156
  | 2155
  | 2145
  | 2144
  | 2143
  | 2140
  | 2138
  | 2137
  | 2135
  | 2134
  | 2132
  | 2130
  | 2126
  | 2123
  | 2120
  | 2113
  | 2110
  | 2108
  | 2106
  | 2095
  | 2094
  | 2091
  | 2088
  | 2086
  | 2085
  | 2082
  | 2080
  | 2079
  | 2078
  | 2077
  | 2076
  | 2075
  | 2074
  | 2070
  | 2068
  | 2066
  | 2063
  | 2060
  | 2058
  | 2054
  | 2053
  | 2047
  | 2045
  | 2043
  | 2019
  | 2015
  | 2014
  | 2008
  | 2007
  | 2006
  | 2005
  | 2004
  | 2003
  | 2002
  | 2001
  | 2000
  | 1999
  | 1998
  | 1997
  | 1996
  | 1995
  | 1994
  | 1992
  | 1991
  | 1990
  | 1989
  | 1980
  | 1976
  | 1970
  | 1969
  | 1949
  | 1946
  | 1942
  | 1936
  | 1922
  | 1915
  | 1914
  | 1913
  | 1912
  | 1906
  | 1905
  | 1903
  | 1902
  | 1901
  | 1899
  | 1898
  | 1896
  | 1895
  | 1893
  | 1891
  | 1890
  | 1889
  | 1887
  | 1885
  | 1883
  | 1878
  | 1875
  | 1874
  | 1870
  | 1863
  | 1862
  | 1861
  | 1860
  | 1859
  | 1858
  | 1857
  | 1856
  | 1855
  | 1851
  | 1848
  | 1847
  | 1846
  | 1845
  | 1844
  | 1843
  | 1842
  | 1841
  | 1837
  | 1836
  | 1831
  | 1830
  | 1828
  | 1827
  | 1826
  | 1825
  | 1824
  | 1823
  | 1822
  | 1818
  | 1815
  | 1813
  | 1812
  | 1811
  | 1808
  | 1805
  | 1803
  | 1801
  | 1800
  | 1798
  | 1797
  | 1796
  | 1794
  | 1792
  | 1788
  | 1786
  | 1783
  | 1782
  | 1781
  | 1780
  | 1779
  | 1778
  | 1777
  | 1775
  | 1774
  | 1772
  | 1770
  | 1768
  | 1766
  | 1765
  | 1762
  | 1760
  | 1758
  | 1756
  | 1754
  | 1752
  | 1750
  | 1748
  | 1746
  | 1744
  | 1742
  | 1740
  | 1738
  | 1736
  | 1734
  | 1732
  | 1728
  | 1726
  | 1724
  | 1722
  | 1720
  | 1718
  | 1717
  | 1716
  | 1715
  | 1712
  | 1710
  | 1709
  | 1708
  | 1704
  | 1703
  | 1699
  | 1695
  | 1692
  | 1686
  | 1682
  | 1677
  | 1676
  | 1675
  | 1673
  | 1672
  | 1671
  | 1668
  | 1666
  | 1665
  | 1664
  | 1663
  | 1662
  | 1661
  | 1660
  | 1659
  | 1658
  | 1655
  | 1653
  | 1652
  | 1650
  | 1649
  | 1648
  | 1647
  | 1646
  | 1643
  | 1642
  | 1641
  | 1639
  | 1638
  | 1637
  | 1636
  | 1635
  | 1634
  | 1633
  | 1630
  | 1623
  | 1617
  | 1616
  | 1614
  | 1613
  | 1610
  | 1608
  | 1604
  | 1601
  | 1597
  | 1594
  | 1588
  | 1586
  | 1585
  | 1584
  | 1583
  | 1582
  | 1580
  | 1579
  | 1577
  | 1576
  | 1571
  | 1566
  | 1562
  | 1560
  | 1559
  | 1558
  | 1557
  | 1552
  | 1551
  | 1550
  | 1549
  | 1545
  | 1542
  | 1538
  | 1526
  | 1525
  | 1524
  | 1523
  | 1522
  | 1521
  | 1519
  | 1518
  | 1515
  | 1514
  | 1513
  | 1512
  | 1509
  | 1507
  | 1505
  | 1500
  | 1498
  | 1494
  | 1493
  | 1490
  | 1487
  | 1480
  | 1479
  | 1476
  | 1475
  | 1473
  | 1472
  | 1471
  | 1464
  | 1463
  | 1462
  | 1461
  | 1457
  | 1454
  | 1451
  | 1450
  | 1449
  | 1446
  | 1445
  | 1442
  | 1441
  | 1440
  | 1439
  | 1438
  | 1437
  | 1436
  | 1435
  | 1434
  | 1433
  | 1432
  | 1429
  | 1427
  | 1426
  | 1423
  | 1422
  | 1417
  | 1416
  | 1415
  | 1414
  | 1411
  | 1409
  | 1408
  | 1407
  | 1406
  | 1404
  | 1403
  | 1402
  | 1401
  | 1400
  | 1399
  | 1398
  | 1397
  | 1396
  | 1395
  | 1394
  | 1393
  | 1392
  | 1391
  | 1390
  | 1389
  | 1387
  | 1385
  | 1380
  | 1375
  | 1373
  | 1372
  | 1371
  | 1369
  | 1368
  | 1364
  | 1363
  | 1361
  | 1360
  | 1359
  | 1358
  | 1353
  | 1352
  | 1351
  | 1348
  | 1346
  | 1341
  | 1336
  | 1335
  | 1331
  | 1325
  | 1305
  | 1303
  | 1301
  | 1296
  | 1293
  | 1289
  | 1285
  | 1284
  | 1283
  | 1282
  | 1280
  | 1279
  | 1277
  | 1276
  | 1274
  | 1272
  | 1270
  | 1268
  | 1266
  | 1265
  | 1262
  | 1260
  | 1259
  | 1258
  | 1257
  | 1255
  | 1250
  | 1240
  | 1239
  | 1238
  | 1234
  | 1232
  | 1228
  | 1226
  | 1223
  | 1222
  | 1219
  | 1218
  | 1215
  | 1214
  | 1212
  | 1211
  | 1206
  | 1197
  | 1192
  | 1187
  | 1183
  | 1182
  | 1181
  | 1175
  | 1166
  | 1164
  | 1163
  | 1161
  | 1153
  | 1152
  | 1146
  | 1145
  | 1144
  | 1143
  | 1142
  | 1135
  | 1130
  | 1125
  | 1121
  | 1120
  | 1119
  | 1111
  | 1103
  | 1099
  | 1098
  | 1097
  | 1096
  | 1095
  | 1093
  | 1089
  | 1087
  | 1086
  | 1085
  | 1084
  | 1082
  | 1081
  | 1079
  | 1078
  | 1077
  | 1075
  | 1073
  | 1069
  | 1067
  | 1065
  | 1064
  | 1063
  | 1062
  | 1061
  | 1060
  | 1059
  | 1058
  | 1057
  | 1055
  | 1053
  | 1052
  | 1051
  | 1049
  | 1048
  | 1047
  | 1046
  | 1045
  | 1044
  | 1043
  | 1041
  | 1037
  | 1036
  | 1035
  | 1034
  | 1033
  | 1031
  | 1030
  | 1029
  | 1028
  | 1027
  | 1026
  | 1025
  | 1024
  | 1023
  | 1021
  | 1019
  | 1018
  | 1017
  | 1016
  | 1014
  | 1012
  | 1011
  | 1010
  | 1009
  | 1007
  | 1005
  | 1004
  | 1002
  | 1000
  | 999
  | 998
  | 996
  | 991
  | 990
  | 989
  | 988
  | 984
  | 982
  | 976
  | 974
  | 972
  | 969
  | 968
  | 967
  | 966
  | 965
  | 964
  | 963
  | 961
  | 957
  | 953
  | 951
  | 950
  | 941
  | 936
  | 932
  | 931
  | 929
  | 927
  | 925
  | 923
  | 921
  | 920
  | 917
  | 915
  | 913
  | 911
  | 909
  | 907
  | 905
  | 903
  | 901
  | 899
  | 897
  | 895
  | 893
  | 891
  | 887
  | 885
  | 883
  | 881
  | 877
  | 875
  | 873
  | 872
  | 871
  | 870
  | 869
  | 864
  | 860
  | 841
  | 838
  | 836
  | 823
  | 819
  | 818
  | 815
  | 814
  | 807
  | 801
  | 799
  | 797
  | 794
  | 792
  | 750
  | 743
  | 738
  | 737
  | 736
  | 734
  | 733
  | 732
  | 729
  | 728
  | 727
  | 726
  | 724
  | 722
  | 720
  | 717
  | 715
  | 713
  | 712
  | 711
  | 710
  | 709
  | 708
  | 706
  | 703
  | 698
  | 693
  | 691
  | 682
  | 681
  | 680
  | 678
  | 677
  | 676
  | 673
  | 672
  | 671
  | 669
  | 668
  | 667
  | 666
  | 665
  | 664
  | 663
  | 661
  | 655
  | 654
  | 653
  | 652
  | 651
  | 650
  | 644
  | 638
  | 633
  | 628
  | 627
  | 625
  | 624
  | 622
  | 620
  | 616
  | 611
  | 610
  | 609
  | 607
  | 606
  | 603
  | 602
  | 601
  | 598
  | 596
  | 595
  | 594
  | 591
  | 587
  | 585
  | 584
  | 579
  | 576
  | 573
  | 572
  | 571
  | 570
  | 568
  | 564
  | 560
  | 553
  | 552
  | 551
  | 550
  | 547
  | 546
  | 545
  | 544
  | 543
  | 542
  | 541
  | 539
  | 538
  | 537
  | 533
  | 532
  | 531
  | 530
  | 529
  | 528
  | 527
  | 526
  | 525
  | 524
  | 520
  | 517
  | 516
  | 515
  | 514
  | 513
  | 512
  | 511
  | 510
  | 506
  | 505
  | 502
  | 501
  | 500
  | 499
  | 498
  | 497
  | 495
  | 494
  | 492
  | 491
  | 490
  | 489
  | 488
  | 487
  | 486
  | 484
  | 483
  | 482
  | 475
  | 473
  | 472
  | 471
  | 470
  | 469
  | 468
  | 466
  | 464
  | 462
  | 459
  | 458
  | 447
  | 444
  | 424
  | 423
  | 422
  | 421
  | 420
  | 419
  | 418
  | 417
  | 415
  | 414
  | 413
  | 412
  | 410
  | 409
  | 408
  | 407
  | 405
  | 404
  | 400
  | 399
  | 398
  | 397
  | 396
  | 395
  | 393
  | 392
  | 391
  | 388
  | 387
  | 374
  | 371
  | 370
  | 369
  | 368
  | 367
  | 365
  | 364
  | 363
  | 360
  | 357
  | 356
  | 355
  | 353
  | 348
  | 347
  | 346
  | 345
  | 344
  | 333
  | 329
  | 328
  | 327
  | 324
  | 320
  | 318
  | 316
  | 315
  | 311
  | 284
  | 281
  | 279
  | 278
  | 276
  | 275
  | 274
  | 273
  | 272
  | 271
  | 270
  | 264
  | 248
  | 244
  | 243
  | 242
  | 241
  | 240
  | 239
  | 238
  | 237
  | 236
  | 232
  | 231
  | 230
  | 229
  | 228
  | 224
  | 222
  | 220
  | 219
  | 218
  | 217
  | 212
  | 208
  | 203
  | 199
  | 183
  | 172
  | 168
  | 161
  | 151
  | 144
  | 143
  | 136
  | 134
  | 132
  | 125
  | 111
  | 109
  | 108
  | 102
  | 100
  | 99
  | 98
  | 95
  | 94
  | 93
  | 90
  | 89
  | 84
  | 82
  | 78
  | 75
  | 73
  | 69
  | 68
  | 61
      -> true
  | _ -> false


end
module Reason_parser_explain
= struct
#1 "reason_parser_explain.ml"
(* See the comments in menhir_error_processor.ml *)

open Reason_string

module Parser = Reason_parser
module Interp = Parser.MenhirInterpreter
module Raw = Reason_parser_explain_raw

let identlike_keywords =
  let reverse_table = lazy (
    let table = Hashtbl.create 7 in
    let flip_add k v = Hashtbl.add table v k in
    Hashtbl.iter flip_add Reason_declarative_lexer.keyword_table;
    table
  ) in
  function
  | Parser.SIG    -> Some "sig"
  | Parser.MODULE -> Some "module"
  | Parser.BEGIN  -> Some "begin"
  | Parser.END    -> Some "end"
  | Parser.OBJECT -> Some "object"
  | Parser.SWITCH -> Some "switch"
  | Parser.TO     -> Some "to"
  | Parser.THEN   -> Some "then"
  | Parser.TYPE   -> Some "type"
  | token ->
    match Hashtbl.find (Lazy.force reverse_table) token with
    | name -> Some name
    | exception Not_found -> None

let keyword_confused_with_ident state token =
  match identlike_keywords token with
  | Some name when Raw.transitions_on_lident state
                || Raw.transitions_on_uident state ->
    (name ^ " is a reserved keyword, it cannot be used as an identifier. Try `" ^ name ^ "_` or `_" ^ name ^ "` instead")
  | _ -> raise Not_found

let uppercased_instead_of_lowercased state token =
  match token with
  | Parser.UIDENT name when Raw.transitions_on_lident state ->
    let name = String.uncapitalize_ascii name in
    if Hashtbl.mem Reason_declarative_lexer.keyword_table name then
      "variables and labels should be lowercased"
    else
      Printf.sprintf "variables and labels should be lowercased. Try `%s'" name
  | _ -> raise Not_found

let semicolon_might_be_missing state _token =
  (*let state = Interp.current_state_number env in*)
  if Raw.transitions_on_semi state then
    "syntax error, consider adding a `;' before"
  else
    raise Not_found

let token_specific_message = function
  | Parser.UNDERSCORE ->
    "underscore is not a valid identifier. Use _ only in pattern matching and partial function application"
  | _ ->
    raise Not_found

let unclosed_parenthesis is_opening_symbol closing_symbol check_function env =
  let state = Interp.current_state_number env in
  if check_function state then
    let rec find_opening_location = function
      | None -> None
      | Some env ->
        let found =
          match Interp.top env with
          | Some (Interp.Element (state, _, startp, endp))
            when (is_opening_symbol (Interp.X (Interp.incoming_symbol state))) ->
            Some (startp, endp)
          | Some (Interp.Element (state, _, _, _))
            when (Interp.X (Interp.incoming_symbol state) = closing_symbol) ->
            raise Not_found
          | _ -> None
        in
        match found with
        | Some _ -> found
        | _ -> find_opening_location (Interp.pop env)
    in
    try find_opening_location (Some env)
    with Not_found -> None
  else
    None

let check_unclosed env =
  let check (message, opening_symbols, closing_symbol, check_function) =
    match
      unclosed_parenthesis (fun x -> List.mem x opening_symbols)
        closing_symbol check_function env
    with
    | None -> None
    | Some (loc_start, _) ->
      Some (Format.asprintf "Unclosed %S (opened line %d, column %d)"
              message loc_start.pos_lnum
              (loc_start.pos_cnum - loc_start.pos_bol))
  in
  let rec check_list = function
    | [] -> raise Not_found
    | x :: xs ->
      match check x with
      | None -> check_list xs
      | Some result -> result
  in
  check_list [
    ("(", Interp.[X (T T_LPAREN)],
     Interp.X (T T_RPAREN),
     Raw.transitions_on_rparen);
    ("{", Interp.[X (T T_LBRACE); X (T T_LBRACELESS)],
     Interp.X (T T_RBRACE),
     Raw.transitions_on_rbrace);
    ("[", Interp.[ X (T T_LBRACKET); X (T T_LBRACKETAT);
                   X (T T_LBRACKETBAR); X (T T_LBRACKETGREATER);
                   X (T T_LBRACKETLESS); X (T T_LBRACKETPERCENT);
                   X (T T_LBRACKETPERCENTPERCENT); ],
     Interp.X (T T_RBRACKET),
     Raw.transitions_on_rbracket);
  ]

let message env (token, _, _) =
  let state = Interp.current_state_number env in
  (* Identify a keyword used as an identifier *)
  try keyword_confused_with_ident state token
  with Not_found ->
  try check_unclosed env
  with Not_found ->
  (* Identify an uppercased identifier in a lowercase place *)
  try uppercased_instead_of_lowercased state token
  with Not_found ->
  try semicolon_might_be_missing state token
  with Not_found ->
  try token_specific_message token
  with Not_found ->
  (* Is there a message for this specific state ? *)
    (* TODO: we don't know what to say *)
    "Syntax error"

end
module Reason_parser_recover
= struct
#1 "reason_parser_recover.ml"
open Reason_parser

module Default = struct


  open Migrate_parsetree.OCaml_404.Ast
  open Parsetree
  open Ast_helper

  let default_loc = ref Location.none

  let default_expr () =
    let id = Location.mkloc "merlin.hole" !default_loc in
    Exp.mk ~loc:!default_loc (Pexp_extension (id, PStr []))

  let default_pattern () = Pat.any ~loc:!default_loc ()

  let default_module_expr () = Mod.structure ~loc:!default_loc[]
  let default_module_type () = Mty.signature ~loc:!default_loc[]


  let value (type a) : a MenhirInterpreter.symbol -> a = function
    | MenhirInterpreter.T MenhirInterpreter.T_error -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_WITH -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_WHILE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_WHEN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_VIRTUAL -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_VAL -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_UNDERSCORE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_UIDENT -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_TYPE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_TRY -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_TRUE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_TO -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_TILDE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_THEN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_SWITCH -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_STRUCT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_STRING -> ("", None, None)
    | MenhirInterpreter.T MenhirInterpreter.T_STAR -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_SLASHGREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_SIG -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_SHARPOP -> raise Not_found
    | MenhirInterpreter.T MenhirInterpreter.T_SHARPEQUAL -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_SHARP -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_SEMISEMI -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_SEMI -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_RPAREN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_REC -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_RBRACKET -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_RBRACE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_QUOTE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_QUESTION -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_PUB -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_PRI -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_PREFIXOP -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_POSTFIXOP -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_PLUSEQ -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_PLUSDOT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_PLUS -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_PERCENT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_OR -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_OPEN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_OF -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_OBJECT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_NONREC -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_NEW -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_NATIVEINT -> 0n
    | MenhirInterpreter.T MenhirInterpreter.T_MUTABLE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_MODULE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_MINUSGREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_MINUSDOT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_MINUS -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LPAREN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LIDENT -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_LET -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LESSSLASHIDENTGREATER -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_LESSSLASHGREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LESSIDENT -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_LESSGREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LESSDOTDOTGREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LESS -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACKETPERCENTPERCENT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACKETPERCENT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACKETLESS -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACKETGREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACKETBAR -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACKETAT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACKET -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACELESS -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LBRACE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_LAZY -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_INT -> ("0", None)
    | MenhirInterpreter.T MenhirInterpreter.T_INITIALIZER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_INHERIT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_INFIXOP4 -> raise Not_found
    | MenhirInterpreter.T MenhirInterpreter.T_INFIXOP3 -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_INFIXOP2 -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_INFIXOP1 -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_INFIXOP0 -> ""
    | MenhirInterpreter.T MenhirInterpreter.T_INCLUDE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_IN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_IF -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_GREATERRBRACE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_GREATERDOTDOTDOT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_GREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_FUNCTOR -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_FUNCTION -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_FUN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_FOR -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_FLOAT -> ("0.0", None)
    | MenhirInterpreter.T MenhirInterpreter.T_FALSE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_EXTERNAL -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_EXCEPTION -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_ES6_FUN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_EQUALGREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_EQUAL -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_EOL -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_EOF -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_END -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_ELSE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_DOWNTO -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_DOTDOTDOT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_DOTDOT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_DOT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_DONE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_DOCSTRING -> raise Not_found
    | MenhirInterpreter.T MenhirInterpreter.T_DO -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_CONSTRAINT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_COMMENT -> raise Not_found
    | MenhirInterpreter.T MenhirInterpreter.T_COMMA -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_COLONGREATER -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_COLONEQUAL -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_COLONCOLON -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_COLON -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_CLASS -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_CHAR -> raise Not_found
    | MenhirInterpreter.T MenhirInterpreter.T_BEGIN -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_BARRBRACKET -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_BARBAR -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_BAR -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_BANG -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_BACKQUOTE -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_ASSERT -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_AS -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_AND -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_AMPERSAND -> ()
    | MenhirInterpreter.T MenhirInterpreter.T_AMPERAMPER -> ()
    | MenhirInterpreter.N MenhirInterpreter.N_with_constraint -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_virtual_flag -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_value_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_value -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_val_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_val_ident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_use_file_no_mapper -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_use_file -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_unattributed_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_unattributed_core_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_variance -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_variables_with_variance_comma_list -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_variables_with_variance -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_variable_with_variance -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_variable -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_parameters -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_parameter -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_other_kind -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_declarations -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_declaration_kind -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_declaration_details -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_type_constraint -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_toplevel_phrase -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_toplevel_directive -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_tag_field -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_subtractive -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_structure_item -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_structure -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_string_literal_labels -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_string_literal_label -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_string_literal_exprs_maybe_punned -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_string_literal_expr_maybe_punned_with_comma -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_string_literal_expr_maybe_punned -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_str_type_extension -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_str_exception_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_single_attr_id -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_pattern_not_ident_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_pattern_not_ident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_pattern_ident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_pattern_direct_argument -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_pattern -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_module_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_expr_template_constructor -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_expr_no_constructor -> default_expr ()
    | MenhirInterpreter.N MenhirInterpreter.N_simple_expr_no_call -> default_expr ()
    | MenhirInterpreter.N MenhirInterpreter.N_simple_expr_direct_argument -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_simple_expr_call -> (default_expr (), [])
    | MenhirInterpreter.N MenhirInterpreter.N_signed_constant -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_signature_items -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_signature_item -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_signature -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_sig_type_extension -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_sig_exception_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_seq_expr_no_seq -> default_expr ()
    | MenhirInterpreter.N MenhirInterpreter.N_seq_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_separated_nonempty_list_AMPERSAND_non_arrowed_simple_core_types_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_row_field_list -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_row_field -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_record_label_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_record_expr_with_string_keys -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_record_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_record_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_rec_flag -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_protected_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_primitive_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_poly_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_payload -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_pattern_without_or -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_pattern_optional_constraint -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_pattern_constructor_argument -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_pattern_comma_list_extension -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_pattern -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_parse_pattern -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_parse_expression -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_parse_core_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_parenthesized_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_package_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_override_flag -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_optional_expr_extension -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_optional -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_type_constraint_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_WHEN_expr__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_COLONGREATER_core_type__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_COLON_simple_module_type__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_COLON_poly_type__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_COLON_non_arrowed_core_type__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_COLON_expr__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_COLON_core_type__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_COLON_class_constructor_type__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_preceded_AS_LIDENT__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_item_extension_sugar_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_constructor_arguments_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_SEMI_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_OF_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_MODULE_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_LET_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_DOTDOTDOT_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_DOT_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_option_COMMA_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_opt_LET_MODULE_ident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_opt_LET_MODULE_REC_ident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_opt_LET_MODULE -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_operator -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_open_statement -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_object_record_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_object_label_declarations -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_object_label_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_object_body_class_fields -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_object_body -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonrec_flag -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonempty_list_preceded_QUOTE_ident__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonempty_list_preceded_CONSTRAINT_constrain__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonempty_list_name_tag_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonempty_list_attributed_ext_constructor_extension_constructor_declaration__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonempty_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonempty_list_as_loc_attribute__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonempty_list___anonymous_32_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_nonempty_list_LIDENT_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_non_labeled_argument_list -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_non_arrowed_simple_core_types -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_non_arrowed_simple_core_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_non_arrowed_core_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_mutable_or_virtual_flags -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_mutable_flag -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_mty_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_type_signature -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_type_body_EQUAL_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_type_body_COLON_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_parameter -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_expr_structure -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_expr_body -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_complex_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_binding_body -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_arguments_comma_list -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_module_arguments -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_mod_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_mod_ext_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_mod_ext_apply -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_method_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_match_case_seq_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_match_case_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_SEMI_class_sig_field_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_SEMI_class_field_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_uncurried_labeled_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_uncurried_arrow_type_parameter_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_type_variable_with_variance_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_type_parameter_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_string_literal_label_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_string_literal_expr_maybe_punned_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_record_label_declaration_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_protected_type_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_pattern_optional_constraint_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_opt_spread_pattern__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_opt_spread_lbl_expr__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_opt_spread_expr_optional_constraint__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_object_label_declaration_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_module_parameter_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_module_complex_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_mod_ext_longident_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_labeled_pattern_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_field_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_expr_optional_constraint_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_COMMA_core_type_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lseparated_nonempty_list_aux_AND_with_constraint_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_type_parameters_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_terminated_pattern_comma_list_option_COMMA___ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_row_field_list_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_preceded_GREATER_nonempty_list_name_tag___ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_parenthesized_type_variables_with_variance_comma_list__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_parenthesized_class_type_arguments_comma_list__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_object_label_declarations_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_located_attributes_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_functor_parameters_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_loption_class_type_parameters_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_longident_type_constraint -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_llist_aux_preceded_COMMA_opt_spread_lbl_expr___ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_llist_aux_match_case_seq_expr__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_llist_aux_match_case_expr__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_simple_expr_no_call_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_bar_row_field_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_attributed_ext_constructor_extension_constructor_declaration__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_and_module_rec_declaration_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_and_module_bindings_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_and_let_binding_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_and_class_type_declaration_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_and_class_description_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_list_and_class_declaration_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_let_bindings -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_let_binding_body -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_let_binding -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_lbl_pattern -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_labelled_arrow_type_parameter_optional -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_labeled_pattern_constraint -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_labeled_pattern -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_labeled_expr_constraint -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_labeled_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_labeled_arguments -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_label_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_jsx_without_leading_less -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_jsx_start_tag_and_args_without_leading_less -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_jsx_start_tag_and_args -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_jsx_arguments -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_jsx -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_item_extension_sugar -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_item_extension -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_interface -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_implementation -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_ident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_greater_spread -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_generalized_constructor_arguments -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_functor_parameters -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_fun_def_EQUALGREATER_non_arrowed_core_type_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_fun_def_EQUAL_core_type_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_field_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_extension_constructor_rebind -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_extension_constructor_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_extension -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_expr_optional_constraint -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_expr_list -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_expr_comma_seq_extension -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_expr -> default_expr ()
    | MenhirInterpreter.N MenhirInterpreter.N_es6_parameters -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_embedded_private_flag_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_embedded___anonymous_39_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_embedded___anonymous_33_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_embedded___anonymous_1_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_embedded___anonymous_0_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either_preceded_EQUALGREATER_expr__braced_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either_preceded_EQUAL_expr__braced_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either_preceded_EQUAL_class_instance_type__class_type_body_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either_preceded_EQUAL_class_expr__class_body_expr_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either_parenthesized_longident_type_constraint__longident_type_constraint_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either_extension_constructor_declaration_extension_constructor_rebind_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either_constructor_declaration_bar_constructor_declaration_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either___anonymous_12___anonymous_13_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_either_ES6_FUN_FUN_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_direction_flag -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_core_type2 -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_core_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constructor_declarations_aux -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constructor_declarations -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constructor_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constructor_arguments_comma_list -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constructor_arguments -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constrain_field -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constrain -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constr_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_constant -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_clty_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_type_declarations -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_type_declaration_details -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_type_body -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_type_arguments_comma_list -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_simple_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_sig_field -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_sig_body_fields -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_sig_body -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_self_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_self_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_longident -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_instance_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_field -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_expr_lets_and_rest -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_descriptions -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_description_details -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_declaration_details -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_declaration_body -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_class_constructor_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_braced_expr -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_boption_AMPERSAND_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_basic_core_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_bar_row_field -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_bar_constructor_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_attributed_ext_constructors_extension_constructor_declaration_ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_attributed_ext_constructors_either_extension_constructor_declaration_extension_constructor_rebind__ -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_attribute -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_attr_id -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_arrowed_simple_core_type -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_arrow_type_parameters -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_arrow_type_parameter -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_and_type_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_and_module_rec_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_and_module_bindings -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_and_class_type_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_and_class_description -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_and_class_declaration -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N_additive -> raise Not_found
    | MenhirInterpreter.N MenhirInterpreter.N__lbl_pattern_list -> raise Not_found
end

let default_value = Default.value

open MenhirInterpreter

type action =
  | Abort
  | R of int
  | S : 'a symbol -> action
  | Sub of action list

type decision =
  | Nothing
  | One of action list
  | Select of (int -> action list)

let depth =
  [|0;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;2;3;2;2;1;1;2;1;1;1;1;2;3;1;1;1;2;1;2;3;4;1;2;3;4;2;3;5;6;3;4;1;2;3;1;1;1;1;2;3;3;2;1;1;1;1;2;1;1;1;1;2;1;2;1;1;2;1;2;1;1;2;1;2;2;3;1;2;2;3;2;3;1;1;2;3;1;2;2;1;1;2;1;1;1;1;2;1;2;1;1;1;1;2;1;1;2;1;1;1;2;1;1;2;3;1;1;2;1;1;2;1;1;1;2;1;1;1;2;1;1;2;3;1;1;2;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;2;1;1;1;2;1;2;3;2;2;3;1;2;1;2;2;3;1;1;2;1;1;1;1;1;1;2;1;2;1;2;3;1;1;1;1;4;2;1;1;2;3;3;1;1;1;3;1;1;2;3;4;1;1;2;1;2;3;2;3;4;1;2;1;3;2;3;1;2;1;2;2;1;2;3;1;1;1;2;2;1;2;3;2;2;3;1;2;3;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;1;2;1;1;1;1;1;2;3;1;1;2;1;1;2;3;1;4;5;1;6;1;1;1;1;2;2;1;2;1;2;1;2;3;1;1;1;1;1;2;3;1;1;1;1;2;4;5;1;6;1;1;2;1;1;1;2;3;1;2;1;3;1;2;3;1;2;1;1;2;3;4;1;1;1;2;2;2;3;4;3;4;2;3;4;3;1;2;3;1;1;2;3;3;4;1;1;1;1;2;3;4;2;3;4;1;2;3;1;2;1;2;3;1;2;3;4;2;3;4;3;4;1;1;2;1;3;4;1;2;3;1;2;1;2;3;4;5;1;1;1;1;2;2;3;1;1;2;3;2;1;2;1;1;2;1;1;1;2;3;4;5;1;2;3;4;2;2;3;3;4;2;3;1;2;3;2;1;2;3;1;1;1;2;2;1;2;1;1;2;1;2;3;1;2;3;1;2;1;2;1;2;3;4;1;2;3;4;5;3;4;2;3;1;1;1;2;3;1;2;3;4;5;3;4;4;2;3;2;7;1;1;1;2;3;2;3;1;1;1;1;2;3;2;2;1;2;3;3;2;3;3;4;5;6;7;8;9;1;1;2;3;2;1;2;3;1;1;1;1;2;2;1;1;1;2;3;2;3;4;5;6;7;4;5;1;2;3;4;2;3;4;1;3;2;3;1;2;3;3;1;1;2;3;1;1;2;1;4;1;2;2;3;4;1;2;1;1;1;2;1;2;2;1;2;2;1;1;2;3;4;3;1;4;5;1;1;1;1;1;2;3;1;2;3;1;1;2;3;4;5;4;1;2;1;1;1;1;2;1;2;1;1;1;1;3;1;2;3;1;1;2;3;4;1;1;2;3;1;1;1;1;2;1;1;2;3;2;3;1;2;2;2;3;3;4;1;1;2;2;3;1;2;3;1;2;3;1;2;1;1;2;3;4;5;3;4;5;3;4;4;5;3;4;5;1;2;2;3;4;2;3;2;3;2;3;4;2;2;2;3;2;3;4;5;6;7;8;2;3;1;2;1;1;2;1;2;1;2;1;3;4;5;1;2;3;4;5;1;1;1;2;2;3;1;3;2;3;4;5;1;2;3;4;1;2;3;1;1;2;2;3;2;1;1;2;3;2;1;2;3;4;1;1;1;5;1;1;1;2;3;1;2;1;2;3;1;1;2;3;1;1;1;1;2;3;2;1;2;2;3;4;5;6;1;2;1;2;3;3;4;1;4;2;3;5;6;2;3;2;1;1;2;3;2;3;4;5;2;6;7;8;1;1;1;1;1;1;2;1;1;1;2;1;2;1;2;3;1;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;4;3;2;3;2;3;2;3;2;3;4;5;2;2;1;4;5;3;1;2;4;5;1;2;2;3;4;2;3;2;3;2;2;3;4;2;3;4;2;3;4;5;3;4;2;3;5;6;1;3;3;4;5;3;4;4;5;3;4;2;3;5;6;1;3;1;2;2;3;4;4;4;1;2;3;1;2;3;4;4;2;3;4;5;6;5;3;1;1;2;2;4;1;4;5;6;7;8;9;2;3;4;5;6;9;6;7;7;1;2;3;2;1;2;4;5;4;5;1;2;3;4;5;6;7;8;8;5;6;6;2;3;4;4;5;6;7;8;9;10;10;7;8;8;4;3;3;4;5;6;2;3;4;5;6;7;3;4;5;6;7;8;3;4;5;1;2;2;3;4;2;3;4;5;3;4;5;6;3;4;3;4;5;6;1;6;1;1;7;8;9;10;1;5;2;1;2;3;1;2;4;1;2;3;4;5;3;4;5;6;7;2;3;4;5;6;1;2;1;2;3;4;5;3;4;2;3;4;1;2;1;3;4;5;1;2;3;4;5;6;7;8;2;3;1;2;3;1;2;1;3;1;2;3;4;5;1;1;2;3;1;2;4;1;2;3;4;5;3;4;5;6;7;2;3;4;5;6;2;3;1;2;4;5;6;7;8;3;4;5;6;7;2;1;2;3;2;3;4;2;1;2;3;4;1;1;2;1;2;1;2;3;4;5;6;1;1;2;3;4;3;1;2;3;4;5;6;7;8;9;10;1;2;3;4;5;5;1;2;6;1;1;1;2;1;3;1;2;3;1;2;3;4;1;2;3;4;1;2;3;1;2;3;1;1;2;1;2;3;4;3;4;5;6;1;1;2;1;2;3;4;5;5;6;1;2;1;1;2;1;2;1;1;1;1;1;2;2;1;2;2;3;3;4;3;1;1;1;2;1;2;2;1;2;3;4;1;1;2;3;4;5;1;2;3;4;5;1;1;1;2;3;1;1;1;1;2;2;3;2;1;2;1;2;2;1;1;2;3;2;1;2;1;1;2;3;2;3;4;5;6;2;3;4;5;6;2;3;2;3;2;1;2;1;3;2;1;1;3;4;1;2;3;2;3;1;2;4;1;3;1;2;1;2;3;4;1;2;1;2;3;4;1;5;1;2;3;2;1;2;1;2;3;3;1;2;1;1;2;1;3;1;1;1;2;3;2;1;1;2;1;2;1;1;2;1;2;3;1;2;3;4;3;1;2;1;2;2;3;3;2;1;1;2;3;4;5;6;7;8;4;4;5;6;7;8;9;10;2;3;4;2;3;4;5;2;3;4;5;2;3;2;3;4;5;6;6;7;2;3;2;3;4;5;3;4;2;3;4;3;2;3;4;2;1;1;1;2;1;2;1;1;2;3;4;1;2;1;1;1;1;1;1;1;1;2;1;2;1;2;1;3;1;1;2;3;4;1;2;1;5;1;2;3;4;5;6;4;5;6;7;8;3;4;5;6;7;3;1;2;4;1;2;1;1;1;1;2;3;1;2;3;4;5;6;5;6;7;2;3;4;5;4;5;6;2;3;4;5;2;3;2;3;4;5;2;3;2;2;1;2;3;4;5;2;3;4;5;6;7;8;2;3;4;3;3;1;2;1;1;1;2;3;2;1;1;2;2;3;4;1;1;2;1;1;2;1;2;3;4;3;2;3;1;1;2;3;2;3;3;4;5;2;3;1;2;2;5;1;1;4;5;6;5;6;7;8;4;5;6;7;8;9;8;9;10;9;10;11;12;8;9;10;11;7;4;5;6;7;3;2;1;2;1;2;3;3;1;2;1;2;1;2;1;1;2;3;2;3;2;3;4;5;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;2;3;4;3;2;3;2;3;2;3;2;3;1;1;2;1;2;3;1;1;1;2;3;4;5;6;2;3;4;5;6;7;3;4;5;6;7;8;3;4;5;1;2;1;1;2;2;3;1;4;2;1;2;1;2;3;1;2;3;4;3;1;2;1;1;2;3;4;5;6;7;1;2;3;4;1;2;3;4;5;3;4;2;3;1;1;1;2;3;1;2;3;4;5;3;4;4;2;3;2;8;4;5;6;7;8;9;10;2;3;4;5;6;2;2;3;2;3;4;5;6;6;7;2;3;2;3;4;2;2;3;2;3;4;2;3;1;1;2;1;1;1;2;2;1;1;2;3;3;4;2;3;3;1;2;1;2;2;3;2;3;4;5;1;5;1;2;3;1;2;2;1;2;3;2;2;3;4;3;4;2;2;3;4;2;3;4;2;3;2;3;2;2;3;2;3;4;4;1;2;3;4;1;1;1;2;1;3;1;2;3;4;5;6;1;2;3;4;1;1;2;2;3;4;5;6;7;1;2;3;1;2;2;3;4;1;2;3;1;2;2;5;5;6;7;2;2;3;4;5;3;4;5;6;3;1;1;2;3;4;5;6;7;8;4;5;3;4;5;3;4;5;3;4;4;5;3;4;5;6;3;4;4;5;4;5;1;1;1;1;2;3;5;6;7;8;4;5;3;4;5;3;4;5;3;4;4;5;3;4;5;6;3;4;4;5;4;5;5;6;2;3;4;2;3;2;2;3;4;4;3;4;3;2;3;4;5;3;4;5;6;7;8;2;2;3;3;4;4;5;6;2;3;4;5;6;7;8;2;2;3;2;3;4;2;3;2;3;3;4;4;5;2;2;3;2;2;3;3;4;5;6;7;4;5;3;4;2;3;2;3;4;5;6;7;2;3;2;3;4;5;6;7;3;4;1;2;3;2;1;1;2;3;2;3;4;1;2;1;2;2;1;2;3;1;2;2;3;3;4;1;2;3;1;2;1;2;1;1;1;1;1;2;3;2;3;2;3;4;2;3;4;2;3;2;3;2;3;3;2;2;2;2;3;4;1;1;2;1;2;1;2;1;3;3;1;1;2;2;2;3;2;3;4;1;5;5;6;5;4;4;4;5;4;2;3;3;4;5;6;7;3;4;5;6;7;8;9;3;4;3;2;3;4;2;4;5;4;5;6;2;1;1;2;3;4;5;3;4;5;2;3;2;3;2;3;2;3;1;1;2;3;3;4;2;3;2;3;3;4;1;2;1;0;1;2;1;0;1;1;2;0;1;1;2;0;1;2;1;0;1;2;1;1;1;1;1;1;3;1;1;1;2;1;2;1;0;1;1;1;1;2;3;1;2;3;1;2;2;|]

let can_pop (type a) : a terminal -> bool = function
  | T_WITH -> true
  | T_WHILE -> true
  | T_WHEN -> true
  | T_VIRTUAL -> true
  | T_VAL -> true
  | T_UNDERSCORE -> true
  | T_TYPE -> true
  | T_TRY -> true
  | T_TRUE -> true
  | T_TO -> true
  | T_TILDE -> true
  | T_THEN -> true
  | T_SWITCH -> true
  | T_STRUCT -> true
  | T_STAR -> true
  | T_SLASHGREATER -> true
  | T_SIG -> true
  | T_SHARPEQUAL -> true
  | T_SHARP -> true
  | T_SEMISEMI -> true
  | T_SEMI -> true
  | T_RPAREN -> true
  | T_REC -> true
  | T_RBRACKET -> true
  | T_RBRACE -> true
  | T_QUOTE -> true
  | T_QUESTION -> true
  | T_PUB -> true
  | T_PRI -> true
  | T_PLUSEQ -> true
  | T_PLUSDOT -> true
  | T_PLUS -> true
  | T_PERCENT -> true
  | T_OR -> true
  | T_OPEN -> true
  | T_OF -> true
  | T_OBJECT -> true
  | T_NONREC -> true
  | T_NEW -> true
  | T_MUTABLE -> true
  | T_MODULE -> true
  | T_MINUSGREATER -> true
  | T_MINUSDOT -> true
  | T_MINUS -> true
  | T_LPAREN -> true
  | T_LET -> true
  | T_LESSSLASHGREATER -> true
  | T_LESSGREATER -> true
  | T_LESSDOTDOTGREATER -> true
  | T_LESS -> true
  | T_LBRACKETPERCENTPERCENT -> true
  | T_LBRACKETPERCENT -> true
  | T_LBRACKETLESS -> true
  | T_LBRACKETGREATER -> true
  | T_LBRACKETBAR -> true
  | T_LBRACKETAT -> true
  | T_LBRACKET -> true
  | T_LBRACELESS -> true
  | T_LBRACE -> true
  | T_LAZY -> true
  | T_INITIALIZER -> true
  | T_INHERIT -> true
  | T_INCLUDE -> true
  | T_IN -> true
  | T_IF -> true
  | T_GREATERRBRACE -> true
  | T_GREATERDOTDOTDOT -> true
  | T_GREATER -> true
  | T_FUNCTOR -> true
  | T_FUNCTION -> true
  | T_FUN -> true
  | T_FOR -> true
  | T_FALSE -> true
  | T_EXTERNAL -> true
  | T_EXCEPTION -> true
  | T_ES6_FUN -> true
  | T_EQUALGREATER -> true
  | T_EQUAL -> true
  | T_EOL -> true
  | T_END -> true
  | T_ELSE -> true
  | T_DOWNTO -> true
  | T_DOTDOTDOT -> true
  | T_DOTDOT -> true
  | T_DOT -> true
  | T_DONE -> true
  | T_DO -> true
  | T_CONSTRAINT -> true
  | T_COMMA -> true
  | T_COLONGREATER -> true
  | T_COLONEQUAL -> true
  | T_COLONCOLON -> true
  | T_COLON -> true
  | T_CLASS -> true
  | T_BEGIN -> true
  | T_BARRBRACKET -> true
  | T_BARBAR -> true
  | T_BAR -> true
  | T_BANG -> true
  | T_BACKQUOTE -> true
  | T_ASSERT -> true
  | T_AS -> true
  | T_AND -> true
  | T_AMPERSAND -> true
  | T_AMPERAMPER -> true
  | _ -> false

let recover =
  let r0 = Sub [S (T T_RPAREN); R 663] in
  let r1 = Sub [S (T T_DOT); r0] in
  let r2 = Sub [S (T T_LPAREN); r1] in
  let r3 = Sub [S (N N_simple_expr_call); R 1070] in
  let r4 = Sub [r2; r3] in
  let r5 = Sub [S (T T_WITH); R 968; R 33] in
  let r6 = Sub [S (N N_simple_expr_call); R 237] in
  let r7 = Sub [r2; r6] in
  let r8 = Sub [S (N N_seq_expr_no_seq); R 727] in
  let r9 = Sub [S (T T_RBRACE); R 58] in
  let r10 = Sub [S (N N_expr); R 1117] in
  let r11 = Sub [S (T T_EQUAL); r10] in
  let r12 = Sub [S (T T_LIDENT); r11] in
  let r13 = Sub [R 526; r12] in
  let r14 = Sub [R 659; r13] in
  let r15 = Sub [S (T T_UNDERSCORE); R 49; R 534] in
  let r16 = Sub [r15; R 1059] in
  let r17 = Sub [r16; R 177] in
  let r18 = Sub [r17; R 175] in
  let r19 = Sub [r18; R 1115] in
  let r20 = Sub [S (T T_COLON); r19] in
  let r21 = Sub [S (T T_LIDENT); r20] in
  let r22 = Sub [S (T T_UIDENT); R 481] in
  let r23 = Sub [r22; R 434] in
  let r24 = Sub [S (T T_RPAREN); R 478] in
  let r25 = Sub [r23; r24] in
  let r26 = Sub [S (T T_UIDENT); R 482] in
  let r27 = Sub [S (T T_RPAREN); R 479] in
  let r28 = Sub [S (T T_RPAREN); R 480] in
  let r29 = Sub [r18; R 695] in
  let r30 = Sub [R 655; R 354] in
  let r31 = Sub [S (T T_EQUAL); r30] in
  let r32 = Sub [r29; r31] in
  let r33 = Sub [S (T T_COLON); r32] in
  let r34 = Sub [S (T T_LIDENT); R 109] in
  let r35 = Sub [S (T T_LIDENT); R 110] in
  let r36 = Sub [S (T T_RPAREN); R 1051] in
  let r37 = Sub [R 617; r36] in
  let r38 = Sub [r29; R 452; r37] in
  let r39 = Sub [S (T T_LIDENT); R 310] in
  let r40 = Sub [r39; R 47] in
  let r41 = Sub [S (T T_RBRACE); R 523] in
  let r42 = Sub [R 744; r41] in
  let r43 = Sub [S (T T_LBRACE); r42] in
  let r44 = Sub [r43; R 890] in
  let r45 = Sub [r44; R 515] in
  let r46 = Sub [r45; R 661] in
  let r47 = Sub [S (T T_RPAREN); R 510] in
  let r48 = Sub [S (T T_RPAREN); R 889] in
  let r49 = Sub [S (T T_LPAREN); r47; r48] in
  let r50 = Sub [r45; R 512] in
  let r51 = Sub [R 982; R 685] in
  let r52 = Sub [S (T T_RBRACKET); R 279] in
  let r53 = Sub [r51; r52] in
  let r54 = Sub [R 412; R 1054] in
  let r55 = Sub [R 23; R 1031] in
  let r56 = Sub [R 1037; r55] in
  let r57 = Sub [r56; R 1026] in
  let r58 = Sub [r54; r57] in
  let r59 = Sub [S (T T_LIDENT); r58] in
  let r60 = Sub [r59; R 1033] in
  let r61 = Sub [R 566; r60] in
  let r62 = Sub [r56; R 1025] in
  let r63 = Sub [r54; r62] in
  let r64 = Sub [R 617; R 1055] in
  let r65 = Sub [S (T T_RPAREN); R 413] in
  let r66 = Sub [S (T T_UNDERSCORE); R 208; R 1053; R 462; r64; r65] in
  let r67 = Sub [R 639; R 306] in
  let r68 = Sub [R 631; r67] in
  let r69 = Sub [r68; R 159] in
  let r70 = Sub [r15; R 531] in
  let r71 = Sub [r70; R 722] in
  let r72 = Sub [R 390; R 723] in
  let r73 = Sub [r71; r72] in
  let r74 = Sub [S (T T_RBRACKET); R 54] in
  let r75 = Sub [R 414; r74] in
  let r76 = Sub [S (T T_RBRACKET); R 53] in
  let r77 = Sub [S (T T_RBRACKET); R 35] in
  let r78 = Sub [r51; r77] in
  let r79 = Sub [S (T T_UNDERSCORE); R 900; R 894] in
  let r80 = Sub [r79; R 676] in
  let r81 = Sub [r80; R 668] in
  let r82 = Sub [r8; R 473] in
  let r83 = Sub [S (T T_EQUALGREATER); r82] in
  let r84 = Sub [R 651; r83] in
  let r85 = Sub [r81; r84] in
  let r86 = Sub [S (T T_BAR); r85] in
  let r87 = Sub [S (T T_RBRACE); R 1067] in
  let r88 = Sub [R 396; r87] in
  let r89 = Sub [r86; r88] in
  let r90 = Sub [S (T T_LBRACE); r89] in
  let r91 = Sub [S (N N_simple_expr_no_constructor); r90] in
  let r92 = Sub [S (T T_RPAREN); R 1110] in
  let r93 = Sub [S (T T_GREATERDOTDOTDOT); R 610; r92] in
  let r94 = Sub [S (T T_RBRACE); R 234] in
  let r95 = Sub [R 396; r94] in
  let r96 = Sub [r86; r95] in
  let r97 = Sub [S (T T_LBRACE); r96] in
  let r98 = Sub [S (N N_simple_expr_no_constructor); r97] in
  let r99 = Sub [R 319; R 321] in
  let r100 = Sub [R 319; R 322] in
  let r101 = Sub [R 319; R 320] in
  let r102 = Sub [S (T T_RBRACE); R 233] in
  let r103 = Sub [R 396; r102] in
  let r104 = Sub [r86; r103] in
  let r105 = Sub [S (T T_LBRACE); r104] in
  let r106 = Sub [S (N N_simple_expr_no_constructor); r105] in
  let r107 = Sub [S (T T_LESSSLASHGREATER); R 315] in
  let r108 = Sub [R 319; R 326] in
  let r109 = Sub [S (T T_LESSSLASHGREATER); R 329] in
  let r110 = Sub [R 392; r109] in
  let r111 = Sub [S (T T_GREATER); r110] in
  let r112 = Sub [S (T T_RBRACKET); R 816] in
  let r113 = Sub [S (T T_BARRBRACKET); R 826] in
  let r114 = Sub [S (N N_expr); R 277] in
  let r115 = Sub [r114; R 442] in
  let r116 = Sub [S (T T_RPAREN); R 502] in
  let r117 = Sub [S (T T_LPAREN); r116] in
  let r118 = Sub [S (T T_RPAREN); R 820] in
  let r119 = Sub [S (N N_expr); R 270] in
  let r120 = Sub [S (T T_BARRBRACKET); R 784] in
  let r121 = Sub [S (T T_BARRBRACKET); R 785] in
  let r122 = Sub [R 617; R 275] in
  let r123 = Sub [S (T T_RBRACKET); R 812] in
  let r124 = Sub [S (N N_simple_expr_call); R 235] in
  let r125 = Sub [r2; r124] in
  let r126 = Sub [S (T T_RBRACKET); R 148] in
  let r127 = Sub [S (T T_RBRACE); R 834] in
  let r128 = Sub [S (T T_LBRACE); r127] in
  let r129 = Sub [S (T T_RPAREN); R 851] in
  let r130 = Sub [r46; r129] in
  let r131 = Sub [S (T T_COLON); r130] in
  let r132 = Sub [S (T T_RBRACE); R 509] in
  let r133 = Sub [S (T T_RBRACE); R 1066] in
  let r134 = Sub [R 396; r133] in
  let r135 = Sub [r86; r134] in
  let r136 = Sub [S (T T_LBRACE); r135] in
  let r137 = Sub [S (N N_simple_expr_no_constructor); r136] in
  let r138 = Sub [S (T T_BARRBRACKET); R 858] in
  let r139 = Sub [S (T T_BARRBRACKET); R 859] in
  let r140 = Sub [S (T T_LESSSLASHIDENTGREATER); R 317] in
  let r141 = Sub [S (T T_RPAREN); R 336] in
  let r142 = Sub [S (T T_UNDERSCORE); R 344] in
  let r143 = Sub [S (T T_LIDENT); R 1109] in
  let r144 = Sub [S (T T_QUESTION); R 341] in
  let r145 = Sub [R 649; R 1022] in
  let r146 = Sub [r18; r145] in
  let r147 = Sub [r68; R 285] in
  let r148 = Sub [S (T T_TRUE); r147] in
  let r149 = Sub [R 385; R 39] in
  let r150 = Sub [r148; r149] in
  let r151 = Sub [r150; R 740] in
  let r152 = Sub [r68; R 280] in
  let r153 = Sub [r18; R 424] in
  let r154 = Sub [R 617; R 158] in
  let r155 = Sub [S (T T_RPAREN); R 157] in
  let r156 = Sub [r153; r154; r155] in
  let r157 = Sub [S (T T_RBRACKET); R 52] in
  let r158 = Sub [S (T T_RBRACE); R 578] in
  let r159 = Sub [S (T T_RBRACE); R 582] in
  let r160 = Sub [r18; R 691] in
  let r161 = Sub [r160; R 979] in
  let r162 = Sub [r39; R 564] in
  let r163 = Sub [r29; R 26] in
  let r164 = Sub [r163; R 464] in
  let r165 = Sub [S (T T_RPAREN); R 29] in
  let r166 = Sub [R 617; r165] in
  let r167 = Sub [R 619; r164; r166] in
  let r168 = Sub [r17; R 30] in
  let r169 = Sub [S (T T_EQUALGREATER); r168] in
  let r170 = Sub [r29; R 27] in
  let r171 = Sub [S (T T_COLON); r170] in
  let r172 = Sub [r16; R 178] in
  let r173 = Sub [S (T T_LIDENT); R 1036] in
  let r174 = Sub [r17; R 31] in
  let r175 = Sub [r39; R 176] in
  let r176 = Sub [r18; R 692] in
  let r177 = Sub [S (T T_LIDENT); R 574] in
  let r178 = Sub [r160; R 980] in
  let r179 = Sub [S (T T_COLON); r178] in
  let r180 = Sub [S (T T_RBRACE); R 581] in
  let r181 = Sub [S (T T_LPAREN); r38; R 535; R 725] in
  let r182 = Sub [r39; R 1019] in
  let r183 = Sub [S (T T_BACKQUOTE); r182] in
  let r184 = Sub [r71; R 44] in
  let r185 = Sub [S (T T_LIDENT); R 718] in
  let r186 = Sub [S (T T_LIDENT); R 717] in
  let r187 = Sub [S (T T_RBRACE); R 698] in
  let r188 = Sub [R 617; r187] in
  let r189 = Sub [r68; R 282] in
  let r190 = Sub [S (T T_RPAREN); r189] in
  let r191 = Sub [r68; R 281] in
  let r192 = Sub [S (T T_RBRACKET); r191] in
  let r193 = Sub [r68; R 284] in
  let r194 = Sub [r68; R 283] in
  let r195 = Sub [r148; R 554] in
  let r196 = Sub [R 385; R 386] in
  let r197 = Sub [R 385; R 387] in
  let r198 = Sub [R 385; R 388] in
  let r199 = Sub [r148; r198] in
  let r200 = Sub [R 385; R 389] in
  let r201 = Sub [r18; R 152] in
  let r202 = Sub [S (T T_EQUAL); r201] in
  let r203 = Sub [r59; R 25] in
  let r204 = Sub [r150; R 741] in
  let r205 = Sub [R 220; r204] in
  let r206 = Sub [S (T T_PLUSEQ); r205] in
  let r207 = Sub [r54; r206] in
  let r208 = Sub [S (T T_LIDENT); r207] in
  let r209 = Sub [S (T T_UIDENT); R 484] in
  let r210 = Sub [r209; R 583] in
  let r211 = Sub [S (T T_UIDENT); R 485] in
  let r212 = Sub [r39; R 762] in
  let r213 = Sub [r22; R 1126] in
  let r214 = Sub [S (T T_COLONEQUAL); r213] in
  let r215 = Sub [S (T T_UIDENT); r214] in
  let r216 = Sub [S (T T_MODULE); r215] in
  let r217 = Sub [S (T T_LIDENT); R 333] in
  let r218 = Sub [r18; R 1124] in
  let r219 = Sub [S (T T_COLONEQUAL); r218] in
  let r220 = Sub [r54; r219] in
  let r221 = Sub [S (T T_LIDENT); R 334] in
  let r222 = Sub [r18; R 1122] in
  let r223 = Sub [r22; R 1125] in
  let r224 = Sub [r39; R 525] in
  let r225 = Sub [r45; R 518] in
  let r226 = Sub [r18; R 747] in
  let r227 = Sub [S (T T_COLON); r226] in
  let r228 = Sub [S (T T_RBRACKET); R 313] in
  let r229 = Sub [r51; r228] in
  let r230 = Sub [S (T T_RPAREN); R 907] in
  let r231 = Sub [r46; R 675] in
  let r232 = Sub [R 625; r231] in
  let r233 = Sub [S (T T_BARRBRACKET); R 912] in
  let r234 = Sub [r81; R 448] in
  let r235 = Sub [S (T T_RBRACKET); R 911] in
  let r236 = Sub [R 617; R 670] in
  let r237 = Sub [r217; R 356; R 7] in
  let r238 = Sub [R 621; r237] in
  let r239 = Sub [S (T T_RBRACE); R 910] in
  let r240 = Sub [r39; R 904] in
  let r241 = Sub [S (T T_RBRACKET); R 917] in
  let r242 = Sub [S (T T_LBRACKET); r241] in
  let r243 = Sub [r81; R 673] in
  let r244 = Sub [S (T T_RPAREN); R 672] in
  let r245 = Sub [R 617; r244] in
  let r246 = Sub [S (T T_COLON); r232] in
  let r247 = Sub [S (T T_BARRBRACKET); R 898] in
  let r248 = Sub [R 621; r234; r236] in
  let r249 = Sub [S (T T_RBRACKET); R 897] in
  let r250 = Sub [S (T T_RBRACE); R 896] in
  let r251 = Sub [S (T T_BARRBRACKET); R 915] in
  let r252 = Sub [S (T T_RBRACE); R 913] in
  let r253 = Sub [S (T T_RPAREN); R 906] in
  let r254 = Sub [S (T T_RPAREN); R 681] in
  let r255 = Sub [r80; r254] in
  let r256 = Sub [S (T T_COMMA); r255] in
  let r257 = Sub [r80; r256] in
  let r258 = Sub [S (T T_LPAREN); r257] in
  let r259 = Sub [S (N N_expr); R 197] in
  let r260 = Sub [S (T T_EQUALGREATER); r259] in
  let r261 = Sub [r260; R 298] in
  let r262 = Sub [R 643; r261] in
  let r263 = Sub [S (T T_RPAREN); r262] in
  let r264 = Sub [S (T T_LPAREN); r263] in
  let r265 = Sub [r264; R 229] in
  let r266 = Sub [R 639; R 353; R 347] in
  let r267 = Sub [S (T T_DOWNTO); R 180] in
  let r268 = Sub [S (N N_simple_expr_call); R 238] in
  let r269 = Sub [S (T T_RPAREN); r268] in
  let r270 = Sub [S (N N_expr); r269] in
  let r271 = Sub [r267; r270] in
  let r272 = Sub [S (N N_expr); r271] in
  let r273 = Sub [S (T T_IN); r272] in
  let r274 = Sub [r81; r273] in
  let r275 = Sub [S (T T_LPAREN); r274] in
  let r276 = Sub [S (T T_UNDERSCORE); R 226] in
  let r277 = Sub [S (N N_expr); R 230] in
  let r278 = Sub [S (T T_EQUALGREATER); r277] in
  let r279 = Sub [S (T T_RPAREN); R 225] in
  let r280 = Sub [S (T T_RPAREN); R 223] in
  let r281 = Sub [S (T T_RBRACKET); R 793] in
  let r282 = Sub [S (N N_expr); r281] in
  let r283 = Sub [S (T T_RBRACE); R 792] in
  let r284 = Sub [S (T T_LBRACE); r283] in
  let r285 = Sub [S (T T_RPAREN); R 809] in
  let r286 = Sub [r46; r285] in
  let r287 = Sub [S (T T_COLON); r286] in
  let r288 = Sub [S (T T_RPAREN); R 487] in
  let r289 = Sub [S (T T_RPAREN); R 302] in
  let r290 = Sub [r117; R 504] in
  let r291 = Sub [S (T T_EQUALGREATER); r290] in
  let r292 = Sub [R 647; r291] in
  let r293 = Sub [r45; R 511] in
  let r294 = Sub [S (T T_RPAREN); R 516] in
  let r295 = Sub [r117; r294] in
  let r296 = Sub [S (T T_OF); r295] in
  let r297 = Sub [S (T T_RPAREN); R 305] in
  let r298 = Sub [S (N N_expr); R 274] in
  let r299 = Sub [R 617; R 276] in
  let r300 = Sub [S (N N_expr); R 273] in
  let r301 = Sub [S (T T_COLON); r300] in
  let r302 = Sub [S (T T_RBRACKET); R 799] in
  let r303 = Sub [S (T T_LESSSLASHIDENTGREATER); R 331] in
  let r304 = Sub [S (T T_LESSSLASHIDENTGREATER); R 332] in
  let r305 = Sub [S (T T_RBRACKET); R 835] in
  let r306 = Sub [S (N N_expr); r305] in
  let r307 = Sub [S (T T_RBRACKET); R 836] in
  let r308 = Sub [S (N N_expr); r307] in
  let r309 = Sub [S (N N_expr); R 426] in
  let r310 = Sub [S (T T_RBRACE); R 837] in
  let r311 = Sub [R 617; r310] in
  let r312 = Sub [r114; R 428; r299] in
  let r313 = Sub [S (T T_BARRBRACKET); R 798] in
  let r314 = Sub [S (T T_LIDENT); R 293; R 430] in
  let r315 = Sub [S (T T_GREATERRBRACE); R 804] in
  let r316 = Sub [R 617; r315] in
  let r317 = Sub [R 617; R 715] in
  let r318 = Sub [S (N N_expr); r317] in
  let r319 = Sub [S (T T_COLON); r318] in
  let r320 = Sub [R 617; R 700] in
  let r321 = Sub [R 398; r320] in
  let r322 = Sub [r217; r321] in
  let r323 = Sub [R 621; r322] in
  let r324 = Sub [S (T T_COMMA); r323] in
  let r325 = Sub [r217; R 445] in
  let r326 = Sub [R 617; R 701] in
  let r327 = Sub [R 641; R 975] in
  let r328 = Sub [R 617; R 699] in
  let r329 = Sub [R 398; r328] in
  let r330 = Sub [R 617; R 978] in
  let r331 = Sub [R 617; R 704] in
  let r332 = Sub [S (N N_expr); r331] in
  let r333 = Sub [R 617; R 709] in
  let r334 = Sub [R 398; r333] in
  let r335 = Sub [r217; r334] in
  let r336 = Sub [R 617; R 708] in
  let r337 = Sub [R 398; r336] in
  let r338 = Sub [R 617; R 707] in
  let r339 = Sub [R 398; r338] in
  let r340 = Sub [R 617; R 706] in
  let r341 = Sub [R 398; r340] in
  let r342 = Sub [S (T T_RBRACKET); R 794] in
  let r343 = Sub [S (N N_expr); r342] in
  let r344 = Sub [S (T T_LBRACKET); r343] in
  let r345 = Sub [S (T T_RBRACE); R 795] in
  let r346 = Sub [R 617; r345] in
  let r347 = Sub [r309; r346] in
  let r348 = Sub [S (N N_expr); R 231] in
  let r349 = Sub [S (T T_EQUALGREATER); r348] in
  let r350 = Sub [r260; R 300] in
  let r351 = Sub [R 643; r350] in
  let r352 = Sub [r260; R 301] in
  let r353 = Sub [R 643; r352] in
  let r354 = Sub [S (T T_RPAREN); r353] in
  let r355 = Sub [r260; R 299] in
  let r356 = Sub [R 643; r355] in
  let r357 = Sub [S (T T_RPAREN); r356] in
  let r358 = Sub [S (N N_expr); R 472] in
  let r359 = Sub [S (T T_EQUALGREATER); r358] in
  let r360 = Sub [R 651; r359] in
  let r361 = Sub [r39; R 1000] in
  let r362 = Sub [R 627; r361] in
  let r363 = Sub [S (T T_RPAREN); R 1072] in
  let r364 = Sub [S (N N_expr); r363] in
  let r365 = Sub [S (T T_COMMA); r364] in
  let r366 = Sub [S (N N_expr); r365] in
  let r367 = Sub [S (T T_LPAREN); r366] in
  let r368 = Sub [S (T T_RPAREN); r367] in
  let r369 = Sub [S (N N_expr); R 1103] in
  let r370 = Sub [S (T T_MODULE); R 612] in
  let r371 = Sub [S (N N_expr); R 364] in
  let r372 = Sub [S (T T_EQUAL); r371] in
  let r373 = Sub [r81; r372] in
  let r374 = Sub [r373; R 358] in
  let r375 = Sub [R 696; r374] in
  let r376 = Sub [S (N N_expr); R 365] in
  let r377 = Sub [S (T T_EQUAL); r376] in
  let r378 = Sub [S (N N_expr); R 195] in
  let r379 = Sub [S (T T_EQUAL); r378] in
  let r380 = Sub [r379; R 294] in
  let r381 = Sub [R 639; r380] in
  let r382 = Sub [r379; R 296] in
  let r383 = Sub [R 639; r382] in
  let r384 = Sub [r379; R 297] in
  let r385 = Sub [R 639; r384] in
  let r386 = Sub [S (T T_RPAREN); r385] in
  let r387 = Sub [r379; R 295] in
  let r388 = Sub [R 639; r387] in
  let r389 = Sub [S (T T_RPAREN); r388] in
  let r390 = Sub [S (T T_LIDENT); R 538] in
  let r391 = Sub [S (N N_expr); R 363] in
  let r392 = Sub [S (T T_EQUAL); r391] in
  let r393 = Sub [r18; r392] in
  let r394 = Sub [S (T T_DOT); r393] in
  let r395 = Sub [S (N N_expr); R 362] in
  let r396 = Sub [S (T T_EQUAL); r395] in
  let r397 = Sub [r18; r396] in
  let r398 = Sub [S (N N_expr); R 360] in
  let r399 = Sub [S (N N_simple_expr_call); R 1068] in
  let r400 = Sub [r2; r399] in
  let r401 = Sub [r264; R 1062] in
  let r402 = Sub [S (N N_simple_expr_call); R 1071] in
  let r403 = Sub [S (T T_RPAREN); r402] in
  let r404 = Sub [S (N N_expr); r403] in
  let r405 = Sub [r267; r404] in
  let r406 = Sub [S (N N_expr); r405] in
  let r407 = Sub [S (T T_IN); r406] in
  let r408 = Sub [r81; r407] in
  let r409 = Sub [S (T T_LPAREN); r408] in
  let r410 = Sub [S (T T_SEMI); R 991] in
  let r411 = Sub [r18; r410] in
  let r412 = Sub [S (T T_COLON); r411] in
  let r413 = Sub [S (T T_STRING); R 540; R 693] in
  let r414 = Sub [S (T T_TRUE); R 151] in
  let r415 = Sub [r414; R 291] in
  let r416 = Sub [S (T T_TRUE); S (T T_EQUAL); r415; R 188] in
  let r417 = Sub [S (T T_RPAREN); R 149] in
  let r418 = Sub [S (N N_expr); R 1063] in
  let r419 = Sub [S (T T_EQUALGREATER); r418] in
  let r420 = Sub [S (N N_expr); R 1064] in
  let r421 = Sub [S (T T_EQUALGREATER); r420] in
  let r422 = Sub [S (T T_SEMI); R 751] in
  let r423 = Sub [r18; r422] in
  let r424 = Sub [S (T T_COLON); r423] in
  let r425 = Sub [R 629; R 116] in
  let r426 = Sub [r425; R 115] in
  let r427 = Sub [S (T T_RBRACE); R 136] in
  let r428 = Sub [r426; r427] in
  let r429 = Sub [S (T T_LBRACE); r428; R 194; R 138] in
  let r430 = Sub [R 402; r429] in
  let r431 = Sub [S (T T_LIDENT); r430] in
  let r432 = Sub [R 1120; r431] in
  let r433 = Sub [R 371; R 139] in
  let r434 = Sub [r432; r433] in
  let r435 = Sub [r39; R 1052] in
  let r436 = Sub [S (T T_QUOTE); r435; R 1050] in
  let r437 = Sub [S (T T_RPAREN); R 403] in
  let r438 = Sub [R 617; r437] in
  let r439 = Sub [r18; R 1119] in
  let r440 = Sub [S (T T_COLON); r439] in
  let r441 = Sub [S (T T_LIDENT); r440] in
  let r442 = Sub [R 528; r441] in
  let r443 = Sub [r160; R 124] in
  let r444 = Sub [S (T T_COLON); r443] in
  let r445 = Sub [S (T T_LIDENT); r444] in
  let r446 = Sub [r160; R 122] in
  let r447 = Sub [S (T T_COLON); r446] in
  let r448 = Sub [S (T T_LIDENT); r447] in
  let r449 = Sub [R 410; R 105] in
  let r450 = Sub [S (T T_LIDENT); R 141; r449] in
  let r451 = Sub [S (T T_LIDENT); R 142] in
  let r452 = Sub [R 617; R 135] in
  let r453 = Sub [S (T T_RPAREN); R 411] in
  let r454 = Sub [S (T T_RBRACE); R 137] in
  let r455 = Sub [r18; R 153] in
  let r456 = Sub [S (T T_EQUAL); r455] in
  let r457 = Sub [r18; r456] in
  let r458 = Sub [r160; R 125] in
  let r459 = Sub [S (T T_COLON); r458] in
  let r460 = Sub [S (T T_LIDENT); r459] in
  let r461 = Sub [r160; R 123] in
  let r462 = Sub [S (T T_COLON); r461] in
  let r463 = Sub [S (T T_LIDENT); r462] in
  let r464 = Sub [r432; R 18] in
  let r465 = Sub [r450; R 64] in
  let r466 = Sub [r465; R 77] in
  let r467 = Sub [S (T T_COLON); r466] in
  let r468 = Sub [R 402; r467] in
  let r469 = Sub [S (T T_LIDENT); r468] in
  let r470 = Sub [r465; R 65] in
  let r471 = Sub [R 1120; r469] in
  let r472 = Sub [r471; R 16] in
  let r473 = Sub [r209; R 758] in
  let r474 = Sub [r43; R 520] in
  let r475 = Sub [R 378; R 760] in
  let r476 = Sub [r474; R 21] in
  let r477 = Sub [r474; R 22] in
  let r478 = Sub [S (T T_UIDENT); r477] in
  let r479 = Sub [S (T T_UIDENT); R 615] in
  let r480 = Sub [r59; R 1034] in
  let r481 = Sub [R 566; r480] in
  let r482 = Sub [r150; R 742] in
  let r483 = Sub [r150; R 743] in
  let r484 = Sub [R 220; r483] in
  let r485 = Sub [S (T T_PLUSEQ); r484] in
  let r486 = Sub [r54; r485] in
  let r487 = Sub [S (T T_LIDENT); r486] in
  let r488 = Sub [r209; R 584] in
  let r489 = Sub [r39; R 763] in
  let r490 = Sub [r18; R 748] in
  let r491 = Sub [S (T T_SEMI); R 752] in
  let r492 = Sub [r18; r491] in
  let r493 = Sub [S (T T_COLON); r492] in
  let r494 = Sub [R 371; R 140] in
  let r495 = Sub [r432; r494] in
  let r496 = Sub [r209; R 759] in
  let r497 = Sub [R 378; R 761] in
  let r498 = Sub [R 629; R 571] in
  let r499 = Sub [r498; R 570; R 91] in
  let r500 = Sub [S (T T_RBRACE); R 192] in
  let r501 = Sub [r499; r500] in
  let r502 = Sub [S (T T_LBRACE); r501; R 66] in
  let r503 = Sub [R 637; r502] in
  let r504 = Sub [r503; R 67] in
  let r505 = Sub [S (T T_LIDENT); r504] in
  let r506 = Sub [R 1120; r505] in
  let r507 = Sub [R 367; R 1005] in
  let r508 = Sub [r503; R 68] in
  let r509 = Sub [r34; R 131; R 80] in
  let r510 = Sub [S (T T_RPAREN); R 134] in
  let r511 = Sub [S (T T_RBRACE); R 132] in
  let r512 = Sub [R 635; R 92] in
  let r513 = Sub [r509; r512] in
  let r514 = Sub [R 420; R 87] in
  let r515 = Sub [r509; R 81] in
  let r516 = Sub [S (T T_EQUALGREATER); r515] in
  let r517 = Sub [S (T T_RPAREN); r516] in
  let r518 = Sub [r509; R 83] in
  let r519 = Sub [S (T T_EQUALGREATER); r518] in
  let r520 = Sub [r509; R 84] in
  let r521 = Sub [S (T T_EQUALGREATER); r520] in
  let r522 = Sub [S (T T_RPAREN); r521] in
  let r523 = Sub [r509; R 82] in
  let r524 = Sub [S (T T_EQUALGREATER); r523] in
  let r525 = Sub [S (T T_RPAREN); r524] in
  let r526 = Sub [r18; R 1113] in
  let r527 = Sub [S (T T_COLON); r526] in
  let r528 = Sub [S (N N_expr); R 1114] in
  let r529 = Sub [S (N N_expr); R 1118] in
  let r530 = Sub [r373; R 359] in
  let r531 = Sub [R 696; r530] in
  let r532 = Sub [R 633; r531] in
  let r533 = Sub [R 635; R 93] in
  let r534 = Sub [r509; r533] in
  let r535 = Sub [r379; R 476] in
  let r536 = Sub [R 645; r535] in
  let r537 = Sub [S (T T_LIDENT); r536] in
  let r538 = Sub [R 659; r537] in
  let r539 = Sub [r160; R 474] in
  let r540 = Sub [S (T T_COLON); r539] in
  let r541 = Sub [r379; R 477] in
  let r542 = Sub [r18; r541] in
  let r543 = Sub [S (T T_DOT); r542] in
  let r544 = Sub [r81; R 111] in
  let r545 = Sub [r499; R 90] in
  let r546 = Sub [R 373; R 374] in
  let r547 = Sub [R 373; R 375] in
  let r548 = Sub [r373; r547] in
  let r549 = Sub [S (T T_RPAREN); R 133] in
  let r550 = Sub [r503; R 70] in
  let r551 = Sub [r503; R 71] in
  let r552 = Sub [S (T T_RPAREN); r551] in
  let r553 = Sub [r503; R 72] in
  let r554 = Sub [S (T T_RPAREN); r553] in
  let r555 = Sub [r503; R 73] in
  let r556 = Sub [r503; R 75] in
  let r557 = Sub [r503; R 76] in
  let r558 = Sub [S (T T_RPAREN); r557] in
  let r559 = Sub [r503; R 74] in
  let r560 = Sub [S (T T_RPAREN); r559] in
  let r561 = Sub [r503; R 69] in
  let r562 = Sub [S (T T_RPAREN); r561] in
  let r563 = Sub [r506; R 14] in
  let r564 = Sub [S (N N_expr); R 1106] in
  let r565 = Sub [S (T T_COLON); r564] in
  let r566 = Sub [S (N N_expr); R 1100] in
  let r567 = Sub [S (N N_expr); R 1101] in
  let r568 = Sub [S (N N_expr); R 1102] in
  let r569 = Sub [S (N N_expr); R 1099] in
  let r570 = Sub [r117; R 507] in
  let r571 = Sub [S (T T_EQUAL); r570] in
  let r572 = Sub [r571; R 490] in
  let r573 = Sub [R 404; r572] in
  let r574 = Sub [r571; R 491] in
  let r575 = Sub [R 376; R 998] in
  let r576 = Sub [r573; R 19] in
  let r577 = Sub [r573; R 20] in
  let r578 = Sub [S (T T_UIDENT); r577] in
  let r579 = Sub [R 380; R 37] in
  let r580 = Sub [r416; r579] in
  let r581 = Sub [r580; R 973] in
  let r582 = Sub [r416; R 546] in
  let r583 = Sub [R 380; R 381] in
  let r584 = Sub [R 380; R 382] in
  let r585 = Sub [R 380; R 383] in
  let r586 = Sub [r416; r585] in
  let r587 = Sub [R 380; R 384] in
  let r588 = Sub [r580; R 974] in
  let r589 = Sub [R 220; r588] in
  let r590 = Sub [S (T T_PLUSEQ); r589] in
  let r591 = Sub [r54; r590] in
  let r592 = Sub [S (T T_LIDENT); r591] in
  let r593 = Sub [r39; R 1001] in
  let r594 = Sub [R 627; r593] in
  let r595 = Sub [S (T T_SEMI); R 992] in
  let r596 = Sub [r18; r595] in
  let r597 = Sub [S (T T_COLON); r596] in
  let r598 = Sub [R 367; R 1006] in
  let r599 = Sub [R 376; R 999] in
  let r600 = Sub [S (N N_simple_expr_call); R 1061; R 985] in
  let r601 = Sub [S (N N_expr); R 690] in
  let r602 = Sub [r143; R 1112] in
  let r603 = Sub [S (T T_UNDERSCORE); R 343] in
  let r604 = Sub [S (T T_RPAREN); R 337] in
  let r605 = Sub [S (T T_LESSSLASHIDENTGREATER); R 318] in
  let r606 = Sub [S (T T_RBRACKET); R 867] in
  let r607 = Sub [r8; R 735] in
  let r608 = Sub [r8; R 733] in
  let r609 = Sub [S (T T_SEMI); r608] in
  let r610 = Sub [r209; r609] in
  let r611 = Sub [R 659; r610] in
  let r612 = Sub [r8; R 732] in
  let r613 = Sub [S (T T_SEMI); r612] in
  let r614 = Sub [r8; R 734] in
  let r615 = Sub [S (T T_SEMI); r614] in
  let r616 = Sub [r209; r615] in
  let r617 = Sub [R 659; r616] in
  let r618 = Sub [S (T T_OPEN); r617] in
  let r619 = Sub [R 629; R 731] in
  let r620 = Sub [S (T T_RBRACKET); R 868] in
  let r621 = Sub [S (N N_expr); r620] in
  let r622 = Sub [S (T T_RBRACE); R 869] in
  let r623 = Sub [R 617; r622] in
  let r624 = Sub [S (T T_RBRACE); R 866] in
  let r625 = Sub [S (T T_LBRACE); r624] in
  let r626 = Sub [S (T T_RPAREN); R 883] in
  let r627 = Sub [r46; r626] in
  let r628 = Sub [S (T T_COLON); r627] in
  let r629 = Sub [S (T T_RBRACKET); R 873] in
  let r630 = Sub [S (T T_BARRBRACKET); R 872] in
  let r631 = Sub [S (T T_GREATERRBRACE); R 878] in
  let r632 = Sub [R 617; r631] in
  let r633 = Sub [S (T T_RBRACKET); R 841] in
  let r634 = Sub [S (T T_BARRBRACKET); R 840] in
  let r635 = Sub [S (T T_GREATERRBRACE); R 846] in
  let r636 = Sub [R 617; r635] in
  let r637 = Sub [S (T T_RPAREN); R 536] in
  let r638 = Sub [S (T T_GREATERRBRACE); R 818] in
  let r639 = Sub [r46; R 497] in
  let r640 = Sub [r46; R 495] in
  let r641 = Sub [r46; R 496] in
  let r642 = Sub [S (T T_RPAREN); R 821] in
  let r643 = Sub [S (T T_RPAREN); R 239] in
  let r644 = Sub [S (N N_expr); r643] in
  let r645 = Sub [S (T T_COMMA); r644] in
  let r646 = Sub [S (N N_expr); r645] in
  let r647 = Sub [S (T T_LPAREN); r646] in
  let r648 = Sub [S (T T_BARRBRACKET); R 827] in
  let r649 = Sub [r39; R 560] in
  let r650 = Sub [r68; R 164] in
  let r651 = Sub [r68; R 161] in
  let r652 = Sub [S (T T_RPAREN); r651] in
  let r653 = Sub [r68; R 160] in
  let r654 = Sub [S (T T_RBRACKET); r653] in
  let r655 = Sub [S (T T_TRUE); r650] in
  let r656 = Sub [r68; R 168] in
  let r657 = Sub [S (T T_COLONCOLON); r656] in
  let r658 = Sub [r68; R 165] in
  let r659 = Sub [r68; R 167] in
  let r660 = Sub [S (T T_RPAREN); r659] in
  let r661 = Sub [r68; R 166] in
  let r662 = Sub [S (T T_RBRACKET); r661] in
  let r663 = Sub [r655; R 42] in
  let r664 = Sub [R 23; R 173] in
  let r665 = Sub [r664; R 171] in
  let r666 = Sub [R 526; r186; R 454; r188] in
  let r667 = Sub [r580; R 971] in
  let r668 = Sub [r580; R 972] in
  let r669 = Sub [R 220; r668] in
  let r670 = Sub [S (T T_PLUSEQ); r669] in
  let r671 = Sub [r54; r670] in
  let r672 = Sub [S (T T_LIDENT); r671] in
  let r673 = Sub [S (N N_expr); R 1116] in
  let r674 = Sub [S (T T_RBRACE); R 59] in
  let r675 = Sub [R 617; r674] in
  let r676 = Sub [S (T T_DOT); r284] in
  let r677 = Sub [R 213; R 1020] in
  let r678 = Sub [S (T T_EOF); R 202; R 1108] in
  let r679 = Sub [S (T T_EQUAL); r566] in
  let r680 = Sub [S (T T_RBRACKET); r679] in
  let r681 = Sub [S (T T_EQUAL); r567] in
  let r682 = Sub [S (T T_RBRACKET); r681] in
  let r683 = Sub [S (N N_expr); r682] in
  let r684 = Sub [S (T T_EQUAL); r568] in
  let r685 = Sub [S (T T_RBRACE); r684] in
  let r686 = Sub [R 617; r685] in
  function
  | 0 | 2316 | 2320 | 2324 | 2328 | 2332 | 2349 -> Nothing
  | 1 -> One [R 657; r4]
  | 2 -> One [r5; R 314]
  | 3 -> One [R 968]
  | 4 -> One [R 967]
  | 5 -> One [R 966]
  | 6 -> One [R 965]
  | 7 -> One [R 964]
  | 8 -> One [R 920]
  | 9 -> One [R 963]
  | 10 -> One [R 962]
  | 11 -> One [R 961]
  | 12 -> One [R 960]
  | 13 -> One [R 959]
  | 14 -> One [R 946]
  | 15 -> One [R 958]
  | 16 -> One [R 957]
  | 17 -> One [R 956]
  | 18 -> One [R 955]
  | 19 -> One [R 954]
  | 20 -> One [R 953]
  | 21 -> One [R 952]
  | 22 -> One [R 951]
  | 23 -> One [R 950]
  | 24 -> One [R 949]
  | 25 -> One [R 948]
  | 26 -> One [R 947]
  | 27 -> One [R 919]
  | 28 -> One [R 945]
  | 29 -> One [R 944]
  | 30 -> One [R 943]
  | 31 -> One [R 942]
  | 32 -> One [R 941]
  | 33 -> One [R 940]
  | 34 -> One [R 939]
  | 35 -> One [R 938]
  | 36 -> One [R 937]
  | 37 -> One [R 936]
  | 38 -> One [R 935]
  | 39 -> One [R 934]
  | 40 -> One [R 933]
  | 41 -> One [R 932]
  | 42 -> One [R 931]
  | 43 -> One [R 930]
  | 44 -> One [R 929]
  | 45 -> One [R 928]
  | 46 -> One [R 927]
  | 47 -> One [R 926]
  | 48 -> One [R 925]
  | 49 -> One [R 924]
  | 50 -> One [R 923]
  | 51 -> One [R 922]
  | 52 -> One [R 921]
  | 53 -> One [R 33]
  | 54 -> One [r5; R 34]
  | 55 -> One [R 34]
  | 56 -> One [R 314]
  | 57 -> One [r4]
  | 58 -> One [r1]
  | 59 -> One [R 657; r7]
  | 60 -> One [r7]
  | 61 -> One [r8; r9]
  | 62 -> One [r14; R 94]
  | 63 -> One [R 526; r21]
  | 64 -> One [R 527]
  | 65 -> One [r21]
  | 66 -> One [r20]
  | 67 -> One [r18; R 1023]
  | 68 -> One [R 49]
  | 69 -> One [R 481]
  | 70 -> One [r25]
  | 71 -> One [R 434]
  | 72 -> One [r26]
  | 73 -> One [R 482]
  | 74 -> One [r23; r27]
  | 75 -> One [R 483]
  | 76 -> One [r23; r28]
  | 77 -> One [r28]
  | 78 -> One [R 480]
  | 79 -> One [r22; R 435]
  | 80 -> One [R 435]
  | 81 -> One [r27]
  | 82 -> One [R 479]
  | 83 -> One [r24]
  | 84 -> One [R 478]
  | 85 -> One [S (T T_LIDENT); r33]
  | 86 -> One [r33]
  | 87 -> One [r32]
  | 88 -> One [r34; R 48]
  | 89 -> One [R 484]
  | 90 -> One [R 109]
  | 91 -> One [S (T T_DOT); r35]
  | 92 -> One [r35]
  | 93 -> One [R 485]
  | 94 -> One [R 110]
  | 95 -> One [R 48]
  | 96 -> One [r38]
  | 97 -> One [r40]
  | 98 -> One [R 309]
  | 99 -> One [R 310]
  | 100 -> One [R 47]
  | 101 -> One [r46; R 694]
  | 102 -> One [R 481]
  | 103 -> One [r49]
  | 104 -> One [S (T T_COLON); r50]
  | 105 -> One [r50]
  | 106 -> One [r5; r53]
  | 107 -> One [r53]
  | 108 -> One [r61]
  | 109 -> One [R 567]
  | 110 -> One [r60]
  | 111 -> One [r63]
  | 112 -> One [r66]
  | 113 -> One [R 208]
  | 114 -> One [r39; R 207]
  | 115 -> One [R 207]
  | 116 -> One [S (T T_UNDERSCORE); R 210]
  | 117 -> One [R 210]
  | 118 -> One [r39; R 209]
  | 119 -> One [R 209]
  | 120 -> One [S (T T_UNDERSCORE); R 212]
  | 121 -> One [R 212]
  | 122 -> One [r39; R 211]
  | 123 -> One [R 211]
  | 124 -> One [r65]
  | 125 -> One [R 413]
  | 126 -> One [R 462]
  | 127 -> One [r64]
  | 128 -> One [R 618]
  | 129 -> One [R 463]
  | 130 -> One [R 1053]
  | 131 -> One [R 1055]
  | 132 -> One [r62]
  | 133 -> One [S (T T_DOTDOT); R 1044]
  | 134 -> One [r69]
  | 136 -> One [R 1035]
  | 137 -> One [r73; r75]
  | 138 -> One [R 416; r76]
  | 139 -> One [r5; r78]
  | 140 -> One [r78]
  | 141 -> One [R 657; r91]
  | 142 -> One [r91]
  | 143 -> One [R 151]
  | 144 -> One [R 146]
  | 145 -> One [S (N N_simple_expr_no_constructor); R 876]
  | 146 -> One [r34; R 877]
  | 147 -> One [R 877]
  | 148 -> One [r93]
  | 149 -> One [R 657; r98]
  | 150 -> One [r98]
  | 151 -> One [R 1109]
  | 152 -> One [R 319; R 325]
  | 153 -> One [S (T T_LIDENT); r99]
  | 154 -> One [r99]
  | 155 -> One [R 319; R 323]
  | 156 -> One [R 324]
  | 157 -> One [S (N N_simple_expr_call); r100]
  | 158 -> One [S (N N_simple_expr_call); r101]
  | 159 -> One [S (N N_simple_expr_call); R 802]
  | 160 -> One [r34; R 803]
  | 161 -> One [R 803]
  | 162 -> One [r93]
  | 163 -> One [R 657; r106]
  | 164 -> One [r106]
  | 165 -> One [R 392; r107]
  | 166 -> One [S (N N_simple_expr_no_call); R 844]
  | 167 -> One [r34; R 845]
  | 168 -> One [R 845]
  | 169 -> One [r93]
  | 170 -> One [R 598]
  | 171 -> One [R 592]
  | 172 -> One [R 149]
  | 173 -> One [R 585]
  | 174 -> One [r22; r108]
  | 175 -> One [r108]
  | 176 -> One [R 326]
  | 177 -> One [r111; r112]
  | 178 -> One [R 319; R 328]
  | 179 -> One [R 328]
  | 180 -> One [r110]
  | 181 -> One [R 617; r113]
  | 182 -> One [R 622]
  | 183 -> One [R 618]
  | 184 -> One [r115]
  | 185 -> One [R 12]
  | 186 -> One [R 11]
  | 187 -> One [R 1015]
  | 188 -> One [R 1014]
  | 190 -> One [R 586]
  | 191 -> One [R 606]
  | 192 -> One [R 595]
  | 193 -> One [R 594]
  | 194 -> One [R 607]
  | 195 -> One [R 601]
  | 196 -> One [r117; r118]
  | 197 -> One [r116]
  | 198 -> One [S (N N_expr); R 494]
  | 200 -> One [r119]
  | 201 -> One [R 617; r120]
  | 202 -> One [r120]
  | 203 -> One [R 784]
  | 204 -> One [R 617; r121]
  | 205 -> One [R 618]
  | 206 -> One [r114; R 443]
  | 208 -> One [R 148]
  | 209 -> One [r122]
  | 210 -> One [R 275]
  | 211 -> One [r123]
  | 212 -> One [R 812]
  | 213 -> One [S (T T_GREATERRBRACE); R 819]
  | 214 -> One [R 293]
  | 215 -> One [S (N N_expr); R 292]
  | 216 -> One [S (N N_simple_expr_call); R 272]
  | 217 -> One [R 143]
  | 218 -> One [R 145]
  | 219 -> One [R 150]
  | 220 -> One [R 144]
  | 221 -> One [r39; R 787]
  | 222 -> One [R 787]
  | 223 -> One [S (T T_RPAREN); R 537]
  | 224 -> One [R 537]
  | 225 -> One [R 657; r125]
  | 226 -> One [r125]
  | 227 -> One [r124]
  | 228 -> One [R 780]
  | 229 -> One [R 1111]
  | 230 -> One [R 813]
  | 231 -> One [R 783]
  | 232 -> One [R 235]
  | 233 -> One [S (N N_simple_expr_no_call); R 806]
  | 234 -> One [r126]
  | 235 -> One [r39; R 829]
  | 236 -> One [R 829]
  | 237 -> One [R 888]
  | 238 -> One [R 887]
  | 239 -> One [R 814]
  | 240 -> One [R 822]
  | 241 -> One [R 853]
  | 242 -> One [R 806]
  | 243 -> One [R 825]
  | 244 -> One [S (T T_DOT); r128]
  | 245 -> One [r128]
  | 246 -> One [r93]
  | 247 -> One [r117; r131]
  | 248 -> One [R 982; r132]
  | 249 -> One [R 657; r137]
  | 250 -> One [r137]
  | 251 -> One [R 617; r138]
  | 252 -> One [r138]
  | 253 -> One [R 858]
  | 254 -> One [R 617; r139]
  | 255 -> One [r139]
  | 256 -> One [R 859]
  | 257 -> One [r39; R 861]
  | 258 -> One [R 861]
  | 259 -> One [R 854]
  | 260 -> One [r136]
  | 261 -> One [S (N N_simple_expr_no_call); R 880]
  | 262 -> One [R 880]
  | 263 -> One [S (T T_SLASHGREATER); R 316]
  | 264 -> One [R 316]
  | 265 -> One [R 307]
  | 266 -> One [R 392; r140]
  | 267 -> One [R 308]
  | 268 -> One [R 392; R 393]
  | 269 -> One [S (N N_simple_expr_no_call); R 848]
  | 270 -> One [R 848]
  | 271 -> One [R 824]
  | 272 -> One [R 852]
  | 273 -> One [R 828]
  | 274 -> One [R 886]
  | 275 -> One [R 885]
  | 276 -> One [R 823]
  | 277 -> One [S (N N_simple_expr_call); R 849]
  | 278 -> One [R 849]
  | 279 -> One [R 789]
  | 280 -> One [S (N N_simple_expr_no_call); R 808]
  | 281 -> One [R 808]
  | 282 -> One [R 617; r141]
  | 283 -> One [S (T T_RPAREN); R 338]
  | 284 -> One [R 338]
  | 285 -> One [r142; R 466]
  | 286 -> One [R 344]
  | 287 -> One [r143; R 1111; r144]
  | 288 -> One [r93]
  | 289 -> One [R 585]
  | 290 -> One [R 595]
  | 291 -> One [R 594]
  | 292 -> One [R 597]
  | 293 -> One [R 596]
  | 294 -> One [r93]
  | 295 -> One [R 608]
  | 296 -> One [R 599]
  | 297 -> One [R 593]
  | 298 -> One [R 591]
  | 299 -> One [R 590]
  | 300 -> One [R 589]
  | 301 -> One [R 588]
  | 302 -> One [R 610]
  | 303 -> One [R 600]
  | 304 -> One [R 609]
  | 305 -> One [R 605]
  | 306 -> One [R 602]
  | 307 -> One [R 587]
  | 308 -> One [R 603]
  | 309 -> One [R 604]
  | 310 -> One [r92]
  | 311 -> One [R 1110]
  | 312 -> One [R 653; R 401]
  | 313 -> One [r146]
  | 314 -> One [r46; R 1024]
  | 315 -> One [r42]
  | 316 -> One [r61]
  | 317 -> One [r60]
  | 318 -> One [r58]
  | 319 -> One [r66]
  | 320 -> One [r57]
  | 321 -> One [R 220; r151]
  | 322 -> One [R 221]
  | 323 -> One [r151]
  | 324 -> One [r152]
  | 325 -> One [r156]
  | 326 -> One [r73; r157]
  | 327 -> One [r158]
  | 328 -> One [R 578]
  | 329 -> One [R 408; r159]
  | 330 -> One [S (T T_COLON); r161]
  | 331 -> One [r161]
  | 334 -> One [r162]
  | 335 -> One [R 564]
  | 336 -> One [R 565]
  | 337 -> One [S (T T_LPAREN); r167; r169]
  | 338 -> One [r167]
  | 339 -> One [R 620]
  | 340 -> One [r164]
  | 341 -> One [S (T T_LIDENT); r171]
  | 342 -> One [r171]
  | 343 -> One [r170]
  | 344 -> One [R 36]
  | 345 -> One [R 177]
  | 346 -> One [R 535]
  | 347 -> One [R 50]
  | 348 -> One [R 45]
  | 349 -> One [R 27]
  | 350 -> One [r30]
  | 351 -> One [R 656]
  | 352 -> One [R 354]
  | 353 -> One [R 51]
  | 354 -> One [r172]
  | 355 -> One [R 178]
  | 356 -> One [R 533]
  | 357 -> One [R 1059]
  | 358 -> One [S (T T_DOT); r173]
  | 360 -> One [R 1036]
  | 361 -> One [S (T T_EQUALGREATER); r174]
  | 362 -> One [r174]
  | 363 -> One [R 55]
  | 364 -> One [R 31]
  | 365 -> One [R 534]
  | 366 -> One [r17; R 32]
  | 367 -> One [R 32]
  | 368 -> One [R 542]
  | 369 -> One [R 543]
  | 370 -> One [R 1060]
  | 371 -> One [R 175]
  | 372 -> One [S (T T_QUOTE); r175]
  | 373 -> One [r175]
  | 374 -> One [R 176]
  | 375 -> One [R 695]
  | 376 -> One [R 26]
  | 377 -> One [R 28]
  | 378 -> One [R 464]
  | 379 -> One [r166]
  | 380 -> One [R 618]
  | 381 -> One [r163; R 465]
  | 382 -> One [R 465]
  | 383 -> One [r165]
  | 384 -> One [R 29]
  | 385 -> One [r169]
  | 386 -> One [r168]
  | 387 -> One [R 30]
  | 388 -> One [R 979]
  | 389 -> One [S (T T_DOT); r176]
  | 390 -> One [r176]
  | 391 -> One [R 692]
  | 392 -> One [R 691]
  | 393 -> One [R 573]
  | 394 -> One [r160; R 575]
  | 395 -> One [R 575]
  | 396 -> One [S (T T_RBRACE); R 580]
  | 397 -> One [R 580]
  | 398 -> One [R 458]
  | 399 -> One [R 409]
  | 400 -> One [R 440]
  | 401 -> One [r177]
  | 402 -> One [r179]
  | 403 -> One [r178]
  | 404 -> One [R 980]
  | 405 -> One [R 574]
  | 406 -> One [r160; R 576]
  | 407 -> One [R 576]
  | 408 -> One [R 617; R 981]
  | 409 -> One [R 618]
  | 410 -> One [R 459]
  | 411 -> One [S (T T_STRING); r179]
  | 412 -> One [R 981]
  | 413 -> One [R 617; R 577]
  | 414 -> One [R 618]
  | 415 -> One [R 441]
  | 416 -> One [r177]
  | 417 -> One [R 577]
  | 418 -> One [r159]
  | 419 -> One [R 582]
  | 420 -> One [R 408; r180]
  | 421 -> One [S (T T_RBRACE); R 579]
  | 422 -> One [R 579]
  | 423 -> One [r180]
  | 424 -> One [R 581]
  | 425 -> One [r71; R 43]
  | 426 -> One [r39; R 1018]
  | 427 -> One [R 1018]
  | 428 -> One [R 57]
  | 429 -> One [r181; R 1016]
  | 430 -> One [R 1016]
  | 431 -> One [R 725]
  | 432 -> One [r181; R 726]
  | 433 -> One [R 726]
  | 434 -> One [R 721]
  | 435 -> One [R 43]
  | 436 -> One [r183]
  | 437 -> One [r182]
  | 438 -> One [R 1019]
  | 439 -> One [r181; R 1017]
  | 440 -> One [R 1017]
  | 441 -> One [R 531]
  | 442 -> One [R 722]
  | 443 -> One [R 534]
  | 444 -> One [R 542]
  | 445 -> One [R 532]
  | 446 -> One [r157]
  | 447 -> One [R 52]
  | 448 -> One [r72]
  | 449 -> One [S (T T_BAR); r184]
  | 450 -> One [r184]
  | 451 -> One [R 44]
  | 452 -> One [R 723]
  | 453 -> One [R 390; R 391]
  | 454 -> One [R 391]
  | 455 -> One [r183]
  | 456 -> One [R 390; R 724]
  | 457 -> One [R 724]
  | 459 -> One [R 454]
  | 460 -> One [R 526; r185]
  | 461 -> One [r185]
  | 462 -> One [R 718]
  | 463 -> One [r160; R 720]
  | 464 -> One [R 720]
  | 465 -> One [r186]
  | 466 -> One [R 717]
  | 467 -> One [r160; R 719]
  | 468 -> One [R 719]
  | 469 -> One [r188]
  | 470 -> One [R 618]
  | 471 -> One [R 455]
  | 472 -> One [r187]
  | 473 -> One [R 698]
  | 474 -> One [S (T T_RPAREN); R 156]
  | 475 -> One [R 156]
  | 476 -> One [r154]
  | 477 -> One [R 618]
  | 478 -> One [R 425]
  | 479 -> One [R 158]
  | 480 -> One [R 424]
  | 481 -> One [r155]
  | 482 -> One [R 157]
  | 483 -> One [R 155]
  | 484 -> One [r67]
  | 485 -> One [r18; R 640]
  | 486 -> One [R 640]
  | 487 -> One [R 306]
  | 488 -> One [R 154]
  | 489 -> One [R 280]
  | 490 -> One [R 632]
  | 491 -> One [r147]
  | 492 -> One [R 285]
  | 493 -> One [r190]
  | 494 -> One [r189]
  | 495 -> One [R 282]
  | 496 -> One [r192]
  | 497 -> One [r191]
  | 498 -> One [R 281]
  | 499 -> One [r193]
  | 500 -> One [R 284]
  | 501 -> One [r194]
  | 502 -> One [R 283]
  | 503 -> One [r148; R 552]
  | 504 -> One [r148; R 553]
  | 505 -> One [R 553]
  | 506 -> One [R 557]
  | 507 -> One [S (T T_BAR); r195]
  | 508 -> One [r195]
  | 509 -> One [r148; R 555]
  | 510 -> One [R 555]
  | 511 -> One [R 559]
  | 512 -> One [R 554]
  | 513 -> One [R 558]
  | 514 -> One [R 552]
  | 515 -> One [R 556]
  | 516 -> One [R 40]
  | 517 -> One [r149]
  | 518 -> One [r148; r196]
  | 519 -> One [r148; r197]
  | 520 -> One [r197]
  | 521 -> One [S (T T_BAR); r199]
  | 522 -> One [r199]
  | 523 -> One [r148; r200]
  | 524 -> One [r200]
  | 525 -> One [R 389]
  | 526 -> One [r198]
  | 527 -> One [R 388]
  | 528 -> One [R 387]
  | 529 -> One [r196]
  | 530 -> One [R 386]
  | 531 -> One [R 39]
  | 532 -> One [R 740]
  | 533 -> One [r55]
  | 534 -> One [r18; r202; R 562]
  | 535 -> One [r202]
  | 536 -> One [r201]
  | 537 -> One [R 152]
  | 538 -> One [R 562]
  | 539 -> One [R 563]
  | 540 -> One [r59; R 24]
  | 541 -> One [r63]
  | 542 -> One [R 1054]
  | 543 -> One [r58]
  | 544 -> One [r57]
  | 545 -> One [R 1026]
  | 546 -> One [R 24]
  | 547 -> One [R 23; R 1032]
  | 548 -> One [S (T T_AND); r203]
  | 549 -> One [r203]
  | 550 -> One [R 25]
  | 551 -> One [R 1032]
  | 552 -> One [R 1031]
  | 553 -> One [R 1033]
  | 554 -> One [S (T T_DOT); r208]
  | 555 -> One [r208]
  | 556 -> One [r207]
  | 557 -> One [r206]
  | 558 -> One [r205]
  | 559 -> One [r204]
  | 560 -> One [R 741]
  | 561 -> One [R 659; r210]
  | 562 -> One [R 660]
  | 563 -> One [r210]
  | 564 -> One [R 583]
  | 565 -> One [r211]
  | 567 -> One [r212]
  | 568 -> One [R 762]
  | 569 -> One [r45; R 521]
  | 570 -> One [R 515]
  | 571 -> One [R 891]
  | 572 -> One [R 890]
  | 573 -> One [R 521]
  | 574 -> One [r216; R 422; R 514]
  | 575 -> One [r217; r220]
  | 576 -> One [R 333]
  | 577 -> One [S (T T_DOT); r221]
  | 578 -> One [r221]
  | 579 -> One [R 334]
  | 580 -> One [r220]
  | 581 -> One [r219]
  | 582 -> One [R 220; r222]
  | 583 -> One [r222]
  | 584 -> One [R 1122]
  | 585 -> One [R 1123]
  | 586 -> One [r218]
  | 587 -> One [R 1124]
  | 588 -> One [r215]
  | 589 -> One [r214]
  | 590 -> One [r213]
  | 591 -> One [R 1126]
  | 592 -> One [S (T T_EQUAL); r223]
  | 593 -> One [r223]
  | 594 -> One [R 1125]
  | 595 -> One [R 422]
  | 596 -> One [R 514]
  | 597 -> One [r216; R 423]
  | 598 -> One [R 423]
  | 599 -> One [S (T T_DOT); r224]
  | 600 -> One [r224]
  | 601 -> One [R 309]
  | 602 -> One [R 525]
  | 603 -> One [R 524]
  | 604 -> One [S (T T_EQUALGREATER); r225]
  | 605 -> One [r225]
  | 606 -> One [R 518]
  | 607 -> One [R 892]
  | 608 -> One [r45; R 517]
  | 609 -> One [R 517]
  | 610 -> One [R 522]
  | 611 -> One [R 764]
  | 613 -> One [R 612]
  | 614 -> One [r227]
  | 615 -> One [r226]
  | 616 -> One [R 747]
  | 617 -> One [r5; r229]
  | 618 -> One [r229]
  | 619 -> One [r81; R 688]
  | 620 -> One [R 900]
  | 621 -> One [S (T T_LIDENT); R 1035; R 905]
  | 622 -> One [R 905]
  | 623 -> One [S (T T_INT); R 778]
  | 624 -> One [R 778]
  | 625 -> One [R 779]
  | 626 -> One [S (T T_INT); R 776]
  | 627 -> One [R 776]
  | 628 -> One [R 777]
  | 630 -> One [R 594]
  | 631 -> One [S (T T_UIDENT); r230]
  | 632 -> One [r230]
  | 633 -> One [R 907]
  | 634 -> One [r232]
  | 635 -> One [R 626]
  | 636 -> One [r231]
  | 637 -> One [R 675]
  | 638 -> One [R 661]
  | 639 -> One [R 596]
  | 640 -> One [R 418; r233]
  | 641 -> One [r234]
  | 643 -> One [r235]
  | 644 -> One [R 911]
  | 645 -> One [r236]
  | 646 -> One [R 618]
  | 647 -> One [r81; R 449]
  | 648 -> One [r238; r239]
  | 649 -> One [r237]
  | 650 -> One [R 7]
  | 651 -> One [R 8]
  | 652 -> One [R 617; R 9]
  | 653 -> One [R 9]
  | 654 -> One [R 10]
  | 655 -> One [R 356]
  | 656 -> One [r81; R 355]
  | 657 -> One [r79; R 683]
  | 658 -> One [r93]
  | 659 -> One [r80; R 682]
  | 660 -> One [r240]
  | 661 -> One [R 904]
  | 662 -> One [r240]
  | 663 -> One [R 904]
  | 664 -> One [R 899]
  | 665 -> One [R 908]
  | 666 -> One [R 894]
  | 667 -> One [R 893]
  | 668 -> One [R 679]
  | 669 -> One [R 901]
  | 670 -> One [S (T T_PLUS); S (T T_FLOAT); R 779; R 902]
  | 671 -> One [R 902]
  | 672 -> One [R 775]
  | 674 -> One [r242]
  | 675 -> One [S (T T_RPAREN); R 918]
  | 676 -> One [R 918]
  | 677 -> One [R 676]
  | 678 -> One [R 668]
  | 679 -> One [r80; R 680]
  | 680 -> One [R 680]
  | 681 -> One [R 909]
  | 682 -> One [R 903]
  | 683 -> One [r243; R 450; r245]
  | 684 -> One [S (T T_UIDENT); r246]
  | 685 -> One [r246]
  | 686 -> One [R 450]
  | 687 -> One [R 673]
  | 688 -> One [r18; R 674]
  | 689 -> One [R 674]
  | 690 -> One [r81; R 669]
  | 691 -> One [R 669]
  | 692 -> One [r80; R 684]
  | 693 -> One [R 684]
  | 694 -> One [r245]
  | 695 -> One [R 618]
  | 696 -> One [R 451]
  | 697 -> One [r244]
  | 698 -> One [R 672]
  | 699 -> One [R 418; r247]
  | 700 -> One [R 617; R 419]
  | 701 -> One [R 419]
  | 702 -> One [r247]
  | 703 -> One [R 898]
  | 704 -> One [r248; r249]
  | 705 -> One [r249]
  | 706 -> One [R 897]
  | 707 -> One [r238; r250]
  | 708 -> One [r250]
  | 709 -> One [R 896]
  | 710 -> One [R 671]
  | 711 -> One [R 678]
  | 712 -> One [R 147]
  | 713 -> One [R 895]
  | 714 -> One [r143; R 677]
  | 715 -> One [R 677]
  | 716 -> One [S (T T_RPAREN); R 916]
  | 717 -> One [R 916]
  | 718 -> One [R 418; r251]
  | 719 -> One [r251]
  | 720 -> One [R 915]
  | 721 -> One [r241]
  | 722 -> One [R 917]
  | 723 -> One [S (T T_RBRACKET); R 914]
  | 724 -> One [R 914]
  | 725 -> One [r238; r252]
  | 726 -> One [r252]
  | 727 -> One [R 913]
  | 728 -> One [R 903]
  | 729 -> One [R 682]
  | 730 -> One [R 617; r253]
  | 731 -> One [r253]
  | 732 -> One [R 906]
  | 733 -> One [R 683]
  | 734 -> One [R 355]
  | 735 -> One [r143; R 357]
  | 736 -> One [R 357]
  | 737 -> One [r239]
  | 738 -> One [R 910]
  | 739 -> One [R 449]
  | 740 -> One [R 670]
  | 741 -> One [R 448]
  | 742 -> One [r233]
  | 743 -> One [R 912]
  | 744 -> One [S (T T_RPAREN); r258]
  | 745 -> One [r258]
  | 746 -> One [r257]
  | 747 -> One [r256]
  | 748 -> One [r255]
  | 749 -> One [r254]
  | 750 -> One [R 681]
  | 751 -> One [R 688]
  | 752 -> One [S (N N_expr); R 689]
  | 753 -> One [R 657; r265]
  | 754 -> One [r265]
  | 755 -> One [r263]
  | 756 -> One [S (T T_LIDENT); R 351]
  | 757 -> One [R 351]
  | 758 -> One [S (T T_LIDENT); r266]
  | 759 -> One [r266]
  | 760 -> One [r243; R 352]
  | 761 -> One [R 352]
  | 762 -> One [R 353]
  | 763 -> One [R 347]
  | 764 -> One [S (N N_expr); R 348]
  | 765 -> One [R 349]
  | 766 -> One [R 657; r275]
  | 767 -> One [r275]
  | 768 -> One [r274]
  | 769 -> One [r273]
  | 770 -> One [r272]
  | 771 -> One [r276; r278]
  | 772 -> One [R 226]
  | 773 -> One [S (T T_RPAREN); R 222]
  | 774 -> One [R 222]
  | 775 -> One [S (T T_RPAREN); R 224]
  | 776 -> One [R 224]
  | 777 -> One [R 350]
  | 778 -> One [R 617; r279]
  | 779 -> One [R 618]
  | 780 -> One [R 433]
  | 781 -> One [r279]
  | 782 -> One [R 225]
  | 783 -> One [R 432]
  | 784 -> One [R 617; r280]
  | 785 -> One [r280]
  | 786 -> One [R 223]
  | 787 -> One [R 227]
  | 788 -> One [r278]
  | 789 -> One [r277]
  | 790 -> One [S (N N_expr); R 265]
  | 791 -> One [S (N N_simple_expr_call); R 271]
  | 792 -> One [R 271]
  | 793 -> One [S (N N_simple_expr_call); R 807]
  | 794 -> One [R 807]
  | 795 -> One [r282]
  | 796 -> One [S (N N_expr); R 263]
  | 797 -> One [R 228]
  | 798 -> One [S (T T_LIDENT); R 805]
  | 799 -> One [R 805]
  | 800 -> One [r282]
  | 802 -> One [r284]
  | 803 -> One [r93]
  | 804 -> One [r117; r287]
  | 805 -> One [R 182]
  | 806 -> One [R 181]
  | 807 -> One [R 500]
  | 808 -> One [r287]
  | 809 -> One [R 617; R 488; r288]
  | 810 -> One [R 488]
  | 811 -> One [R 492]
  | 812 -> One [r45; R 493]
  | 813 -> One [R 493]
  | 814 -> One [R 486]
  | 815 -> One [R 505]
  | 816 -> One [R 436]
  | 817 -> One [r288]
  | 818 -> One [R 487]
  | 819 -> One [R 499]
  | 820 -> One [R 617; R 489]
  | 821 -> One [R 618]
  | 822 -> One [R 437]
  | 823 -> One [R 503]
  | 824 -> One [S (T T_LPAREN); r289; r292]
  | 825 -> One [r289]
  | 826 -> One [S (T T_COLON); r293]
  | 827 -> One [r293]
  | 828 -> One [R 511]
  | 829 -> One [R 302]
  | 830 -> One [r47]
  | 831 -> One [R 510]
  | 832 -> One [S (T T_TYPE); r296]
  | 833 -> One [r296]
  | 834 -> One [r295]
  | 835 -> One [r294]
  | 836 -> One [R 516]
  | 837 -> One [r117; R 506]
  | 838 -> One [R 506]
  | 839 -> One [R 513]
  | 840 -> One [r48]
  | 841 -> One [R 889]
  | 842 -> One [S (T T_RPAREN); R 304]
  | 843 -> One [R 304]
  | 844 -> One [R 438]
  | 845 -> One [R 617; r297]
  | 846 -> One [R 618]
  | 847 -> One [R 439]
  | 848 -> One [r297]
  | 849 -> One [R 305]
  | 850 -> One [S (T T_RPAREN); R 303]
  | 851 -> One [R 303]
  | 852 -> One [r292]
  | 853 -> One [r44; R 648]
  | 854 -> One [r49]
  | 855 -> One [r48]
  | 856 -> One [R 889]
  | 857 -> One [R 648]
  | 858 -> One [r291]
  | 859 -> One [r290]
  | 860 -> One [R 504]
  | 861 -> One [R 489]
  | 862 -> One [r286]
  | 863 -> One [r285]
  | 864 -> One [R 809]
  | 865 -> One [R 597]
  | 866 -> One [R 596]
  | 867 -> One [R 599]
  | 868 -> One [R 587]
  | 869 -> One [R 782]
  | 870 -> One [R 810]
  | 871 -> One [R 265]
  | 872 -> One [R 786]
  | 873 -> One [R 781]
  | 874 -> One [r298]
  | 875 -> One [R 274]
  | 876 -> One [S (N N_expr); R 264]
  | 877 -> One [R 264]
  | 878 -> One [r299]
  | 879 -> One [R 618]
  | 880 -> One [R 429]
  | 881 -> One [R 277]
  | 882 -> One [S (N N_expr); R 250]
  | 883 -> One [R 250]
  | 884 -> One [S (N N_expr); R 245]
  | 885 -> One [R 245]
  | 886 -> One [S (N N_expr); R 244]
  | 887 -> One [R 244]
  | 888 -> One [S (N N_expr); r301]
  | 889 -> One [r301]
  | 890 -> One [S (N N_expr); R 258]
  | 891 -> One [R 258]
  | 892 -> One [S (N N_expr); R 259]
  | 893 -> One [R 259]
  | 894 -> One [S (N N_expr); R 243]
  | 895 -> One [R 243]
  | 896 -> One [S (N N_expr); R 247]
  | 897 -> One [R 247]
  | 898 -> One [S (N N_expr); R 246]
  | 899 -> One [R 246]
  | 900 -> One [S (N N_expr); R 253]
  | 901 -> One [R 253]
  | 902 -> One [S (N N_expr); R 249]
  | 903 -> One [R 249]
  | 904 -> One [S (N N_expr); R 248]
  | 905 -> One [R 248]
  | 906 -> One [S (N N_expr); R 260]
  | 907 -> One [R 260]
  | 908 -> One [S (N N_expr); R 242]
  | 909 -> One [R 242]
  | 910 -> One [S (N N_expr); R 241]
  | 911 -> One [R 241]
  | 912 -> One [S (N N_expr); R 251]
  | 913 -> One [R 251]
  | 914 -> One [S (N N_expr); R 240]
  | 915 -> One [R 240]
  | 916 -> One [S (N N_expr); R 262]
  | 917 -> One [R 262]
  | 918 -> One [S (N N_expr); R 252]
  | 919 -> One [S (N N_expr); R 261]
  | 920 -> One [R 261]
  | 921 -> One [R 252]
  | 922 -> One [S (N N_expr); R 254]
  | 923 -> One [R 254]
  | 924 -> One [S (N N_expr); R 255]
  | 925 -> One [R 255]
  | 926 -> One [S (N N_expr); R 256]
  | 927 -> One [R 256]
  | 928 -> One [S (N N_expr); R 257]
  | 929 -> One [R 257]
  | 930 -> One [r300]
  | 931 -> One [R 273]
  | 932 -> One [R 278]
  | 933 -> One [R 276]
  | 934 -> One [R 428]
  | 935 -> One [S (T T_RPAREN); R 790]
  | 936 -> One [R 790]
  | 937 -> One [r111; r302]
  | 938 -> One [R 319; R 327]
  | 939 -> One [R 327]
  | 940 -> One [r302]
  | 941 -> One [R 799]
  | 942 -> One [S (T T_SLASHGREATER); R 330]
  | 943 -> One [R 330]
  | 944 -> One [R 392; r303]
  | 945 -> One [r303]
  | 946 -> One [R 331]
  | 947 -> One [S (N N_simple_expr_no_call); r304]
  | 948 -> One [r304]
  | 949 -> One [S (T T_LIDENT); R 847]
  | 950 -> One [R 847]
  | 951 -> One [R 831]
  | 952 -> One [S (N N_simple_expr_no_call); R 850]
  | 953 -> One [R 850]
  | 954 -> One [R 332]
  | 955 -> One [r306]
  | 956 -> One [r305]
  | 957 -> One [R 835]
  | 958 -> One [S (T T_LBRACKET); r308]
  | 959 -> One [r308]
  | 960 -> One [r307]
  | 961 -> One [R 836]
  | 962 -> One [r309; r311]
  | 963 -> One [r311]
  | 964 -> One [R 618]
  | 965 -> One [R 427]
  | 966 -> One [r310]
  | 967 -> One [R 837]
  | 968 -> One [R 426]
  | 969 -> One [R 833]
  | 970 -> One [r312; r313]
  | 971 -> One [r313]
  | 972 -> One [R 798]
  | 973 -> One [S (T T_RBRACKET); R 800]
  | 974 -> One [R 800]
  | 975 -> One [S (T T_RBRACKET); R 801]
  | 976 -> One [R 801]
  | 977 -> One [r314; r316]
  | 978 -> One [r316]
  | 979 -> One [R 618]
  | 980 -> One [R 431]
  | 981 -> One [r315]
  | 982 -> One [R 804]
  | 983 -> One [R 430]
  | 984 -> One [r283]
  | 985 -> One [r319]
  | 986 -> One [R 976]
  | 987 -> One [r318]
  | 988 -> One [r317]
  | 989 -> One [R 618]
  | 990 -> One [R 715]
  | 991 -> One [R 792]
  | 992 -> One [r114; r324]
  | 993 -> One [r324]
  | 994 -> One [R 621; r325; r326]
  | 995 -> One [r325]
  | 996 -> One [R 445]
  | 997 -> One [S (N N_expr); R 444]
  | 998 -> One [R 444]
  | 999 -> One [r326]
  | 1000 -> One [R 618]
  | 1001 -> One [r217; R 447]
  | 1002 -> One [R 447]
  | 1003 -> One [S (N N_expr); R 446]
  | 1004 -> One [R 446]
  | 1005 -> One [R 701]
  | 1006 -> One [r323]
  | 1007 -> One [r327]
  | 1008 -> One [S (N N_expr); R 642]
  | 1009 -> One [R 642]
  | 1010 -> One [R 975]
  | 1011 -> One [R 714]
  | 1012 -> One [R 456]
  | 1013 -> One [r322]
  | 1014 -> One [r321]
  | 1015 -> One [S (N N_expr); r329]
  | 1016 -> One [r329]
  | 1017 -> One [r328]
  | 1018 -> One [R 702]
  | 1019 -> One [R 618]
  | 1020 -> One [r217; R 400]
  | 1021 -> One [R 400]
  | 1022 -> One [S (N N_expr); R 399]
  | 1023 -> One [R 399]
  | 1024 -> One [R 699]
  | 1025 -> One [r320]
  | 1026 -> One [R 703]
  | 1027 -> One [R 700]
  | 1028 -> One [r330]
  | 1029 -> One [R 618]
  | 1030 -> One [R 457]
  | 1031 -> One [R 978]
  | 1032 -> One [S (T T_STRING); r327; R 456; r330; R 716]
  | 1033 -> One [R 716]
  | 1034 -> One [S (T T_RBRACE); R 797]
  | 1035 -> One [R 797]
  | 1036 -> One [S (T T_RBRACE); R 796]
  | 1037 -> One [R 796]
  | 1038 -> One [S (T T_COLON); r332]
  | 1039 -> One [R 621; r335]
  | 1040 -> One [r335]
  | 1041 -> One [r334]
  | 1042 -> One [S (N N_expr); r337]
  | 1043 -> One [r337]
  | 1044 -> One [r336]
  | 1045 -> One [R 712]
  | 1046 -> One [R 708]
  | 1047 -> One [r333]
  | 1048 -> One [R 713]
  | 1049 -> One [R 709]
  | 1050 -> One [r332]
  | 1051 -> One [r331]
  | 1052 -> One [R 705]
  | 1053 -> One [R 618]
  | 1054 -> One [r217; r339]
  | 1055 -> One [r339]
  | 1056 -> One [S (N N_expr); r341]
  | 1057 -> One [r341]
  | 1058 -> One [r340]
  | 1059 -> One [R 710]
  | 1060 -> One [R 706]
  | 1061 -> One [r338]
  | 1062 -> One [R 711]
  | 1063 -> One [R 707]
  | 1064 -> One [R 704]
  | 1065 -> One [R 1112]
  | 1066 -> One [r281]
  | 1067 -> One [R 793]
  | 1068 -> One [S (N N_expr); R 267]
  | 1069 -> One [R 267]
  | 1070 -> One [r344]
  | 1071 -> One [r343]
  | 1072 -> One [r342]
  | 1073 -> One [R 794]
  | 1074 -> One [S (N N_expr); R 268]
  | 1075 -> One [R 268]
  | 1076 -> One [r347]
  | 1077 -> One [r346]
  | 1078 -> One [r345]
  | 1079 -> One [R 795]
  | 1080 -> One [S (N N_expr); R 269]
  | 1081 -> One [R 269]
  | 1082 -> One [R 791]
  | 1083 -> One [S (N N_expr); R 266]
  | 1084 -> One [R 266]
  | 1085 -> One [R 335]
  | 1086 -> One [R 811]
  | 1087 -> One [R 263]
  | 1088 -> One [r281]
  | 1089 -> One [R 793]
  | 1090 -> One [r344]
  | 1091 -> One [r343]
  | 1092 -> One [r342]
  | 1093 -> One [R 794]
  | 1094 -> One [r347]
  | 1095 -> One [r346]
  | 1096 -> One [r345]
  | 1097 -> One [R 795]
  | 1098 -> One [R 791]
  | 1099 -> One [R 230]
  | 1100 -> One [r70; r349]
  | 1101 -> One [r349]
  | 1102 -> One [r348]
  | 1103 -> One [R 231]
  | 1104 -> One [r70; R 532]
  | 1105 -> One [r271]
  | 1106 -> One [R 179]
  | 1107 -> One [R 180]
  | 1108 -> One [r270]
  | 1109 -> One [r269]
  | 1110 -> One [r268]
  | 1111 -> One [R 238]
  | 1112 -> One [R 658]
  | 1113 -> One [R 348]
  | 1114 -> One [r262]
  | 1115 -> One [r70; R 644]
  | 1116 -> One [R 644]
  | 1117 -> One [r261]
  | 1118 -> One [r259]
  | 1119 -> One [R 197]
  | 1120 -> One [R 298]
  | 1121 -> One [R 198]
  | 1122 -> One [S (T T_RPAREN); r351]
  | 1123 -> One [r351]
  | 1124 -> One [r350]
  | 1125 -> One [R 300]
  | 1126 -> One [R 617; r354]
  | 1127 -> One [r354]
  | 1128 -> One [r353]
  | 1129 -> One [r352]
  | 1130 -> One [R 301]
  | 1131 -> One [R 617; r357]
  | 1132 -> One [r357]
  | 1133 -> One [r356]
  | 1134 -> One [r355]
  | 1135 -> One [R 299]
  | 1136 -> One [r81; r360]
  | 1137 -> One [r360]
  | 1138 -> One [S (N N_expr); R 652]
  | 1139 -> One [R 652]
  | 1140 -> One [r359]
  | 1141 -> One [r358]
  | 1142 -> One [R 472]
  | 1143 -> One [R 394; R 232]
  | 1144 -> One [R 232]
  | 1145 -> One [R 395]
  | 1146 -> One [R 229]
  | 1147 -> One [R 689]
  | 1149 -> One [r362]
  | 1150 -> One [R 628]
  | 1151 -> One [r361]
  | 1152 -> One [R 1000]
  | 1153 -> One [R 1002]
  | 1155 -> One [r368]
  | 1156 -> One [r367]
  | 1157 -> One [r366]
  | 1158 -> One [r365]
  | 1159 -> One [r364]
  | 1160 -> One [r363]
  | 1161 -> One [R 1072]
  | 1162 -> One [S (T T_RPAREN); R 788]
  | 1163 -> One [R 788]
  | 1165 -> One [r369]
  | 1166 -> One [R 1103]
  | 1167 -> One [r370]
  | 1168 -> One [r375]
  | 1169 -> One [R 697]
  | 1170 -> One [r374]
  | 1171 -> One [R 894]
  | 1172 -> One [r18; r377]
  | 1173 -> One [r377]
  | 1174 -> One [r376]
  | 1175 -> One [R 365]
  | 1176 -> One [R 893]
  | 1177 -> One [S (T T_RPAREN); r381]
  | 1178 -> One [r381]
  | 1179 -> One [r380]
  | 1180 -> One [r378]
  | 1181 -> One [R 195]
  | 1182 -> One [R 294]
  | 1183 -> One [R 196]
  | 1184 -> One [S (T T_RPAREN); r383]
  | 1185 -> One [r383]
  | 1186 -> One [r382]
  | 1187 -> One [R 296]
  | 1188 -> One [R 617; r386]
  | 1189 -> One [r386]
  | 1190 -> One [r385]
  | 1191 -> One [r384]
  | 1192 -> One [R 297]
  | 1193 -> One [R 617; r389]
  | 1194 -> One [r389]
  | 1195 -> One [r388]
  | 1196 -> One [r387]
  | 1197 -> One [R 295]
  | 1198 -> One [r146]
  | 1199 -> One [r390; r394]
  | 1200 -> One [R 538]
  | 1201 -> One [R 539]
  | 1202 -> One [r394]
  | 1203 -> One [r393]
  | 1204 -> One [r392]
  | 1205 -> One [r391]
  | 1206 -> One [R 363]
  | 1207 -> One [S (T T_DOT); r397]
  | 1208 -> One [r397]
  | 1209 -> One [r396]
  | 1210 -> One [r395]
  | 1211 -> One [R 362]
  | 1212 -> One [r145]
  | 1213 -> One [r18; R 650]
  | 1214 -> One [R 650]
  | 1215 -> One [R 1022]
  | 1216 -> One [S (T T_EQUAL); r398]
  | 1217 -> One [r398]
  | 1218 -> One [R 360]
  | 1219 -> One [R 361]
  | 1220 -> One [r372]
  | 1221 -> One [r371]
  | 1222 -> One [R 364]
  | 1223 -> One [R 358]
  | 1224 -> One [R 634]
  | 1225 -> One [S (N N_simple_expr_call); R 1105]
  | 1226 -> One [R 1105]
  | 1227 -> One [r117; R 1008]
  | 1228 -> One [R 1008]
  | 1229 -> One [R 657; r400]
  | 1230 -> One [r400]
  | 1231 -> One [r399]
  | 1232 -> One [R 1068]
  | 1233 -> One [S (N N_expr); R 1069]
  | 1234 -> One [R 1069]
  | 1235 -> One [R 662]
  | 1236 -> One [R 657; r401]
  | 1237 -> One [r401]
  | 1238 -> One [R 394; R 1065]
  | 1239 -> One [R 1065]
  | 1240 -> One [R 1062]
  | 1241 -> One [R 657; r409]
  | 1242 -> One [r409]
  | 1243 -> One [r408]
  | 1244 -> One [r407]
  | 1245 -> One [r406]
  | 1246 -> One [r405]
  | 1247 -> One [r404]
  | 1248 -> One [r403]
  | 1249 -> One [r402]
  | 1250 -> One [R 1071]
  | 1251 -> One [r143; r412]
  | 1252 -> One [r412]
  | 1253 -> One [r411]
  | 1254 -> One [r410]
  | 1255 -> One [R 991]
  | 1256 -> One [r413; R 989]
  | 1257 -> One [R 540]
  | 1258 -> One [R 541]
  | 1259 -> One [R 989]
  | 1260 -> One [R 693]
  | 1261 -> One [r416; R 969]
  | 1262 -> One [r152]
  | 1263 -> One [r414; R 286]
  | 1264 -> One [r417]
  | 1265 -> One [R 286]
  | 1266 -> One [r147]
  | 1267 -> One [r415]
  | 1268 -> One [R 291]
  | 1269 -> One [r190]
  | 1270 -> One [r189]
  | 1271 -> One [r414; R 288]
  | 1272 -> One [R 288]
  | 1273 -> One [r192]
  | 1274 -> One [r191]
  | 1275 -> One [r414; R 287]
  | 1276 -> One [R 287]
  | 1277 -> One [r193]
  | 1278 -> One [r414; R 290]
  | 1279 -> One [R 290]
  | 1280 -> One [r194]
  | 1281 -> One [r414; R 289]
  | 1282 -> One [R 289]
  | 1283 -> One [R 188]
  | 1284 -> One [R 187]
  | 1285 -> One [R 969]
  | 1286 -> One [r276; r419]
  | 1287 -> One [r419]
  | 1288 -> One [r418]
  | 1289 -> One [R 1063]
  | 1290 -> One [r70; r421]
  | 1291 -> One [r421]
  | 1292 -> One [r420]
  | 1293 -> One [R 1064]
  | 1294 -> One [R 744; R 686]
  | 1295 -> One [r45; R 767]
  | 1296 -> One [R 767]
  | 1297 -> One [r143; r424]
  | 1298 -> One [r424]
  | 1299 -> One [r423]
  | 1300 -> One [r422]
  | 1301 -> One [R 751]
  | 1302 -> One [r413; R 749]
  | 1303 -> One [R 749]
  | 1304 -> One [r148; R 738]
  | 1305 -> One [R 738]
  | 1306 -> One [S (T T_TYPE); r434]
  | 1307 -> One [R 1121]
  | 1308 -> One [r434]
  | 1309 -> One [r431]
  | 1310 -> One [r430]
  | 1311 -> One [R 1056; r436; R 460; r438]
  | 1312 -> One [R 1057]
  | 1313 -> One [R 1058]
  | 1314 -> One [r436]
  | 1315 -> One [r435]
  | 1316 -> One [R 1052]
  | 1317 -> One [R 1050]
  | 1318 -> One [R 460]
  | 1319 -> One [r438]
  | 1320 -> One [R 618]
  | 1321 -> One [R 461]
  | 1322 -> One [r437]
  | 1323 -> One [R 403]
  | 1324 -> One [r429]
  | 1325 -> One [r428]
  | 1326 -> One [r442; R 120]
  | 1327 -> One [R 526; R 529]
  | 1328 -> One [R 529]
  | 1329 -> One [R 1120; R 530]
  | 1330 -> One [R 530]
  | 1331 -> One [R 120]
  | 1332 -> One [r441]
  | 1333 -> One [r440]
  | 1334 -> One [r439]
  | 1335 -> One [R 1119]
  | 1336 -> One [R 630]
  | 1337 -> One [R 1120; r445]
  | 1338 -> One [r445]
  | 1339 -> One [r444]
  | 1340 -> One [r443]
  | 1341 -> One [R 124]
  | 1342 -> One [R 1120; r448]
  | 1343 -> One [r448]
  | 1344 -> One [r447]
  | 1345 -> One [r446]
  | 1346 -> One [R 122]
  | 1347 -> One [r450; R 118]
  | 1348 -> One [R 141]
  | 1349 -> One [S (T T_DOT); r451]
  | 1350 -> One [r451]
  | 1351 -> One [R 142]
  | 1352 -> One [R 108]
  | 1353 -> One [r449]
  | 1354 -> One [r153; r452; r453]
  | 1355 -> One [r452]
  | 1356 -> One [R 135]
  | 1357 -> One [r453]
  | 1358 -> One [R 411]
  | 1359 -> One [R 105]
  | 1360 -> One [R 107]
  | 1361 -> One [R 118]
  | 1362 -> One [r450; R 106]
  | 1363 -> One [R 106]
  | 1364 -> One [r426; r454]
  | 1365 -> One [r457; R 126]
  | 1366 -> One [r456]
  | 1367 -> One [r455]
  | 1368 -> One [R 153]
  | 1369 -> One [R 126]
  | 1370 -> One [r18; R 112]
  | 1371 -> One [R 112]
  | 1372 -> One [R 116]
  | 1373 -> One [R 130]
  | 1374 -> One [r442; R 121]
  | 1375 -> One [R 121]
  | 1376 -> One [R 1120; r460]
  | 1377 -> One [r460]
  | 1378 -> One [r459]
  | 1379 -> One [r458]
  | 1380 -> One [R 125]
  | 1381 -> One [R 1120; r463]
  | 1382 -> One [r463]
  | 1383 -> One [r462]
  | 1384 -> One [r461]
  | 1385 -> One [R 123]
  | 1386 -> One [r450; R 119]
  | 1387 -> One [R 119]
  | 1388 -> One [r457; R 127]
  | 1389 -> One [R 127]
  | 1390 -> One [R 129]
  | 1391 -> One [R 629; R 117]
  | 1392 -> One [R 630]
  | 1393 -> One [R 128]
  | 1394 -> One [R 471]
  | 1395 -> One [R 117]
  | 1396 -> One [R 470]
  | 1397 -> One [R 115]
  | 1398 -> One [r454]
  | 1399 -> One [R 137]
  | 1400 -> One [R 113]
  | 1401 -> One [r425; R 114]
  | 1402 -> One [R 114]
  | 1403 -> One [r427]
  | 1404 -> One [R 136]
  | 1405 -> One [r450; R 193]
  | 1406 -> One [R 193]
  | 1407 -> One [R 138]
  | 1408 -> One [R 194]
  | 1409 -> One [r433]
  | 1410 -> One [r432; R 17]
  | 1411 -> One [R 17]
  | 1412 -> One [S (T T_AND); r464]
  | 1413 -> One [r464]
  | 1414 -> One [R 18]
  | 1415 -> One [R 139]
  | 1416 -> One [R 371; R 372]
  | 1417 -> One [R 372]
  | 1418 -> One [r469]
  | 1419 -> One [r468]
  | 1420 -> One [r467]
  | 1421 -> One [r466]
  | 1422 -> One [R 64]
  | 1423 -> One [R 77]
  | 1424 -> One [S (T T_EQUALGREATER); r470]
  | 1425 -> One [r470]
  | 1426 -> One [R 65]
  | 1427 -> One [R 369; R 78]
  | 1428 -> One [r471; R 15]
  | 1429 -> One [R 15]
  | 1430 -> One [S (T T_AND); r472]
  | 1431 -> One [r472]
  | 1432 -> One [R 16]
  | 1433 -> One [R 78]
  | 1434 -> One [R 369; R 370]
  | 1435 -> One [R 370]
  | 1436 -> One [R 753]
  | 1437 -> One [R 745]
  | 1438 -> One [R 744; R 746]
  | 1439 -> One [R 773]
  | 1440 -> One [R 746]
  | 1441 -> One [R 754]
  | 1442 -> One [R 755]
  | 1443 -> One [S (T T_EQUAL); r473]
  | 1444 -> One [r473]
  | 1445 -> One [R 758]
  | 1446 -> One [R 756]
  | 1447 -> One [r474; R 498]
  | 1448 -> One [r45; R 519]
  | 1449 -> One [R 519]
  | 1450 -> One [R 520]
  | 1451 -> One [R 498]
  | 1452 -> One [R 405]
  | 1453 -> One [r474; r475]
  | 1454 -> One [r475]
  | 1455 -> One [S (T T_UIDENT); r476]
  | 1456 -> One [r476]
  | 1457 -> One [R 21]
  | 1458 -> One [S (T T_AND); r478]
  | 1459 -> One [r478]
  | 1460 -> One [r477]
  | 1461 -> One [R 22]
  | 1462 -> One [R 760]
  | 1463 -> One [R 378; R 379]
  | 1464 -> One [R 379]
  | 1465 -> One [r479]
  | 1466 -> One [R 615]
  | 1467 -> One [S (T T_UIDENT); R 613]
  | 1468 -> One [R 613]
  | 1469 -> One [R 614]
  | 1470 -> One [R 616]
  | 1471 -> One [R 766]
  | 1472 -> One [R 774]
  | 1473 -> One [r481]
  | 1474 -> One [r480]
  | 1475 -> One [r58]
  | 1476 -> One [r57]
  | 1477 -> One [R 220; r482]
  | 1478 -> One [r482]
  | 1479 -> One [R 742]
  | 1480 -> One [R 1034]
  | 1481 -> One [S (T T_DOT); r487]
  | 1482 -> One [r487]
  | 1483 -> One [r486]
  | 1484 -> One [r485]
  | 1485 -> One [r484]
  | 1486 -> One [r483]
  | 1487 -> One [R 743]
  | 1488 -> One [R 659; r488]
  | 1489 -> One [r488]
  | 1490 -> One [R 584]
  | 1491 -> One [S (T T_TYPE); r489]
  | 1492 -> One [r489]
  | 1493 -> One [R 763]
  | 1494 -> One [R 765]
  | 1495 -> One [r370]
  | 1496 -> One [S (T T_COLON); r490]
  | 1497 -> One [r490]
  | 1498 -> One [R 748]
  | 1499 -> One [r45; R 768]
  | 1500 -> One [R 768]
  | 1501 -> One [r143; r493]
  | 1502 -> One [r493]
  | 1503 -> One [r492]
  | 1504 -> One [r491]
  | 1505 -> One [R 752]
  | 1506 -> One [r413; R 750]
  | 1507 -> One [R 750]
  | 1508 -> One [r148; R 739]
  | 1509 -> One [R 739]
  | 1510 -> One [S (T T_TYPE); r495]
  | 1511 -> One [r495]
  | 1512 -> One [r494]
  | 1513 -> One [R 140]
  | 1514 -> One [R 369; R 79]
  | 1515 -> One [R 79]
  | 1516 -> One [S (T T_EQUAL); r496]
  | 1517 -> One [r496]
  | 1518 -> One [R 759]
  | 1519 -> One [R 757]
  | 1520 -> One [r474; r497]
  | 1521 -> One [r497]
  | 1522 -> One [R 761]
  | 1523 -> One [R 772]
  | 1524 -> One [R 771]
  | 1525 -> One [R 770]
  | 1526 -> One [R 769]
  | 1527 -> One [R 686]
  | 1528 -> One [R 774]
  | 1529 -> One [R 687]
  | 1530 -> One [r506; r507]
  | 1531 -> One [r505]
  | 1532 -> One [r504]
  | 1533 -> One [S (T T_RPAREN); r508]
  | 1534 -> One [r508]
  | 1535 -> One [r465; R 638]
  | 1536 -> One [R 638]
  | 1537 -> One [r502]
  | 1538 -> One [r501]
  | 1539 -> One [R 183]
  | 1540 -> One [R 184]
  | 1541 -> One [r509; r510]
  | 1542 -> One [r499; r511]
  | 1543 -> One [R 633; r375]
  | 1544 -> One [S (N N_simple_expr_call); R 100]
  | 1545 -> One [R 100]
  | 1546 -> One [R 659; r513]
  | 1547 -> One [r513]
  | 1548 -> One [r34; r514]
  | 1549 -> One [r514]
  | 1550 -> One [R 421]
  | 1551 -> One [R 87]
  | 1552 -> One [R 88]
  | 1553 -> One [S (T T_LPAREN); r517]
  | 1554 -> One [r517]
  | 1555 -> One [r516]
  | 1556 -> One [r515]
  | 1557 -> One [R 80]
  | 1558 -> One [R 85]
  | 1559 -> One [R 131]
  | 1560 -> One [R 81]
  | 1561 -> One [r509; R 86]
  | 1562 -> One [R 86]
  | 1563 -> One [S (T T_RPAREN); r519]
  | 1564 -> One [r519]
  | 1565 -> One [r518]
  | 1566 -> One [R 83]
  | 1567 -> One [R 617; r522]
  | 1568 -> One [r522]
  | 1569 -> One [r521]
  | 1570 -> One [r520]
  | 1571 -> One [R 84]
  | 1572 -> One [R 617; r525]
  | 1573 -> One [r525]
  | 1574 -> One [r524]
  | 1575 -> One [r523]
  | 1576 -> One [R 82]
  | 1577 -> One [r512]
  | 1578 -> One [S (T T_LIDENT); R 636]
  | 1579 -> One [R 636]
  | 1580 -> One [R 92]
  | 1581 -> One [r457; R 98]
  | 1582 -> One [R 98]
  | 1583 -> One [R 571]
  | 1584 -> One [R 570]
  | 1585 -> One [R 91]
  | 1586 -> One [R 407]
  | 1587 -> One [r14; R 95]
  | 1588 -> One [R 95]
  | 1589 -> One [r13]
  | 1590 -> One [R 527]
  | 1591 -> One [S (T T_LIDENT); r527]
  | 1592 -> One [r527]
  | 1593 -> One [r526]
  | 1594 -> One [R 1113]
  | 1595 -> One [S (T T_EQUAL); r528]
  | 1596 -> One [r528]
  | 1597 -> One [R 1114]
  | 1598 -> One [r12]
  | 1599 -> One [r11]
  | 1600 -> One [r10]
  | 1601 -> One [R 1117]
  | 1602 -> One [S (T T_EQUAL); r529]
  | 1603 -> One [r529]
  | 1604 -> One [R 1118]
  | 1605 -> One [r532]
  | 1606 -> One [r531]
  | 1607 -> One [r530]
  | 1608 -> One [R 359]
  | 1609 -> One [S (N N_simple_expr_call); R 101]
  | 1610 -> One [R 101]
  | 1611 -> One [R 659; r534]
  | 1612 -> One [r534]
  | 1613 -> One [r533]
  | 1614 -> One [R 93]
  | 1615 -> One [r457; R 99]
  | 1616 -> One [R 99]
  | 1617 -> One [R 103]
  | 1618 -> One [r538; R 97]
  | 1619 -> One [r537]
  | 1620 -> One [S (T T_LIDENT); r540]
  | 1621 -> One [r540]
  | 1622 -> One [r539]
  | 1623 -> One [R 474]
  | 1624 -> One [r536]
  | 1625 -> One [r160; R 646]
  | 1626 -> One [r390; r543]
  | 1627 -> One [r543]
  | 1628 -> One [r542]
  | 1629 -> One [r541]
  | 1630 -> One [R 477]
  | 1631 -> One [R 646]
  | 1632 -> One [r535]
  | 1633 -> One [R 476]
  | 1634 -> One [R 475]
  | 1635 -> One [R 97]
  | 1636 -> One [R 629; R 572]
  | 1637 -> One [R 630]
  | 1638 -> One [R 104]
  | 1639 -> One [R 102]
  | 1640 -> One [r538; R 96]
  | 1641 -> One [R 96]
  | 1642 -> One [R 469]
  | 1643 -> One [R 572]
  | 1644 -> One [S (T T_AS); r544; R 568]
  | 1645 -> One [r544]
  | 1646 -> One [R 111]
  | 1647 -> One [R 568]
  | 1648 -> One [r498; R 569]
  | 1649 -> One [R 569]
  | 1650 -> One [R 468]
  | 1651 -> One [S (T T_SEMI); r545]
  | 1652 -> One [r545]
  | 1653 -> One [R 373; R 366]
  | 1654 -> One [r373; r546]
  | 1655 -> One [r546]
  | 1656 -> One [S (T T_AND); r548]
  | 1657 -> One [r548]
  | 1658 -> One [r547]
  | 1659 -> One [R 375]
  | 1660 -> One [R 374]
  | 1661 -> One [R 366]
  | 1662 -> One [R 90]
  | 1663 -> One [R 89]
  | 1664 -> One [R 542]
  | 1665 -> One [r511]
  | 1666 -> One [R 132]
  | 1667 -> One [r510]
  | 1668 -> One [R 134]
  | 1669 -> One [r465; r549]
  | 1670 -> One [r549]
  | 1671 -> One [R 133]
  | 1672 -> One [r500]
  | 1673 -> One [R 192]
  | 1674 -> One [r509; R 191]
  | 1675 -> One [R 191]
  | 1676 -> One [R 66]
  | 1677 -> One [R 68]
  | 1678 -> One [R 1057]
  | 1679 -> One [R 1058]
  | 1680 -> One [S (T T_RPAREN); r550]
  | 1681 -> One [r550]
  | 1682 -> One [R 70]
  | 1683 -> One [R 617; r552]
  | 1684 -> One [r552]
  | 1685 -> One [r551]
  | 1686 -> One [R 71]
  | 1687 -> One [R 617; r554]
  | 1688 -> One [r554]
  | 1689 -> One [r553]
  | 1690 -> One [S (T T_RPAREN); r555]
  | 1691 -> One [r555]
  | 1692 -> One [R 73]
  | 1693 -> One [S (T T_RPAREN); r556]
  | 1694 -> One [r556]
  | 1695 -> One [R 75]
  | 1696 -> One [R 617; r558]
  | 1697 -> One [r558]
  | 1698 -> One [r557]
  | 1699 -> One [R 76]
  | 1700 -> One [R 617; r560]
  | 1701 -> One [r560]
  | 1702 -> One [r559]
  | 1703 -> One [R 74]
  | 1704 -> One [R 72]
  | 1705 -> One [R 617; r562]
  | 1706 -> One [r562]
  | 1707 -> One [r561]
  | 1708 -> One [R 69]
  | 1709 -> One [R 67]
  | 1710 -> One [r507]
  | 1711 -> One [r506; R 13]
  | 1712 -> One [R 13]
  | 1713 -> One [S (T T_AND); r563]
  | 1714 -> One [r563]
  | 1715 -> One [R 14]
  | 1716 -> One [R 1005]
  | 1717 -> One [R 367; R 368]
  | 1718 -> One [R 368]
  | 1719 -> One [S (N N_expr); R 1098]
  | 1720 -> One [R 1098]
  | 1721 -> One [S (N N_simple_expr_call); R 1104]
  | 1722 -> One [R 1104]
  | 1723 -> One [R 899]
  | 1724 -> One [R 985]
  | 1725 -> One [S (N N_expr); R 1083]
  | 1726 -> One [R 1083]
  | 1727 -> One [S (N N_expr); R 1077]
  | 1728 -> One [R 1077]
  | 1729 -> One [S (N N_expr); r565]
  | 1730 -> One [r565]
  | 1731 -> One [r564]
  | 1732 -> One [R 1106]
  | 1733 -> One [S (N N_expr); R 1091]
  | 1734 -> One [R 1091]
  | 1735 -> One [S (N N_expr); R 1080]
  | 1736 -> One [R 1080]
  | 1737 -> One [S (N N_expr); R 1079]
  | 1738 -> One [R 1079]
  | 1739 -> One [S (N N_expr); R 1092]
  | 1740 -> One [R 1092]
  | 1741 -> One [S (N N_expr); R 1086]
  | 1742 -> One [R 1086]
  | 1743 -> One [S (N N_expr); R 1082]
  | 1744 -> One [R 1082]
  | 1745 -> One [S (N N_expr); R 1081]
  | 1746 -> One [R 1081]
  | 1747 -> One [S (N N_expr); R 1093]
  | 1748 -> One [R 1093]
  | 1749 -> One [S (N N_expr); R 1084]
  | 1750 -> One [R 1084]
  | 1751 -> One [S (N N_expr); R 1078]
  | 1752 -> One [R 1078]
  | 1753 -> One [S (N N_expr); R 1076]
  | 1754 -> One [R 1076]
  | 1755 -> One [S (N N_expr); R 1075]
  | 1756 -> One [R 1075]
  | 1757 -> One [S (N N_expr); R 1074]
  | 1758 -> One [R 1074]
  | 1759 -> One [S (N N_expr); R 1073]
  | 1760 -> One [R 1073]
  | 1761 -> One [S (N N_expr); R 1095]
  | 1762 -> One [R 1095]
  | 1763 -> One [S (N N_expr); R 1085]
  | 1764 -> One [S (N N_expr); R 1094]
  | 1765 -> One [R 1094]
  | 1766 -> One [R 1085]
  | 1767 -> One [S (N N_expr); R 1090]
  | 1768 -> One [R 1090]
  | 1769 -> One [S (N N_expr); R 1087]
  | 1770 -> One [R 1087]
  | 1771 -> One [S (N N_expr); R 1088]
  | 1772 -> One [R 1088]
  | 1773 -> One [S (N N_expr); R 1089]
  | 1774 -> One [R 1089]
  | 1775 -> One [R 993]
  | 1776 -> One [S (N N_expr); R 1096]
  | 1777 -> One [R 1096]
  | 1778 -> One [R 983]
  | 1779 -> One [R 982; R 984]
  | 1780 -> One [R 984]
  | 1781 -> One [R 994]
  | 1782 -> One [R 995]
  | 1783 -> One [R 1061]
  | 1787 -> One [r566]
  | 1788 -> One [R 1100]
  | 1793 -> One [r567]
  | 1794 -> One [R 1101]
  | 1799 -> One [r568]
  | 1800 -> One [R 1102]
  | 1802 -> One [r569]
  | 1803 -> One [R 1099]
  | 1804 -> One [r573; R 996]
  | 1805 -> One [R 996]
  | 1806 -> One [r572]
  | 1807 -> One [r570]
  | 1808 -> One [R 507]
  | 1809 -> One [r45; r574]
  | 1810 -> One [r574]
  | 1811 -> One [R 508]
  | 1812 -> One [R 491]
  | 1813 -> One [R 490]
  | 1814 -> One [r573; r575]
  | 1815 -> One [r575]
  | 1816 -> One [S (T T_UIDENT); r576]
  | 1817 -> One [r576]
  | 1818 -> One [R 19]
  | 1819 -> One [S (T T_AND); r578]
  | 1820 -> One [r578]
  | 1821 -> One [r577]
  | 1822 -> One [R 20]
  | 1823 -> One [R 998]
  | 1824 -> One [R 376; R 377]
  | 1825 -> One [R 377]
  | 1826 -> One [R 1004]
  | 1827 -> One [R 1013]
  | 1828 -> One [r481]
  | 1829 -> One [r480]
  | 1830 -> One [r58]
  | 1831 -> One [r57]
  | 1832 -> One [R 220; r581]
  | 1833 -> One [r581]
  | 1834 -> One [r416; R 544]
  | 1835 -> One [r416; R 545]
  | 1836 -> One [R 545]
  | 1837 -> One [R 549]
  | 1838 -> One [S (T T_BAR); r582]
  | 1839 -> One [r582]
  | 1840 -> One [r416; R 547]
  | 1841 -> One [R 547]
  | 1842 -> One [R 551]
  | 1843 -> One [R 546]
  | 1844 -> One [R 550]
  | 1845 -> One [R 544]
  | 1846 -> One [R 548]
  | 1847 -> One [R 38]
  | 1848 -> One [r579]
  | 1849 -> One [r416; r583]
  | 1850 -> One [r416; r584]
  | 1851 -> One [r584]
  | 1852 -> One [S (T T_BAR); r586]
  | 1853 -> One [r586]
  | 1854 -> One [r416; r587]
  | 1855 -> One [r587]
  | 1856 -> One [R 384]
  | 1857 -> One [r585]
  | 1858 -> One [R 383]
  | 1859 -> One [R 382]
  | 1860 -> One [r583]
  | 1861 -> One [R 381]
  | 1862 -> One [R 37]
  | 1863 -> One [R 973]
  | 1864 -> One [S (T T_DOT); r592]
  | 1865 -> One [r592]
  | 1866 -> One [r591]
  | 1867 -> One [r590]
  | 1868 -> One [r589]
  | 1869 -> One [r588]
  | 1870 -> One [R 974]
  | 1871 -> One [S (T T_TYPE); r594]
  | 1872 -> One [r594]
  | 1873 -> One [r593]
  | 1874 -> One [R 1001]
  | 1875 -> One [R 1003]
  | 1877 -> One [r117; R 1009]
  | 1878 -> One [R 1009]
  | 1879 -> One [r143; r597]
  | 1880 -> One [r597]
  | 1881 -> One [r596]
  | 1882 -> One [r595]
  | 1883 -> One [R 992]
  | 1884 -> One [r413; R 990]
  | 1885 -> One [R 990]
  | 1886 -> One [r416; R 970]
  | 1887 -> One [R 970]
  | 1888 -> One [r506; r598]
  | 1889 -> One [r598]
  | 1890 -> One [R 1006]
  | 1891 -> One [R 986]
  | 1892 -> One [r573; R 997]
  | 1893 -> One [R 997]
  | 1894 -> One [r573; r599]
  | 1895 -> One [r599]
  | 1896 -> One [R 999]
  | 1897 -> One [r600; R 988]
  | 1898 -> One [R 988]
  | 1899 -> One [R 1012]
  | 1900 -> One [r600; R 987]
  | 1901 -> One [R 987]
  | 1902 -> One [R 1010]
  | 1903 -> One [R 1007]
  | 1904 -> One [S (N N_expr); R 1097]
  | 1905 -> One [R 1097]
  | 1906 -> One [R 1011]
  | 1907 -> One [R 685]
  | 1908 -> One [S (T T_EQUALGREATER); r601]
  | 1909 -> One [r601]
  | 1910 -> One [R 690]
  | 1911 -> One [r228]
  | 1912 -> One [R 313]
  | 1913 -> One [r41]
  | 1914 -> One [R 523]
  | 1915 -> One [R 1024]
  | 1916 -> One [R 654]
  | 1917 -> One [R 401]
  | 1918 -> One [S (T T_DOT); r602]
  | 1920 -> One [S (T T_RPAREN); R 189]
  | 1921 -> One [R 189]
  | 1922 -> One [R 1109]
  | 1923 -> One [R 655; r603]
  | 1924 -> One [r603]
  | 1925 -> One [R 343]
  | 1926 -> One [R 346]
  | 1927 -> One [R 342]
  | 1928 -> One [R 345]
  | 1929 -> One [r144]
  | 1930 -> One [R 341]
  | 1931 -> One [R 190]
  | 1932 -> One [R 340]
  | 1933 -> One [R 466]
  | 1934 -> One [R 339]
  | 1935 -> One [r141]
  | 1936 -> One [R 336]
  | 1937 -> One [R 617; r604]
  | 1938 -> One [R 618]
  | 1939 -> One [r142; R 467]
  | 1940 -> One [R 467]
  | 1941 -> One [r604]
  | 1942 -> One [R 337]
  | 1943 -> One [r306]
  | 1944 -> One [R 393]
  | 1945 -> One [r140]
  | 1946 -> One [R 317]
  | 1947 -> One [S (N N_simple_expr_no_call); r605]
  | 1948 -> One [r605]
  | 1949 -> One [R 318]
  | 1950 -> One [S (N N_simple_expr_call); R 881]
  | 1951 -> One [R 881]
  | 1952 -> One [S (T T_LIDENT); R 879]
  | 1953 -> One [R 879]
  | 1954 -> One [R 863]
  | 1955 -> One [S (N N_simple_expr_no_call); R 882]
  | 1956 -> One [R 882]
  | 1957 -> One [S (N N_expr); r606]
  | 1958 -> One [r606]
  | 1959 -> One [R 867]
  | 1960 -> One [r135]
  | 1961 -> One [r85]
  | 1962 -> One [r84]
  | 1963 -> One [r83]
  | 1964 -> One [r82]
  | 1965 -> One [R 611]
  | 1966 -> One [R 624]
  | 1967 -> One [S (T T_SEMI); r607]
  | 1968 -> One [r607]
  | 1969 -> One [R 727]
  | 1970 -> One [R 735]
  | 1971 -> One [S (T T_OPEN); r611]
  | 1972 -> One [r611]
  | 1973 -> One [r610]
  | 1974 -> One [r609]
  | 1975 -> One [r608]
  | 1976 -> One [R 733]
  | 1977 -> One [r573; r613]
  | 1978 -> One [r613]
  | 1979 -> One [r612]
  | 1980 -> One [R 732]
  | 1981 -> One [r479]
  | 1982 -> One [R 623; r618]
  | 1983 -> One [R 624]
  | 1984 -> One [r618]
  | 1985 -> One [r617]
  | 1986 -> One [r616]
  | 1987 -> One [r615]
  | 1988 -> One [r614]
  | 1989 -> One [R 734]
  | 1990 -> One [R 629; R 737]
  | 1991 -> One [R 630]
  | 1992 -> One [R 736]
  | 1993 -> One [S (N N_seq_expr_no_seq); R 728]
  | 1994 -> One [R 728]
  | 1995 -> One [r619]
  | 1996 -> One [R 630]
  | 1997 -> One [R 730]
  | 1998 -> One [r619]
  | 1999 -> One [R 630]
  | 2000 -> One [R 729]
  | 2002 -> One [R 731]
  | 2003 -> One [R 737]
  | 2004 -> One [R 473]
  | 2005 -> One [r134]
  | 2006 -> One [r133]
  | 2007 -> One [R 1066]
  | 2008 -> One [R 397]
  | 2009 -> One [S (T T_LBRACKET); r621]
  | 2010 -> One [r621]
  | 2011 -> One [r620]
  | 2012 -> One [R 868]
  | 2013 -> One [r309; r623]
  | 2014 -> One [r623]
  | 2015 -> One [r622]
  | 2016 -> One [R 869]
  | 2017 -> One [R 865]
  | 2018 -> One [R 857]
  | 2019 -> One [S (T T_DOT); r625]
  | 2020 -> One [r625]
  | 2021 -> One [r93]
  | 2022 -> One [r117; r628]
  | 2023 -> One [r628]
  | 2024 -> One [r627]
  | 2025 -> One [r626]
  | 2026 -> One [R 883]
  | 2027 -> One [S (T T_RPAREN); R 864]
  | 2028 -> One [R 864]
  | 2029 -> One [r111; r629]
  | 2030 -> One [r629]
  | 2031 -> One [R 873]
  | 2032 -> One [r312; r630]
  | 2033 -> One [r630]
  | 2034 -> One [R 872]
  | 2035 -> One [S (T T_RBRACKET); R 874]
  | 2036 -> One [R 874]
  | 2037 -> One [S (T T_RBRACKET); R 875]
  | 2038 -> One [R 875]
  | 2039 -> One [r314; r632]
  | 2040 -> One [r632]
  | 2041 -> One [r631]
  | 2042 -> One [R 878]
  | 2043 -> One [r624]
  | 2044 -> One [R 866]
  | 2045 -> One [S (T T_RBRACE); R 871]
  | 2046 -> One [R 871]
  | 2047 -> One [S (T T_RBRACE); R 870]
  | 2048 -> One [R 870]
  | 2049 -> One [R 856]
  | 2050 -> One [R 884]
  | 2051 -> One [R 860]
  | 2052 -> One [R 855]
  | 2053 -> One [r132]
  | 2054 -> One [R 509]
  | 2055 -> One [r131]
  | 2056 -> One [r130]
  | 2057 -> One [r129]
  | 2058 -> One [R 851]
  | 2059 -> One [S (T T_RPAREN); R 832]
  | 2060 -> One [R 832]
  | 2061 -> One [r111; r633]
  | 2062 -> One [r633]
  | 2063 -> One [R 841]
  | 2064 -> One [r312; r634]
  | 2065 -> One [r634]
  | 2066 -> One [R 840]
  | 2067 -> One [S (T T_RBRACKET); R 842]
  | 2068 -> One [R 842]
  | 2069 -> One [S (T T_RBRACKET); R 843]
  | 2070 -> One [R 843]
  | 2071 -> One [r314; r636]
  | 2072 -> One [r636]
  | 2073 -> One [r635]
  | 2074 -> One [R 846]
  | 2075 -> One [r127]
  | 2076 -> One [R 834]
  | 2077 -> One [S (T T_RBRACE); R 839]
  | 2078 -> One [R 839]
  | 2079 -> One [S (T T_RBRACE); R 838]
  | 2080 -> One [R 838]
  | 2081 -> One [S (N N_expr); R 236]
  | 2082 -> One [R 236]
  | 2083 -> One [R 617; r637]
  | 2084 -> One [r637]
  | 2085 -> One [R 536]
  | 2086 -> One [R 272]
  | 2087 -> One [R 292]
  | 2088 -> One [R 819]
  | 2089 -> One [R 617; r638]
  | 2090 -> One [r638]
  | 2091 -> One [R 818]
  | 2092 -> One [R 443]
  | 2093 -> One [r121]
  | 2094 -> One [R 785]
  | 2095 -> One [R 270]
  | 2096 -> One [R 494]
  | 2097 -> One [R 625; r639]
  | 2098 -> One [r639]
  | 2099 -> One [R 497]
  | 2100 -> One [R 625; r640]
  | 2101 -> One [r640]
  | 2102 -> One [R 495]
  | 2103 -> One [R 625; r641]
  | 2104 -> One [r641]
  | 2105 -> One [R 496]
  | 2106 -> One [R 502]
  | 2107 -> One [S (T T_RPAREN); R 501]
  | 2108 -> One [R 501]
  | 2109 -> One [r118]
  | 2110 -> One [R 820]
  | 2111 -> One [r46; r642]
  | 2112 -> One [r642]
  | 2113 -> One [R 821]
  | 2114 -> One [S (T T_RPAREN); r647]
  | 2115 -> One [r647]
  | 2116 -> One [r646]
  | 2117 -> One [r645]
  | 2118 -> One [r644]
  | 2119 -> One [r643]
  | 2120 -> One [R 239]
  | 2121 -> One [R 442]
  | 2122 -> One [r113]
  | 2123 -> One [R 826]
  | 2124 -> One [R 617; r648]
  | 2125 -> One [r648]
  | 2126 -> One [R 827]
  | 2127 -> One [r109]
  | 2128 -> One [R 329]
  | 2129 -> One [r112]
  | 2130 -> One [R 816]
  | 2131 -> One [S (T T_RBRACKET); R 817]
  | 2132 -> One [R 817]
  | 2133 -> One [S (T T_RBRACKET); R 815]
  | 2134 -> One [R 815]
  | 2135 -> One [R 802]
  | 2136 -> One [S (T T_RPAREN); R 830]
  | 2137 -> One [R 830]
  | 2138 -> One [R 844]
  | 2139 -> One [r107]
  | 2140 -> One [R 315]
  | 2141 -> One [r105]
  | 2142 -> One [r104]
  | 2143 -> One [r103]
  | 2144 -> One [r102]
  | 2145 -> One [R 233]
  | 2146 -> One [r101]
  | 2147 -> One [R 320]
  | 2148 -> One [r100]
  | 2149 -> One [R 322]
  | 2150 -> One [R 323]
  | 2151 -> One [R 321]
  | 2152 -> One [R 325]
  | 2153 -> One [r97]
  | 2154 -> One [r96]
  | 2155 -> One [r95]
  | 2156 -> One [r94]
  | 2157 -> One [R 234]
  | 2158 -> One [S (T T_RPAREN); R 862]
  | 2159 -> One [R 862]
  | 2160 -> One [R 876]
  | 2161 -> One [r90]
  | 2162 -> One [r89]
  | 2163 -> One [r88]
  | 2164 -> One [r87]
  | 2165 -> One [R 1067]
  | 2166 -> One [r77]
  | 2167 -> One [R 35]
  | 2168 -> One [R 417]
  | 2169 -> One [r76]
  | 2170 -> One [R 53]
  | 2171 -> One [r75]
  | 2172 -> One [S (T T_BACKQUOTE); r649; R 415]
  | 2173 -> One [r649]
  | 2174 -> One [R 560]
  | 2175 -> One [R 561]
  | 2176 -> One [R 415]
  | 2177 -> One [r74]
  | 2178 -> One [R 54]
  | 2179 -> One [R 434]
  | 2180 -> One [R 159]
  | 2181 -> One [r650]
  | 2182 -> One [R 164]
  | 2183 -> One [r18; R 1039]
  | 2184 -> One [r652]
  | 2185 -> One [r651]
  | 2186 -> One [R 161]
  | 2187 -> One [R 452]
  | 2188 -> One [r37]
  | 2189 -> One [R 618]
  | 2190 -> One [R 453]
  | 2191 -> One [r36]
  | 2192 -> One [R 1051]
  | 2193 -> One [r654]
  | 2194 -> One [r653]
  | 2195 -> One [R 160]
  | 2196 -> One [r68; R 163]
  | 2197 -> One [R 163]
  | 2198 -> One [r68; R 162]
  | 2199 -> One [R 162]
  | 2200 -> One [r655; R 41]
  | 2201 -> One [r69]
  | 2202 -> One [r652]
  | 2203 -> One [r654]
  | 2204 -> One [r657]
  | 2205 -> One [r658]
  | 2206 -> One [R 165]
  | 2207 -> One [r68; R 170]
  | 2208 -> One [R 170]
  | 2209 -> One [r660]
  | 2210 -> One [r659]
  | 2211 -> One [R 167]
  | 2212 -> One [r662]
  | 2213 -> One [r661]
  | 2214 -> One [R 166]
  | 2215 -> One [r68; R 169]
  | 2216 -> One [R 169]
  | 2217 -> One [r656]
  | 2218 -> One [R 168]
  | 2219 -> One [R 41]
  | 2220 -> One [R 1042]
  | 2221 -> One [r172]
  | 2222 -> One [r658]
  | 2223 -> One [r660]
  | 2224 -> One [r662]
  | 2225 -> One [r663]
  | 2226 -> One [R 42]
  | 2227 -> One [R 1043]
  | 2228 -> One [r665]
  | 2229 -> One [R 23; R 174]
  | 2230 -> One [R 174]
  | 2231 -> One [S (T T_BAR); r663]
  | 2232 -> One [R 171]
  | 2233 -> One [r664; R 172]
  | 2234 -> One [R 172]
  | 2235 -> One [R 173]
  | 2236 -> One [R 1039]
  | 2237 -> One [R 1028]
  | 2238 -> One [R 185]
  | 2239 -> One [R 186]
  | 2240 -> One [R 1044]
  | 2241 -> One [R 1040]
  | 2242 -> One [r172]
  | 2243 -> One [R 1041]
  | 2244 -> One [R 1038]
  | 2245 -> One [S (T T_DOTDOT); R 1045]
  | 2246 -> One [r655; R 185; r665; R 1030]
  | 2247 -> One [r666]
  | 2248 -> One [R 1048]
  | 2249 -> One [r657]
  | 2250 -> One [R 1049]
  | 2251 -> One [R 1030]
  | 2252 -> One [R 1045]
  | 2253 -> One [R 1046]
  | 2254 -> One [r657]
  | 2255 -> One [R 1047]
  | 2256 -> One [R 1029]
  | 2257 -> One [R 1027]
  | 2258 -> One [R 1025]
  | 2259 -> One [r58]
  | 2260 -> One [r57]
  | 2261 -> One [R 220; r667]
  | 2262 -> One [r667]
  | 2263 -> One [R 971]
  | 2264 -> One [S (T T_DOT); r672]
  | 2265 -> One [r672]
  | 2266 -> One [r671]
  | 2267 -> One [r670]
  | 2268 -> One [r669]
  | 2269 -> One [r668]
  | 2270 -> One [R 972]
  | 2271 -> One [r52]
  | 2272 -> One [R 279]
  | 2273 -> One [R 512]
  | 2274 -> One [R 694]
  | 2275 -> One [R 46]
  | 2276 -> One [r31]
  | 2277 -> One [R 1023]
  | 2278 -> One [r19]
  | 2279 -> One [R 1115]
  | 2280 -> One [S (T T_EQUAL); r673]
  | 2281 -> One [r673]
  | 2282 -> One [R 1116]
  | 2283 -> One [R 94]
  | 2284 -> One [r319]
  | 2285 -> One [R 333]
  | 2286 -> One [r114; r675]
  | 2287 -> One [r675]
  | 2288 -> One [S (T T_RBRACE); R 60]
  | 2289 -> One [R 60]
  | 2290 -> One [R 618]
  | 2291 -> One [r674]
  | 2292 -> One [R 59]
  | 2293 -> One [r9]
  | 2294 -> One [R 58]
  | 2295 -> One [S (T T_RBRACE); R 62]
  | 2296 -> One [R 62]
  | 2297 -> One [S (T T_RBRACE); R 61]
  | 2298 -> One [R 61]
  | 2299 -> One [S (T T_RBRACE); R 63]
  | 2300 -> One [R 63]
  | 2301 -> One [R 407]
  | 2302 -> One [r676]
  | 2303 -> One [r284]
  | 2304 -> One [R 334]
  | 2305 -> One [r6]
  | 2306 -> One [R 237]
  | 2307 -> One [r0]
  | 2308 -> One [R 663]
  | 2309 -> One [S (T T_RPAREN); R 664]
  | 2310 -> One [R 664]
  | 2311 -> One [r3]
  | 2312 -> One [R 1070]
  | 2313 -> One [S (T T_EOF); R 311]
  | 2314 -> One [R 311]
  | 2315 -> One [R 0]
  | 2317 -> One [S (T T_EOF); R 312]
  | 2318 -> One [R 312]
  | 2319 -> One [R 1]
  | 2321 -> One [R 2]
  | 2322 -> One [S (T T_EOF); R 665]
  | 2323 -> One [R 665]
  | 2325 -> One [R 3]
  | 2326 -> One [S (T T_EOF); R 666]
  | 2327 -> One [R 666]
  | 2329 -> One [S (T T_EOF); R 667]
  | 2330 -> One [R 667]
  | 2331 -> One [R 4]
  | 2333 -> One [r39; r677]
  | 2334 -> One [r677]
  | 2335 -> One [R 219]
  | 2336 -> One [R 214]
  | 2337 -> One [R 215]
  | 2338 -> One [R 218]
  | 2339 -> One [R 216]
  | 2340 -> One [R 217]
  | 2341 -> One [R 1020]
  | 2342 -> One [R 199]
  | 2343 -> One [R 5]
  | 2344 -> One [S (T T_SEMI); R 201]
  | 2345 -> One [R 201]
  | 2346 -> One [S (T T_SEMI); R 200]
  | 2347 -> One [R 200]
  | 2348 -> One [R 1021]
  | 2350 -> One [R 202]
  | 2351 -> One [R 1107]
  | 2352 -> One [R 6]
  | 2353 -> One [S (T T_EOF); R 206]
  | 2354 -> One [r678; R 204]
  | 2355 -> One [R 204]
  | 2356 -> One [S (T T_EOF); R 205]
  | 2357 -> One [r678; R 203]
  | 2358 -> One [R 203]
  | 2359 -> One [R 1108]
  | 2360 -> One [R 205]
  | 2361 -> One [R 206]
  | 135 -> Select (function
    | 133 | 2183 -> [r25]
    | _ -> [r156])
  | 189 -> Select (function
    | -1 -> [r417]
    | _ -> [r93])
  | 199 -> Select (function
    | -1 -> [R 1109]
    | _ -> [S (T T_EQUAL); r119])
  | 207 -> Select (function
    | -1 -> [r126]
    | _ -> [R 621; r115; r122; r123])
  | 332 -> Select (function
    | 1198 -> [r40]
    | _ -> [r162])
  | 333 -> Select (function
    | 1198 -> [R 47]
    | _ -> [R 564])
  | 359 -> Select (function
    | 135 -> [r26]
    | _ -> [r173])
  | 458 -> Select (function
    | 135 | 325 -> [r666]
    | _ -> [r158])
  | 566 -> Select (function
    | -1 -> [R 611]
    | _ -> [S (T T_TYPE); r212])
  | 612 -> Select (function
    | -1 -> [r370]
    | _ -> [r143; r227])
  | 629 -> Select (function
    | -1 -> [r417]
    | _ -> [r93])
  | 642 -> Select (function
    | -1 -> [r126]
    | _ -> [r248; r235])
  | 673 -> Select (function
    | -1 -> [R 147]
    | _ -> [S (T T_DOT); r242])
  | 801 -> Select (function
    | -1 -> [R 147]
    | _ -> [r676])
  | 1148 -> Select (function
    | -1 -> [R 611]
    | _ -> [S (T T_TYPE); r362])
  | 1154 -> Select (function
    | 107 | 140 | 618 -> [r93]
    | -1 -> [r417]
    | _ -> [S (T T_COLONCOLON); r368])
  | 1164 -> Select (function
    | -1 | 107 | 140 | 618 -> [R 1109]
    | _ -> [S (T T_EQUAL); r369])
  | 1784 -> Select (function
    | -1 -> [r282]
    | _ -> [S (N N_expr); r680])
  | 1785 -> Select (function
    | -1 -> [r281]
    | _ -> [r680])
  | 1786 -> Select (function
    | -1 -> [R 793]
    | _ -> [r679])
  | 1789 -> Select (function
    | -1 -> [r344]
    | _ -> [S (T T_LBRACKET); r683])
  | 1790 -> Select (function
    | -1 -> [r343]
    | _ -> [r683])
  | 1791 -> Select (function
    | -1 -> [r342]
    | _ -> [r682])
  | 1792 -> Select (function
    | -1 -> [R 794]
    | _ -> [r681])
  | 1795 -> Select (function
    | -1 -> [r347]
    | _ -> [r309; r686])
  | 1796 -> Select (function
    | -1 -> [r346]
    | _ -> [r686])
  | 1797 -> Select (function
    | -1 -> [r345]
    | _ -> [r685])
  | 1798 -> Select (function
    | -1 -> [R 795]
    | _ -> [r684])
  | 1801 -> Select (function
    | -1 -> [R 791]
    | _ -> [S (T T_EQUAL); r569])
  | 1876 -> Select (function
    | -1 -> [r532]
    | _ -> [r370])
  | 1919 -> Select (function
    | 2334 -> [r211]
    | _ -> [r602])
  | 2001 -> Select (function
    | 1993 -> [r298]
    | _ -> [R 542])
  | _ -> raise Not_found
let token_of_terminal (type a) (t : a MenhirInterpreter.terminal) (v : a) : token =
  match t with
  | MenhirInterpreter.T_error -> assert false
  | MenhirInterpreter.T_WITH -> WITH
  | MenhirInterpreter.T_WHILE -> WHILE
  | MenhirInterpreter.T_WHEN -> WHEN
  | MenhirInterpreter.T_VIRTUAL -> VIRTUAL
  | MenhirInterpreter.T_VAL -> VAL
  | MenhirInterpreter.T_UNDERSCORE -> UNDERSCORE
  | MenhirInterpreter.T_UIDENT -> UIDENT v
  | MenhirInterpreter.T_TYPE -> TYPE
  | MenhirInterpreter.T_TRY -> TRY
  | MenhirInterpreter.T_TRUE -> TRUE
  | MenhirInterpreter.T_TO -> TO
  | MenhirInterpreter.T_TILDE -> TILDE
  | MenhirInterpreter.T_THEN -> THEN
  | MenhirInterpreter.T_SWITCH -> SWITCH
  | MenhirInterpreter.T_STRUCT -> STRUCT
  | MenhirInterpreter.T_STRING -> STRING v
  | MenhirInterpreter.T_STAR -> STAR
  | MenhirInterpreter.T_SLASHGREATER -> SLASHGREATER
  | MenhirInterpreter.T_SIG -> SIG
  | MenhirInterpreter.T_SHARPOP -> SHARPOP v
  | MenhirInterpreter.T_SHARPEQUAL -> SHARPEQUAL
  | MenhirInterpreter.T_SHARP -> SHARP
  | MenhirInterpreter.T_SEMISEMI -> SEMISEMI
  | MenhirInterpreter.T_SEMI -> SEMI
  | MenhirInterpreter.T_RPAREN -> RPAREN
  | MenhirInterpreter.T_REC -> REC
  | MenhirInterpreter.T_RBRACKET -> RBRACKET
  | MenhirInterpreter.T_RBRACE -> RBRACE
  | MenhirInterpreter.T_QUOTE -> QUOTE
  | MenhirInterpreter.T_QUESTION -> QUESTION
  | MenhirInterpreter.T_PUB -> PUB
  | MenhirInterpreter.T_PRI -> PRI
  | MenhirInterpreter.T_PREFIXOP -> PREFIXOP v
  | MenhirInterpreter.T_POSTFIXOP -> POSTFIXOP v
  | MenhirInterpreter.T_PLUSEQ -> PLUSEQ
  | MenhirInterpreter.T_PLUSDOT -> PLUSDOT
  | MenhirInterpreter.T_PLUS -> PLUS
  | MenhirInterpreter.T_PERCENT -> PERCENT
  | MenhirInterpreter.T_OR -> OR
  | MenhirInterpreter.T_OPEN -> OPEN
  | MenhirInterpreter.T_OF -> OF
  | MenhirInterpreter.T_OBJECT -> OBJECT
  | MenhirInterpreter.T_NONREC -> NONREC
  | MenhirInterpreter.T_NEW -> NEW
  | MenhirInterpreter.T_NATIVEINT -> NATIVEINT v
  | MenhirInterpreter.T_MUTABLE -> MUTABLE
  | MenhirInterpreter.T_MODULE -> MODULE
  | MenhirInterpreter.T_MINUSGREATER -> MINUSGREATER
  | MenhirInterpreter.T_MINUSDOT -> MINUSDOT
  | MenhirInterpreter.T_MINUS -> MINUS
  | MenhirInterpreter.T_LPAREN -> LPAREN
  | MenhirInterpreter.T_LIDENT -> LIDENT v
  | MenhirInterpreter.T_LET -> LET
  | MenhirInterpreter.T_LESSSLASHIDENTGREATER -> LESSSLASHIDENTGREATER v
  | MenhirInterpreter.T_LESSSLASHGREATER -> LESSSLASHGREATER
  | MenhirInterpreter.T_LESSIDENT -> LESSIDENT v
  | MenhirInterpreter.T_LESSGREATER -> LESSGREATER
  | MenhirInterpreter.T_LESSDOTDOTGREATER -> LESSDOTDOTGREATER
  | MenhirInterpreter.T_LESS -> LESS
  | MenhirInterpreter.T_LBRACKETPERCENTPERCENT -> LBRACKETPERCENTPERCENT
  | MenhirInterpreter.T_LBRACKETPERCENT -> LBRACKETPERCENT
  | MenhirInterpreter.T_LBRACKETLESS -> LBRACKETLESS
  | MenhirInterpreter.T_LBRACKETGREATER -> LBRACKETGREATER
  | MenhirInterpreter.T_LBRACKETBAR -> LBRACKETBAR
  | MenhirInterpreter.T_LBRACKETAT -> LBRACKETAT
  | MenhirInterpreter.T_LBRACKET -> LBRACKET
  | MenhirInterpreter.T_LBRACELESS -> LBRACELESS
  | MenhirInterpreter.T_LBRACE -> LBRACE
  | MenhirInterpreter.T_LAZY -> LAZY
  | MenhirInterpreter.T_INT -> INT v
  | MenhirInterpreter.T_INITIALIZER -> INITIALIZER
  | MenhirInterpreter.T_INHERIT -> INHERIT
  | MenhirInterpreter.T_INFIXOP4 -> INFIXOP4 v
  | MenhirInterpreter.T_INFIXOP3 -> INFIXOP3 v
  | MenhirInterpreter.T_INFIXOP2 -> INFIXOP2 v
  | MenhirInterpreter.T_INFIXOP1 -> INFIXOP1 v
  | MenhirInterpreter.T_INFIXOP0 -> INFIXOP0 v
  | MenhirInterpreter.T_INCLUDE -> INCLUDE
  | MenhirInterpreter.T_IN -> IN
  | MenhirInterpreter.T_IF -> IF
  | MenhirInterpreter.T_GREATERRBRACE -> GREATERRBRACE
  | MenhirInterpreter.T_GREATERDOTDOTDOT -> GREATERDOTDOTDOT
  | MenhirInterpreter.T_GREATER -> GREATER
  | MenhirInterpreter.T_FUNCTOR -> FUNCTOR
  | MenhirInterpreter.T_FUNCTION -> FUNCTION
  | MenhirInterpreter.T_FUN -> FUN
  | MenhirInterpreter.T_FOR -> FOR
  | MenhirInterpreter.T_FLOAT -> FLOAT v
  | MenhirInterpreter.T_FALSE -> FALSE
  | MenhirInterpreter.T_EXTERNAL -> EXTERNAL
  | MenhirInterpreter.T_EXCEPTION -> EXCEPTION
  | MenhirInterpreter.T_ES6_FUN -> ES6_FUN
  | MenhirInterpreter.T_EQUALGREATER -> EQUALGREATER
  | MenhirInterpreter.T_EQUAL -> EQUAL
  | MenhirInterpreter.T_EOL -> EOL
  | MenhirInterpreter.T_EOF -> EOF
  | MenhirInterpreter.T_END -> END
  | MenhirInterpreter.T_ELSE -> ELSE
  | MenhirInterpreter.T_DOWNTO -> DOWNTO
  | MenhirInterpreter.T_DOTDOTDOT -> DOTDOTDOT
  | MenhirInterpreter.T_DOTDOT -> DOTDOT
  | MenhirInterpreter.T_DOT -> DOT
  | MenhirInterpreter.T_DONE -> DONE
  | MenhirInterpreter.T_DOCSTRING -> DOCSTRING v
  | MenhirInterpreter.T_DO -> DO
  | MenhirInterpreter.T_CONSTRAINT -> CONSTRAINT
  | MenhirInterpreter.T_COMMENT -> COMMENT v
  | MenhirInterpreter.T_COMMA -> COMMA
  | MenhirInterpreter.T_COLONGREATER -> COLONGREATER
  | MenhirInterpreter.T_COLONEQUAL -> COLONEQUAL
  | MenhirInterpreter.T_COLONCOLON -> COLONCOLON
  | MenhirInterpreter.T_COLON -> COLON
  | MenhirInterpreter.T_CLASS -> CLASS
  | MenhirInterpreter.T_CHAR -> CHAR v
  | MenhirInterpreter.T_BEGIN -> BEGIN
  | MenhirInterpreter.T_BARRBRACKET -> BARRBRACKET
  | MenhirInterpreter.T_BARBAR -> BARBAR
  | MenhirInterpreter.T_BAR -> BAR
  | MenhirInterpreter.T_BANG -> BANG
  | MenhirInterpreter.T_BACKQUOTE -> BACKQUOTE
  | MenhirInterpreter.T_ASSERT -> ASSERT
  | MenhirInterpreter.T_AS -> AS
  | MenhirInterpreter.T_AND -> AND
  | MenhirInterpreter.T_AMPERSAND -> AMPERSAND
  | MenhirInterpreter.T_AMPERAMPER -> AMPERAMPER
let nullable (type a) : a MenhirInterpreter.nonterminal -> bool =
  let open MenhirInterpreter in function
  | N_virtual_flag -> true
  | N_type_variance -> true
  | N_type_variables_with_variance -> true
  | N_type_other_kind -> true
  | N_type_declaration_kind -> true
  | N_structure -> true
  | N_signature -> true
  | N_rec_flag -> true
  | N_payload -> true
  | N_override_flag -> true
  | N_optional_expr_extension -> true
  | N_optional -> true
  | N_option_type_constraint_ -> true
  | N_option_preceded_WHEN_expr__ -> true
  | N_option_preceded_COLONGREATER_core_type__ -> true
  | N_option_preceded_COLON_simple_module_type__ -> true
  | N_option_preceded_COLON_poly_type__ -> true
  | N_option_preceded_COLON_non_arrowed_core_type__ -> true
  | N_option_preceded_COLON_expr__ -> true
  | N_option_preceded_COLON_core_type__ -> true
  | N_option_preceded_COLON_class_constructor_type__ -> true
  | N_option_preceded_AS_LIDENT__ -> true
  | N_option_item_extension_sugar_ -> true
  | N_option_constructor_arguments_ -> true
  | N_option_SEMI_ -> true
  | N_option_OF_ -> true
  | N_option_MODULE_ -> true
  | N_option_LET_ -> true
  | N_option_DOTDOTDOT_ -> true
  | N_option_DOT_ -> true
  | N_option_COMMA_ -> true
  | N_object_body_class_fields -> true
  | N_object_body -> true
  | N_nonrec_flag -> true
  | N_mutable_or_virtual_flags -> true
  | N_mutable_flag -> true
  | N_module_arguments_comma_list -> true
  | N_loption_type_parameters_ -> true
  | N_loption_terminated_pattern_comma_list_option_COMMA___ -> true
  | N_loption_row_field_list_ -> true
  | N_loption_preceded_GREATER_nonempty_list_name_tag___ -> true
  | N_loption_parenthesized_type_variables_with_variance_comma_list__ -> true
  | N_loption_parenthesized_class_type_arguments_comma_list__ -> true
  | N_loption_object_label_declarations_ -> true
  | N_loption_located_attributes_ -> true
  | N_loption_functor_parameters_ -> true
  | N_loption_class_type_parameters_ -> true
  | N_llist_aux_preceded_COMMA_opt_spread_lbl_expr___ -> true
  | N_llist_aux_match_case_seq_expr__ -> true
  | N_llist_aux_match_case_expr__ -> true
  | N_list_simple_expr_no_call_ -> true
  | N_list_bar_row_field_ -> true
  | N_list_attributed_ext_constructor_extension_constructor_declaration__ -> true
  | N_list_attributed_ext_constructor_either_extension_constructor_declaration_extension_constructor_rebind___ -> true
  | N_list_and_module_rec_declaration_ -> true
  | N_list_and_module_bindings_ -> true
  | N_list_and_let_binding_ -> true
  | N_list_and_class_type_declaration_ -> true
  | N_list_and_class_description_ -> true
  | N_list_and_class_declaration_ -> true
  | N_labeled_pattern_constraint -> true
  | N_jsx_arguments -> true
  | N_generalized_constructor_arguments -> true
  | N_embedded_private_flag_ -> true
  | N_embedded___anonymous_39_ -> true
  | N_constructor_declarations_aux -> true
  | N_class_sig_body_fields -> true
  | N_class_sig_body -> true
  | N_class_expr_lets_and_rest -> true
  | N_boption_AMPERSAND_ -> true
  | N_and_type_declaration -> true
  | _ -> false

end
module Reason_recover_parser : sig 
#1 "reason_recover_parser.mli"
type 'a parser

val initial :
  (Lexing.position -> 'a Reason_parser.MenhirInterpreter.checkpoint) ->
  Lexing.position -> 'a parser

type 'a step =
  | Intermediate of 'a parser
  | Success of 'a * Reason_lexer.invalid_docstrings
  | Error

val step : 'a parser -> Reason_parser.token Reason_lexer.positioned -> 'a step

end = struct
#1 "reason_recover_parser.ml"
module M = Reason_multi_parser
module R =
  Merlin_recovery.Make(Reason_parser.MenhirInterpreter)
    (struct
      include Reason_parser_recover

      let default_value loc x =
        Default.default_loc := loc;
        default_value x

      let guide _ = false
    end)

type 'a parser =
  | Correct of 'a M.parser
  | Recovering of 'a R.candidates * Reason_lexer.invalid_docstrings

let initial entry_point position =
  Correct (M.initial entry_point position)

type 'a step =
  | Intermediate of 'a parser
  | Success of 'a * Reason_lexer.invalid_docstrings
  | Error

let step parser token =
  match parser with
  | Correct parser ->
    begin match M.step parser token with
      | M.Intermediate parser -> Intermediate (Correct parser)
      | M.Success (x, ds) -> Success (x, ds)
      | M.Error ->
        let (_, loc_start, loc_end) = token in
        let loc = {Location. loc_start; loc_end; loc_ghost = false} in
        let env, ds = M.recovery_env parser in
        let message = Reason_parser_explain.message env token in
        Reason_errors.raise_error
          (Reason_errors.Parsing_error message) loc;
        Intermediate (Recovering (R.generate env, ds))
    end
  | Recovering (candidates, ds) ->
    begin match token with
      | Reason_parser.DOCSTRING text, startp, endp ->
        let ds = Reason_lexer.add_invalid_docstring text startp endp ds in
        Intermediate (Recovering (candidates, ds))
      | _ ->
        begin match R.attempt candidates token with
          | `Ok (cp, _) -> Intermediate (Correct (M.recover cp ds))
          | `Accept x -> Success (x, ds)
          | `Fail ->
            begin match token with
              | Reason_parser.EOF, _, _ ->
                begin match candidates.final with
                  | None -> Error
                  | Some x -> Success (x, ds)
                end
              | _ -> Intermediate parser
            end
        end
    end


end
module Reason_toolchain_reason
= struct
#1 "reason_toolchain_reason.ml"
open Reason_toolchain_conf
open Reason_errors

module P = Reason_recover_parser
module Lexer = Reason_lexer

(* From Reason source text to OCaml AST

   1. Make a lexbuf from source text
   2. Reason_lexer:
      a. Using OCamllex:
         extract one token from stream of characters
      b. post-process token:
         - store comments separately
         - insert ES6_FUN token
         - insert completion identifier
   3. Reason_parser, using Menhir:
      A parser with explicit continuations, which take a new token and return:
      - an AST when parse succeeded
      - a new continuation if more tokens are needed
      - nothing, if the parser got stuck (token is invalid in current state)
   4. Reason_toolchain connect lexer and parser:
*)

type token = Reason_parser.token
type invalid_docstrings = Reason_lexer.invalid_docstrings

let rec loop lexer parser =
  let token = Lexer.token lexer in
  match P.step parser token with
  | P.Intermediate parser' ->
    loop lexer parser'
  | P.Error ->
    (* Impossible to reach this case? *)
    let _, loc_start, loc_end = token in
    let loc = {Location. loc_start; loc_end; loc_ghost = false} in
    raise_fatal_error (Parsing_error "Syntax error") loc
  | P.Success (x, docstrings) ->
    (x, docstrings)

let initial_run entry_point lexer =
  loop lexer
    (P.initial entry_point (Lexer.lexbuf lexer).Lexing.lex_curr_p)

let implementation lexer =
  initial_run Reason_parser.Incremental.implementation lexer

let interface lexer =
  initial_run Reason_parser.Incremental.interface lexer

let core_type lexer =
  initial_run Reason_parser.Incremental.parse_core_type lexer

let toplevel_phrase lexer =
  initial_run Reason_parser.Incremental.toplevel_phrase lexer

let use_file lexer =
  initial_run Reason_parser.Incremental.use_file lexer

(* Skip tokens to the end of the phrase *)
let rec skip_phrase lexer =
  try
    match Lexer.token lexer with
    | (Reason_parser.SEMI | Reason_parser.EOF), _, _ -> ()
    | _ -> skip_phrase lexer
  with Reason_error (Lexing_error ( Unterminated_comment _
                                  | Unterminated_string
                                  | Unterminated_string_in_comment _
                                  | Illegal_character _) , _ ) ->
    skip_phrase lexer

let safeguard_parsing lexbuf fn =
  try fn ()
  with
  | Reason_error _ as err
    when !Location.input_name = "//toplevel//"->
    skip_phrase (Lexer.init lexbuf);
    raise err
  | Location.Error _ as x ->
     let loc = Location.curr lexbuf in
     if !Location.input_name = "//toplevel//"
     then
       let _ = skip_phrase (Lexer.init lexbuf) in
       raise(Syntaxerr.Error(Syntaxerr.Other loc))
     else
       raise x

let format_interface_with_comments (signature, comments) formatter =
  let reason_formatter = Reason_pprint_ast.createFormatter () in
  reason_formatter#signature comments formatter signature
let format_implementation_with_comments (implementation, comments) formatter =
  let reason_formatter = Reason_pprint_ast.createFormatter () in
  reason_formatter#structure comments formatter implementation

end
module Reason_toolchain
= struct
#1 "reason_toolchain.ml"
(***********************************************************************)
(*                                                                     *)
(*                                Reason                               *)
(*                                                                     *)
(***********************************************************************)
(*
 * Copyright (c) 2015-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *)



(* Entry points in the parser *)

(**
 * Provides a simple interface to the most common parsing entrypoints required
 * by editor/IDE toolchains, preprocessors, and pretty printers.
 *
 * The form of this entrypoint includes more than what the standard OCaml
 * toolchain (oprof/ocamldoc) expects, but is still compatible.
 *
 * [implementation_with_comments] and [interface_with_comments] includes
 * additional information (about comments) suitable for building pretty
 * printers, editor, IDE and VCS integration.
 *
 * The comments include the full text of the comment (typically in between the
 * "(*" and the "*)", as well as location information for that comment.
 *
 * WARNING: The "end" location is one greater than the actual final position!
 * (for both [associatedTextLoc] and [commentLoc]).
 *
 * Currently, the location information for comments is of the form:
 *
 *  (associatedTextLoc)
 *
 * But we should quickly change it to be of the form:
 *
 *  (associatedTextLoc, commentLoc)
 *
 * Where the [commentLoc] is the actual original location of the comment,
 * and the [associatedTextLoc] records the location in the file that the
 * comment is attached to. If [associatedTextLoc] and [commentLoc] are the
 * same, then the comment is "free floating" in that it only attaches to itself.
 * The [Reason] pretty printer will try its best to interleave those comments
 * in the containing list etc. But if [associatedTextLoc] expands beyond
 * the [commentLoc] it means the comment and the AST that is captured by
 * the [associatedTextLoc] are related - where "related" is something
 * this [reason_toolchain] decides (but in short it handles "end of line
 * comments"). Various pretty printers can decide how to preserve this
 * relatedness. Ideally, it would preserve end of line comments, but in the
 * short term, it might merely use that relatedness to correctly attach
 * end of line comments to the "top" of the AST node.
 *
 *    let lst = [
 *
 *    ];   (*    Comment    *)
 *         ----commentLoc-----
 *    ---associatedTextLoc----
 *
 *
 * Ideally that would be formatted as:
 *
 *    let lst = [
 *
 *    ];   (*    Comment    *)
 *
 * Or:
 *
 *    let lst = [ ];   (*    Comment    *)
 *
 *
 * But a shorter term solution would use that [associatedTextLoc] to at least
 * correctly attach the comment to the correct node, even if not "end of line".
 *
 *   (*    Comment    *)
 *   let lst = [ ];
 *)

open Reason_toolchain_conf

open Location
open Lexing

module Comment = Reason_comment

let setup_lexbuf use_stdin filename =
  (* Use custom method of lexing from the channel to keep track of the input so that we can
     reformat tokens in the toolchain*)
  let lexbuf =
    match use_stdin with
      | true -> Lexing.from_channel
        stdin
      | false ->
        let file_chan = open_in filename in
        seek_in file_chan 0;
        Lexing.from_channel file_chan
  in
  Location.init lexbuf filename;
  lexbuf


let rec left_expand_comment should_scan_prev_line source loc_start =
  if loc_start = 0 then
    (String.unsafe_get source 0, true, 0)
  else
    let c = String.unsafe_get source (loc_start - 1) in
    match c with
    | '\t' | ' ' -> left_expand_comment should_scan_prev_line source (loc_start - 1)
    | '\n' when should_scan_prev_line -> left_expand_comment should_scan_prev_line source (loc_start - 1)
    | '\n' -> (c, true, loc_start)
    | _ -> (c, false, loc_start)

let rec right_expand_comment should_scan_next_line source loc_start =
  if loc_start = String.length source then
    (String.unsafe_get source (String.length source - 1), true, String.length source)
  else
    let c = String.unsafe_get source loc_start in
    match c with
    | '\t' | ' ' -> right_expand_comment should_scan_next_line source (loc_start + 1)
    | '\n' when should_scan_next_line -> right_expand_comment should_scan_next_line source (loc_start + 1)
    | '\n' -> (c, true, loc_start)
    | _ -> (c, false, loc_start)


module Create_parse_entrypoint (Toolchain_impl: Toolchain_spec) :Toolchain = struct

  let buffer_add_lexbuf buf skip lexbuf =
    let bytes = lexbuf.Lexing.lex_buffer in
    let start = lexbuf.Lexing.lex_start_pos + skip in
    let stop = lexbuf.Lexing.lex_buffer_len in
    Buffer.add_subbytes buf bytes start (stop - start)

  let refill_buff buf refill lb =
    let skip = lb.Lexing.lex_buffer_len - lb.Lexing.lex_start_pos in
    let result = refill lb in
    buffer_add_lexbuf buf skip lb;
    result

  (* replaces Lexing.from_channel so we can keep track of the input for comment modification *)
  let keep_from_lexbuf buffer lexbuf =
    buffer_add_lexbuf buffer 0 lexbuf;
    let refill_buff = refill_buff buffer lexbuf.Lexing.refill_buff in
    {lexbuf with refill_buff}

  let extensions_of_errors errors =
    ignore (Format.flush_str_formatter () : string);
    let error_extension (err, loc) =
      Reason_errors.report_error Format.str_formatter ~loc err;
      let msg = Format.flush_str_formatter () in
      let due_to_recovery = match err with
        | Reason_errors.Parsing_error _ -> true
        | Reason_errors.Lexing_error _ -> false
        | Reason_errors.Ast_error _ -> false
      in
      if due_to_recovery then
        Reason_errors.error_extension_node_from_recovery loc msg
      else
        Reason_errors.error_extension_node loc msg
    in
    List.map error_extension errors

  let wrap_with_comments parsing_fun attach_fun lexbuf =
    let input_copy = Buffer.create 0 in
    let lexbuf = keep_from_lexbuf input_copy lexbuf in
    Toolchain_impl.safeguard_parsing lexbuf (fun () ->
      let lexer =
        let insert_completion_ident =
          !Reason_toolchain_conf.insert_completion_ident in
        Toolchain_impl.Lexer.init ?insert_completion_ident lexbuf
      in
      let ast, invalid_docstrings =
        let result =
          if !Reason_config.recoverable
          then Reason_errors.recover_non_fatal_errors
              (fun () -> parsing_fun lexer)
          else (Ok (parsing_fun lexer), [])
        in
        match result with
        | Ok x, [] -> x
        | Ok (x, ds), errors -> (attach_fun x (extensions_of_errors errors), ds)
        | Error exn, _ -> raise exn
      in
      let unmodified_comments =
        Toolchain_impl.Lexer.get_comments lexer invalid_docstrings
      in
      let contents = Buffer.contents input_copy in
      Buffer.reset input_copy;
      if contents = "" then
        let _  = Parsing.clear_parser() in
        let make_regular (text, location) =
          Comment.make ~location Comment.Regular text in
        (ast, List.map make_regular unmodified_comments)
      else
        let rec classifyAndNormalizeComments unmodified_comments =
          match unmodified_comments with
          | [] -> []
          | hd :: tl -> (
              let classifiedTail = classifyAndNormalizeComments tl in
              let (txt, physical_loc) = hd in
              (* When searching for "^" regexp, returns location of newline + 1 *)
              let (stop_char, eol_start, virtual_start_pos) =
                left_expand_comment false contents physical_loc.loc_start.pos_cnum
              in
              if Reason_syntax_util.isLineComment txt then
                let comment = Comment.make
                  ~location:physical_loc
                  (if eol_start then SingleLine else EndOfLine)
                  txt
                in
                comment :: classifiedTail
              else
              let one_char_before_stop_char =
                if virtual_start_pos <= 1 then
                  ' '
                else
                  String.unsafe_get contents (virtual_start_pos - 2)
              in
              (*
               *
               * The following logic are designed for cases like:
               * | (* comment *)
               *   X => 1
               * we want to extend the comment to the next line so it can be
               * correctly attached to X
               *
               * But we don't want it to extend to next line in this case:
               *
               * true || (* comment *)
               *   false
               *
               *)
              let should_scan_next_line = stop_char = '|' &&
                                          (one_char_before_stop_char = ' ' ||
                                           one_char_before_stop_char = '\n' ||
                                           one_char_before_stop_char = '\t' ) in
              let (_, eol_end, virtual_end_pos) = right_expand_comment should_scan_next_line contents physical_loc.loc_end.pos_cnum in
              let end_pos_plus_one = physical_loc.loc_end.pos_cnum in
              let comment_length = (end_pos_plus_one - physical_loc.loc_start.pos_cnum - 4) in
              let original_comment_contents = String.sub contents (physical_loc.loc_start.pos_cnum + 2) comment_length in
              let location = {
                physical_loc with
                loc_start = {physical_loc.loc_start with pos_cnum = virtual_start_pos};
                loc_end = {physical_loc.loc_end with pos_cnum = virtual_end_pos}
              } in
              let just_after loc' =
                loc'.loc_start.pos_cnum == location.loc_end.pos_cnum - 1 &&
                loc'.loc_start.pos_lnum == location.loc_end.pos_lnum
              in
              let category = match (eol_start, eol_end, classifiedTail) with
                | (true, true, _) -> Comment.SingleLine
                | (false, true, _) -> Comment.EndOfLine
                | (false, false, comment :: _)
                  (* End of line comment is one that has nothing but newlines or
                   * other comments its right, and has some AST to the left of it.
                   * For example, there are two end of line comments in:
                   *
                   *    | Y(int, int); /* eol1 */ /* eol2 */
                   *)
                  when Comment.category comment = Comment.EndOfLine
                    && just_after (Comment.location comment) ->
                  Comment.EndOfLine
                | _ -> Comment.Regular
              in
              let comment =
                Comment.make ~location category original_comment_contents
              in
              comment :: classifiedTail
            )
        in
        let modified_and_comment_with_category = classifyAndNormalizeComments unmodified_comments in
        let _  = Parsing.clear_parser() in
        (ast, modified_and_comment_with_category)
    )

  let default_error lexbuf err =
    if !Reason_config.recoverable then
      let loc, msg = match err with
        | Location.Error err ->
          Reason_syntax_util.split_compiler_error err
        | Reason_errors.Reason_error (e, loc) ->
          Reason_errors.report_error Format.str_formatter ~loc e;
          (loc, Format.flush_str_formatter ())
        | exn ->
          (Location.curr lexbuf, "default_error: " ^ Printexc.to_string exn)
      in
      (loc, Reason_errors.error_extension_node loc msg)
    else
      raise err

  let ignore_attach_errors x _extensions =
    (* FIXME: attach errors in AST *) x

  (*
   * The canonical interface/implementations (with comments) are used with
   * recovering mode for IDE integration. The parser itself likely
   * implements its own recovery, but we need to recover in the event
   * that the file couldn't even lex.
   * Note, the location reported here is broken for some lexing errors
   * (nested comments or unbalanced strings in comments) but at least we don't
   * crash the process. TODO: Report more accurate location in those cases.
   *)
  let implementation_with_comments lexbuf =
    let attach impl extensions =
      (impl @ List.map Ast_helper.Str.extension extensions)
    in
    try wrap_with_comments Toolchain_impl.implementation attach lexbuf
    with err ->
      let loc, error = default_error lexbuf err in
      ([Ast_helper.Str.mk ~loc (Parsetree.Pstr_extension (error, []))], [])

  let core_type_with_comments lexbuf =
    try wrap_with_comments Toolchain_impl.core_type ignore_attach_errors lexbuf
    with err ->
      let loc, error = default_error lexbuf err in
      (Ast_helper.Typ.mk ~loc (Parsetree.Ptyp_extension error), [])

  let interface_with_comments lexbuf =
    let attach impl extensions =
      (impl @ List.map Ast_helper.Sig.extension extensions)
    in
    try wrap_with_comments Toolchain_impl.interface attach lexbuf
    with err ->
      let loc, error = default_error lexbuf err in
      ([Ast_helper.Sig.mk ~loc (Parsetree.Psig_extension (error, []))], [])

  let toplevel_phrase_with_comments lexbuf =
    wrap_with_comments
      Toolchain_impl.toplevel_phrase ignore_attach_errors lexbuf

  let use_file_with_comments lexbuf =
    wrap_with_comments Toolchain_impl.use_file ignore_attach_errors lexbuf

  (** [ast_only] wraps a function to return only the ast component
   *)
  let ast_only f =
    (fun lexbuf -> lexbuf |> f |> fst)

  let implementation = ast_only implementation_with_comments

  let core_type = ast_only core_type_with_comments

  let interface = ast_only interface_with_comments

  let toplevel_phrase = ast_only toplevel_phrase_with_comments

  let use_file = ast_only use_file_with_comments

  (* Printing *)
  let print_interface_with_comments formatter interface =
    Toolchain_impl.format_interface_with_comments interface formatter

  let print_implementation_with_comments formatter implementation =
    Toolchain_impl.format_implementation_with_comments implementation formatter
end

module ML = Create_parse_entrypoint (Reason_toolchain_ocaml)
module RE = Create_parse_entrypoint (Reason_toolchain_reason)
module From_current = From_current
module To_current = To_current

end
module Reason_implementation_printer : sig 
#1 "reason_implementation_printer.mli"
include Printer_maker.PRINTER

end = struct
#1 "reason_implementation_printer.ml"
open Migrate_parsetree
open Ast_404

type t = Parsetree.structure
let err = Printer_maker.err

(* Note: filename should only be used with .ml files. See reason_toolchain. *)
let defaultImplementationParserFor use_stdin filename =
  let open Reason_toolchain in
  let (theParser, parsedAsML) =
    if Filename.check_suffix filename ".re"
    then (RE.implementation_with_comments, false)
    else if Filename.check_suffix filename ".ml"
    then (ML.implementation_with_comments, true)
    else err ("Cannot determine default implementation parser for filename '" ^ filename ^ "'.")
  in
  theParser (setup_lexbuf use_stdin filename), parsedAsML, false

let parse ~use_stdin filetype filename =
  let ((ast, comments), parsedAsML, parsedAsInterface) =
  (match filetype with
  | `Auto -> defaultImplementationParserFor use_stdin filename
  | `BinaryReason -> Printer_maker.reasonBinaryParser use_stdin filename
  | `Binary -> Printer_maker.ocamlBinaryParser use_stdin filename
  | `ML ->
          let lexbuf = Reason_toolchain.setup_lexbuf use_stdin filename in
          let impl = Reason_toolchain.ML.implementation_with_comments in
          (impl lexbuf, true, false)
  | `Reason ->
          let lexbuf = Reason_toolchain.setup_lexbuf use_stdin filename in
          let impl = Reason_toolchain.RE.implementation_with_comments in
          (impl lexbuf, false, false))
  in
  if parsedAsInterface then
    err "The file parsed does not appear to be an implementation file."
  else
    ((ast, comments), parsedAsML)

let print printtype filename parsedAsML output_chan output_formatter =
  match printtype with
  | `BinaryReason -> fun (ast, comments) -> (
    (* Our special format for interchange between reason should keep the
     * comments separate.  This is not compatible for input into the
     * ocaml compiler - only for input into another version of Reason. We
     * also store whether or not the binary was originally *parsed* as an
     * interface file.
     *)
    output_value output_chan (
      Config.ast_impl_magic_number, filename, ast, comments, parsedAsML, false
    );
  )
  | `Binary -> fun (ast, _) ->
    let ast =
      Reason_syntax_util.(apply_mapper_to_structure ast remove_stylistic_attrs_mapper)
    in
    Ast_io.to_channel output_chan filename
      (Ast_io.Impl ((module OCaml_current),
                    Reason_toolchain.To_current.copy_structure ast))
  | `AST -> fun (ast, _) -> (
    Printast.implementation output_formatter
      (Reason_toolchain.To_current.copy_structure ast)
  )
  (* If you don't wrap the function in parens, it's a totally different
   * meaning #thanksOCaml *)
  | `None -> (fun _ -> ())
  | `ML -> Reason_toolchain.ML.print_implementation_with_comments output_formatter
  | `Reason -> Reason_toolchain.RE.print_implementation_with_comments output_formatter

end
module Reason_interface_printer : sig 
#1 "reason_interface_printer.mli"
include Printer_maker.PRINTER

end = struct
#1 "reason_interface_printer.ml"
open Migrate_parsetree
open Ast_404

type t = Parsetree.signature
let err = Printer_maker.err

(* Note: filename should only be used with .mli files. See reason_toolchain. *)
let defaultInterfaceParserFor use_stdin filename =
  let open Reason_toolchain in
  let (theParser, parsedAsML) =
    if Filename.check_suffix filename ".rei"
    then (RE.interface_with_comments, false)
    else if Filename.check_suffix filename ".mli"
    then (ML.interface_with_comments, true)
    else err ("Cannot determine default interface parser for filename '" ^ filename ^ "'.")
  in
  theParser (setup_lexbuf use_stdin filename), parsedAsML, true

let parse ~use_stdin filetype filename =
  let ((ast, comments), parsedAsML, parsedAsInterface) =
  (match filetype with
  | `Auto -> defaultInterfaceParserFor use_stdin filename
  | `BinaryReason -> Printer_maker.reasonBinaryParser use_stdin filename
  | `Binary -> Printer_maker.ocamlBinaryParser use_stdin filename
  | `ML ->
          let lexbuf = Reason_toolchain.setup_lexbuf use_stdin filename in
          let intf = Reason_toolchain.ML.interface_with_comments in
          ((intf lexbuf), true, true)
  | `Reason ->
          let lexbuf = Reason_toolchain.setup_lexbuf use_stdin filename in
          let intf = Reason_toolchain.RE.interface_with_comments in
          ((intf lexbuf), false, true))
  in
  if not parsedAsInterface then
    err "The file parsed does not appear to be an interface file."
  else ((ast, comments), parsedAsML)

let print printtype filename parsedAsML output_chan output_formatter =
  match printtype with
  | `BinaryReason -> fun (ast, comments) -> (
    (* Our special format for interchange between reason should keep the
     * comments separate.  This is not compatible for input into the
     * ocaml compiler - only for input into another version of Reason. We
     * also store whether or not the binary was originally *parsed* as an
     * interface file.
     *)
    output_value output_chan (
      Config.ast_intf_magic_number, filename, ast, comments, parsedAsML, true
    );
  )
  | `Binary -> fun (ast, _) -> (
      Ast_io.to_channel output_chan filename
        (Ast_io.Intf ((module OCaml_current),
                      Reason_toolchain.To_current.copy_signature ast))
  )
  | `AST -> fun (ast, _) -> (
      Printast.interface output_formatter
        (Reason_toolchain.To_current.copy_signature ast)
  )
  (* If you don't wrap the function in parens, it's a totally different
   * meaning #thanksOCaml *)
  | `None -> (fun _ -> ())
  | `ML -> Reason_toolchain.ML.print_interface_with_comments output_formatter
  | `Reason -> Reason_toolchain.RE.print_interface_with_comments output_formatter

end
module Vendored_cmdliner : sig 
#1 "vendored_cmdliner.mli"
(*---------------------------------------------------------------------------
   Copyright (c) 2011 Daniel C. Bünzli. All rights reserved.
   Distributed under a BSD3 license, see license at the end of the file.
   cmdliner release 0.9.8
  ---------------------------------------------------------------------------*)

(** Declarative definition of command line interfaces.

    [Cmdliner] provides a simple and compositional mechanism
    to convert command line arguments to OCaml values and pass them to
    your functions. The module automatically handles syntax errors,
    help messages and UNIX man page generation. It supports programs
    with single or multiple commands
    (like [darcs] or [git]) and respect most of the
    {{:http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html}
    POSIX} and
    {{:http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html}
    GNU} conventions.

    Consult the {{!basics}basics}, details about the supported
    {{!cmdline}command line syntax} and {{!examples} examples} of
    use. Open the module to use it, it defines only three modules in
    your scope.

    {e Release 0.9.8 - Daniel Bünzli <daniel.buenzl i\@erratique.ch> } *)

(** {1:top Interface} *)

(** Man page specification.

    Man page generation is automatically handled by [Cmdliner]. The
    {!block} type is used to define a man page's content.

    The {!print} function can be useful if the client wants to define
    other man pages (e.g. to implement a help command). *)
module Manpage : sig

  (** {1:man Man pages} *)

  type block =
    [ `S of string | `P of string | `Pre of string | `I of string * string
    | `Noblank ]
  (** The type for a block of man page text.

      {ul
      {- [`S s] introduces a new section [s].}
      {- [`P t] is a new paragraph with text [t].}
      {- [`Pre t] is a new preformatted paragraph with text [t].}
      {- [`I (l,t)] is an indented paragraph with label
      [l] and text [t].}
      {- [`Noblank] suppresses the blank line introduced between two blocks.}}

      Except in [`Pre], whitespace and newlines are not significant
      and are all collapsed to a single space. In labels [l] and text
      strings [t], the syntax ["$(i,italic text)"] and ["$(b,bold
      text)"] can be used to respectively produce italic and bold
      text. *)

  type title = string * int * string * string * string
  (** The type for man page titles. Describes the man page
      [title], [section], [center_footer], [left_footer], [center_header]. *)

  type t = title * block list
  (** The type for a man page. A title and the page text as a list of blocks. *)

  val print : ?subst:(string -> string) ->
    [`Pager | `Plain | `Groff ] -> Format.formatter -> t -> unit
  (** [print ~subst fmt ppf page] prints [page] on [ppf] in the format [fmt].
      If [fmt] is [`Pager] the function tries to write the formatted
      result in a pager, if that fails the format [`Plain] is written
      on [ppf]. [subst] can be used to perform variable substitution,
      see {!Buffer.add_substitute} (defaults to the identity). *)
end

(** Terms.

    A term is evaluated by a program to produce a {{!result}result}.
    A term made of terms referring to {{!Arg}command line arguments}
    implicitly defines a command line syntax. *)
module Term : sig

  (** {1:terms Terms} *)

  type +'a t
  (** The type for terms evaluating to values of type 'a. *)

  val const : 'a -> 'a t
  (** [const v] is a term that evaluates to [v]. *)

  (**/**)
  val pure : 'a -> 'a t
  (** @deprecated use {!const} instead. *)
  (**/**)

  val ( $ ) : ('a -> 'b) t -> 'a t -> 'b t
  (** [f $ v] is a term that evaluates to the result of applying
      the evaluation of [v] to the one of [f]. *)

  val app : ('a -> 'b) t -> 'a t -> 'b t
  (** [app] is {!($)}. *)

  type 'a ret =
    [ `Help of [`Pager | `Plain | `Groff] * string option
    | `Error of (bool * string)
    | `Ok of 'a ]
  (** The type for command return values. See {!ret}. *)

  val ret : 'a ret t -> 'a t
  (** [ret v] is a term whose evaluation depends on the case
      to which [v] evaluates. With :
      {ul
      {- [`Ok r], it evaluates to [r].}
      {- [`Error (usage,e)], the evaluation fails and [Cmdliner] prints
         the error [e] and the term's usage if [usage] is [true].}
      {- [`Help (format, name)], the evaluation fails and [Cmdliner] prints the
         term's man page in the given [format] (or the man page for a
         specific [name] term in case of multiple term evaluation).}}   *)

  val main_name : string t
  (** [main_name] is a term that evaluates to the "main" term's name. *)

  val choice_names : string list t
  (** [choice_names] is a term that evaluates to the names of the terms
      to choose from. *)

  val man_format : [`Pager | `Plain | `Groff] t
  (** [man_format] is a term that defines a [--man-format] option and
      evaluates to a value that can be used with {!Manpage.print}. *)

  (** {1:tinfo Term information}

      Term information defines the name and man page of a term.
      For simple evaluation this is the name of the program and its
      man page. For multiple term evaluation, this is
      the name of a command and its man page. *)

  type info
  (** The type for term information. *)

  val info : ?sdocs:string -> ?man:Manpage.block list ->
    ?docs:string -> ?doc:string -> ?version:string -> string -> info
  (** [info sdocs man docs doc version name] is a term information
      such that:
      {ul
      {- [name] is the name of the program or the command.}
      {- [version] is the version string of the program, ignored
         for commands.}
      {- [doc] is a one line description of the program or command used
         for the [NAME] section of the term's man page. For commands this
         description is also used in the list of commands of the main
         term's man page.}
      {- [docs], only for commands, the title of the section of the main
         term's man page where it should be listed (defaults to ["COMMANDS"]).}
      {- [man] is the text of the man page for the term. In the text,
         the variables ["$(tname)"] and ["$(mname)"] can respectively be
         used to refer to the value of [name] and the main term's name.
      }
      {- [sdocs] defines the title of the section in which the
         standard [--help] and [--version] arguments are listed.}} *)

  val name : info -> string
  (** [name ti] is the name of the term information. *)

 (** {1:evaluation Evaluation} *)

  type 'a result = [
    | `Ok of 'a | `Error of [`Parse | `Term | `Exn ] | `Version | `Help ]
  (** The type for evaluation results.
      {ul
      {- [`Ok v], the term evaluated successfully and [v] is the result.}
      {- [`Version], the version string of the main term was printed
       on the help formatter.}
      {- [`Help], man page about the term was printed on the help formatter.}
      {- [`Error `Parse], a command line parse error occured and was
         reported on the error formatter.}
      {- [`Error `Term], a term evaluation error occured and was reported
         on the error formatter (see {!Term.ret}).}
      {- [`Error `Exn], an exception [e] was caught and reported
         on the error formatter (see the [~catch] parameter of {!eval}).}} *)

  val eval : ?help:Format.formatter ->
    ?err:Format.formatter -> ?catch:bool ->
    ?env:(string -> string option) ->
    ?argv:string array -> ('a t * info) -> 'a result
  (** [eval help err catch argv (t,i)]  is the evaluation result
      of [t] with command line arguments [argv] (defaults to {!Sys.argv}).

      If [catch] is [true] (default) uncaught exeptions
      are intercepted and their stack trace is written to the [err]
      formatter.

      [help] is the formatter used to print help or version messages
      (defaults to {!Format.std_formatter}). [err] is the formatter
      used to print error messages (defaults to {!Format.err_formatter}).

      [env] is used for environment variable lookup, the default
      uses {!Sys.getenv}. *)

  val eval_choice : ?help:Format.formatter ->
    ?err:Format.formatter -> ?catch:bool ->
    ?env:(string -> string option) ->
    ?argv:string array -> 'a t * info -> ('a t * info) list ->
    'a result
  (** [eval_choice help err catch argv default (t,i) choices] is like {!eval}
      except that if the first argument on the command line is not an option
      name it will look in [choices] for a term whose information has this
      name and evaluate it.

      If the command name is unknown an error is reported. If the name
      is unspecified the "main" term [t] is evaluated. [i] defines the
      name and man page of the program. *)

  val eval_peek_opts : ?version_opt:bool ->
    ?env:(string -> string option) ->
    ?argv:string array -> 'a t ->
    'a option * 'a result
  (** [eval_peek_opts version_opt argv t] evaluates [t], a term made
      of optional arguments only, with the command line [argv]
      (defaults to {!Sys.argv}). In this evaluation, unknown optional
      arguments and positional arguments are ignored.

      The evaluation returns a pair. The first component is
      the result of parsing the command line [argv] stripped from
      any help and version option if [version_opt] is [true] (defaults
      to [false]). It results in:
      {ul
      {- [Some _] if the command line would be parsed correctly given the
         {e partial} knowledge in [t].}
      {- [None] if a parse error would occur on the options of [t]}}

      The second component is the result of parsing the command line
      [argv] without stripping the help and version options. It
      indicates what the evaluation would result in on [argv] given
      the partial knowledge in [t] (for example it would return
      [`Help] if there's a help option in [argv]). However in
      contrasts to {!eval} and {!eval_choice} no side effects like
      error reporting or help output occurs.

      {b Note.} Positional arguments can't be peeked without the full
      specification of the command line: we can't tell apart a
      positional argument from the value of an unknown optional
      argument.  *)
end

(** Terms for command line arguments.

    This module provides functions to define terms that evaluate
    to the arguments provided on the command line.

    Basic constraints, like the argument type or repeatability, are
    specified by defining a value of type {!t}. Further contraints can
    be specified during the {{!argterms}conversion} to a term. *)
module Arg : sig

(** {1:argconv Argument converters}

    An argument converter transforms a string argument of the command
    line to an OCaml value. {{!converters}Predefined converters}
    are provided for many types of the standard library. *)

  type 'a parser = string -> [ `Ok of 'a | `Error of string ]
  (** The type for argument parsers. *)

  type 'a printer = Format.formatter -> 'a -> unit
  (** The type for converted argument printers. *)

  type 'a converter = 'a parser * 'a printer
  (** The type for argument converters. *)

  val some : ?none:string -> 'a converter -> 'a option converter
  (** [some none c] is like the converter [c] except it returns
      [Some] value. It is used for command line arguments
      that default to [None] when absent. [none] is what to print to
      document the absence (defaults to [""]). *)

(** {1:arginfo Arguments and their information}

    Argument information defines the man page information of an
    argument and, for optional arguments, its names. An environment
    variable can also be specified to read the argument value from
    if the argument is absent from the command line and the variable
    is defined. *)

  type env
  (** The type for environment variables and their documentation. *)

  val env_var : ?docs:string -> ?doc:string -> string -> env
  (** [env_var docs doc var] is an environment variables [var]. [doc]
      is the man page information of the environment variable; the
      variables mentioned in {!info} can be used in this documentation
      string. [doc] defaults to ["See option $(opt)."]. [docs] is the
      title of the man page section in which the environment variable
      will be listed, it defaults to ["ENVIRONMENT VARIABLES"]. *)

  type 'a t
  (** The type for arguments holding data of type ['a]. *)

  type info
  (** The type for information about command line arguments. *)

  val info : ?docs:string -> ?docv:string -> ?doc:string -> ?env:env ->
    string list -> info
  (** [info docs docv doc env names] defines information for
      an argument.

      [names] defines the names under which an optional argument
      can be referred to. Strings of length [1] (["c"]) define short
      option names (["-c"]), longer strings (["count"]) define long
      option names (["--count"]). [names] must be empty for positional
      arguments.

      [env] defines the name of an environment variable which is
      looked up for defining the argument if it is absent from the
      command line. See {{!envlookup}environment variables} for
      details.
      {ul
      {- [doc] is the man page information of the argument. The
         variable ["$(docv)"] can be used to refer to the value of
         [docv] (see below). The variable ["$(opt)"] will refer to a
         long option of [names] or a short one if there is no long
         option. The variable ["$(env)"] will refer to the environment
         variable specified by [env] (if any).  {{!doc_helpers}These
         functions} can help with formatting argument values.}
      {- [docv] is for positional and non-flag optional arguments.
         It is a variable name used in the man page to stand for their value.}
      {- [docs] is the title of the man page section in which the argument
         will be listed. For optional arguments this defaults
         to ["OPTIONS"]. For positional arguments this defaults
         to ["ARGUMENTS"]. However a positional argument is only listed
         if it has both a [doc] and [docv] specified.}} *)

  val ( & ) : ('a -> 'b) -> 'a -> 'b
  (** [f & v] is [f v], a right associative composition operator for
      specifying argument terms. *)

(** {1:optargs Optional arguments}

    The information of an optional argument must have at least
    one name or [Invalid_argument] is raised. *)

  val flag : info -> bool t
  (** [flag i] is a [bool] argument defined by an optional flag
      that may appear {e at most} once on the command line under one of
      the names specified by [i]. The argument holds [true] if the
      flag is present on the command line and [false] otherwise. *)

  val flag_all : info -> bool list t
  (** [flag_all] is like {!flag} except the flag may appear more than
      once. The argument holds a list that contains one [true] value per
      occurence of the flag. It holds the empty list if the flag
      is absent from the command line. *)

  val vflag : 'a -> ('a * info) list -> 'a t
  (** [vflag v \[v]{_0}[,i]{_0}[;...\]] is an ['a] argument defined
      by an optional flag that may appear {e at most} once on
      the command line under one of the names specified in the [i]{_k}
      values. The argument holds [v] if the flag is absent from the
      command line and the value [v]{_k} if the name under which it appears
      is in [i]{_k}.

      {b Note.} Environment variable lookup is unsupported for
      for these arguments. *)

  val vflag_all : 'a list -> ('a * info) list -> 'a list t
  (** [vflag_all v l] is like {!vflag} except the flag may appear more
      than once. The argument holds the list [v] if the flag is absent
      from the command line. Otherwise it holds a list that contains one
      corresponding value per occurence of the flag, in the order found on
      the command line.

      {b Note.} Environment variable lookup is unsupported for
      for these arguments. *)

  val opt : ?vopt:'a -> 'a converter -> 'a -> info -> 'a t
  (** [opt vopt c v i] is an ['a] argument defined by the value of
      an optional argument that may appear {e at most} once on the command
      line under one of the names specified by [i]. The argument holds
      [v] if the option is absent from the command line. Otherwise
      it has the value of the option as converted by [c].

      If [vopt] is provided the value of the optional argument is itself
      optional, taking the value [vopt] if unspecified on the command line. *)

  val opt_all : ?vopt:'a -> 'a converter -> 'a list -> info -> 'a list t
  (** [opt_all vopt c v i] is like {!opt} except the optional argument may
      appear more than once. The argument holds a list that contains one value
      per occurence of the flag in the order found on the command line.
      It holds the list [v] if the flag is absent from the command line. *)

  (** {1:posargs Positional arguments}

      The information of a positional argument must have no name
      or [Invalid_argument] is raised. Positional arguments indexing
      is zero-based. *)

  val pos : ?rev:bool -> int -> 'a converter -> 'a -> info -> 'a t
  (** [pos rev n c v i] is an ['a] argument defined by the [n]th
      positional argument of the command line as converted by [c].
      If the positional argument is absent from the command line
      the argument is [v].

      If [rev] is [true] (defaults to [false]), the computed
      position is [max-n] where [max] is the position of
      the last positional argument present on the command line. *)

  val pos_all : 'a converter -> 'a list -> info -> 'a list t
  (** [pos_all c v i] is an ['a list] argument that holds
      all the positional arguments of the command line as converted
      by [c] or [v] if there are none. *)

  val pos_left : ?rev:bool -> int -> 'a converter -> 'a list -> info ->
    'a list t
  (** [pos_left rev n c v i] is an ['a list] argument that holds
      all the positional arguments as converted by [c] found on the left
      of the [n]th positional argument or [v] if there are none.

      If [rev] is [true] (defaults to [false]), the computed
      position is [max-n] where [max] is the position of
      the last positional argument present on the command line. *)

  val pos_right : ?rev:bool -> int -> 'a converter -> 'a list -> info ->
    'a list t
  (** [pos_right] is like {!pos_left} except it holds all the positional
      arguments found on the right of the specified positional argument. *)

  (** {1:argterms Arguments as terms} *)

  val value : 'a t -> 'a Term.t
  (** [value a] is a term that evaluates to [a]'s value. *)

  val required : 'a option t -> 'a Term.t
  (** [required a] is a term that fails if [a]'s value is [None] and
      evaluates to the value of [Some] otherwise. Use this for required
      positional arguments (it can also be used for defining required
      optional arguments, but from a user interface perspective this
      shouldn't be done, it is a contradiction in terms). *)

  val non_empty : 'a list t -> 'a list Term.t
  (** [non_empty a] is term that fails if [a]'s list is empty and
      evaluates to [a]'s list otherwise. Use this for non empty lists
      of positional arguments. *)

  val last : 'a list t -> 'a Term.t
  (** [last a] is a term that fails if [a]'s list is empty and evaluates
      to the value of the last element of the list otherwise. Use this
      for lists of flags or options where the last occurence takes precedence
      over the others. *)

  (** {1:converters Predefined converters} *)

  val bool : bool converter
  (** [bool] converts values with {!bool_of_string}. *)

  val char : char converter
  (** [char] converts values by ensuring the argument has a single char. *)

  val int : int converter
  (** [int] converts values with {!int_of_string}. *)

  val nativeint : nativeint converter
  (** [nativeint] converts values with {!Nativeint.of_string}. *)

  val int32 : int32 converter
  (** [int32] converts values with {!Int32.of_string}. *)

  val int64 : int64 converter
  (** [int64] converts values with {!Int64.of_string}. *)

  val float : float converter
  (** [float] converts values with {!float_of_string}. *)

  val string : string converter
  (** [string] converts values with the identity function. *)

  val enum : (string * 'a) list -> 'a converter
  (** [enum l p] converts values such that unambiguous prefixes of string names
      in [l] map to the corresponding value of type ['a].

      {b Warning.} The type ['a] must be comparable with {!Pervasives.compare}.

      @raise Invalid_argument if [l] is empty. *)

  val file : string converter
  (** [file] converts a value with the identity function and
      checks with {!Sys.file_exists} that a file with that name exists. *)

  val dir : string converter
  (** [dir] converts a value with the identity function and checks
      with {!Sys.file_exists} and {!Sys.is_directory}
      that a directory with that name exists. *)

  val non_dir_file : string converter
  (** [non_dir_file] converts a value with the identity function and checks
      with {!Sys.file_exists} and {!Sys.is_directory}
      that a non directory file with that name exists. *)

  val list : ?sep:char -> 'a converter -> 'a list converter
  (** [list sep c] splits the argument at each [sep] (defaults to [','])
      character and converts each substrings with [c]. *)

  val array : ?sep:char -> 'a converter -> 'a array converter
  (** [array sep c] splits the argument at each [sep] (defaults to [','])
      character and converts each substring with [c]. *)

  val pair : ?sep:char -> 'a converter -> 'b converter -> ('a * 'b) converter
  (** [pair sep c0 c1] splits the argument at the {e first} [sep] character
      (defaults to [',']) and respectively converts the substrings with
      [c0] and [c1]. *)

  val t2 : ?sep:char -> 'a converter -> 'b converter -> ('a * 'b) converter
  (** {!t2} is {!pair}. *)

  val t3 : ?sep:char -> 'a converter ->'b converter -> 'c converter ->
    ('a * 'b * 'c) converter
  (** [t3 sep c0 c1 c2] splits the argument at the {e first} two [sep]
      characters (defaults to [',']) and respectively converts the
      substrings with [c0], [c1] and [c2]. *)

  val t4 : ?sep:char -> 'a converter ->'b converter -> 'c converter ->
    'd converter -> ('a * 'b * 'c * 'd) converter
  (** [t4 sep c0 c1 c2 c3] splits the argument at the {e first} three [sep]
      characters (defaults to [',']) respectively converts the substrings
      with [c0], [c1], [c2] and [c3]. *)

  (** {1:doc_helpers Documentation formatting helpers} *)

  val doc_quote : string -> string
  (** [doc_quote s] quotes the string [s]. *)

  val doc_alts : ?quoted:bool -> string list -> string
  (** [doc_alts alts] documents the alternative tokens [alts] according
      the number of alternatives. If [quoted] is [true] (default)
      the tokens are quoted. The resulting string can be used in
      sentences of the form ["$(docv) must be %s"].

      @raise Invalid_argument if [alts] is the empty string.  *)

  val doc_alts_enum : ?quoted:bool -> (string * 'a) list -> string
  (** [doc_alts_enum quoted alts] is [doc_alts quoted (List.map fst alts)]. *)
end

(**
    {1:basics Basics}

    With [Cmdliner] your program evaluates a term. A {e term}
    is a value of type {!Term.t}. The type parameter indicates
    the type of the result of the evaluation.

    One way to create terms is by lifting regular OCaml values with
    {!Term.const}. Terms can be applied to terms evaluating to
    functional values with {!Term.( $ )}. For example for the function:
{[let revolt () = print_endline "Revolt!"]}
    the term :
{[
open Cmdliner;;

let revolt_t = Term.(const revolt $ const ())]}
    is a term that evaluates to the result (and effect) of the [revolt]
    function.
    Terms are evaluated with {!Term.eval}:
{[let () = match Term.eval (revolt_t, Term.info "revolt") with
| `Error _ -> exit 1 | _ -> exit 0]}
    This defines a command line program named ["revolt"], without command line
    arguments arguments, that just prints ["Revolt!"] on [stdout].
{[> ./revolt
Revolt!]}
    The combinators in the {!Arg} module allow to extract command
    line argument data as terms. These terms can then be applied to
    lifted OCaml functions to be evaluated by the program.

    Terms corresponding to command line argument data that are part of
    a term evaluation implicitly define a command line syntax.  We
    show this on an concrete example.

    Consider the [chorus] function that prints repeatedly a
    given message :
{[let chorus count msg =
  for i = 1 to count do print_endline msg done]}
    we want to make it available from the command line
    with the synopsis:
{[chorus [-c COUNT | --count=COUNT] [MSG]]}
    where [COUNT] defaults to [10] and [MSG] defaults to ["Revolt!"].
    We first define a term corresponding to the [--count]
    option:
{[
let count =
  let doc = "Repeat the message $(docv) times." in
  Arg.(value & opt int 10 & info ["c"; "count"] ~docv:"COUNT" ~doc)
]}
    This says that [count] is a term that evaluates to the
    value of an optional argument of type [int] that
    defaults to [10] if unspecified and whose option name is
    either [-c] or [--count]. The arguments [doc] and [docv] are used to
    generate the option's man page information.

    The term for the positional argument [MSG] is:
{[
let msg =
  let doc = "Overrides the default message to print."
  let env = Arg.env "CHORUS_MSG" ~doc in
  let doc = "The message to print." in
  Arg.(value & pos 0 string "Revolt!" & info [] ~env ~docv:"MSG" ~doc)
]}
    which says that [msg] is a term whose value is the positional
    argument at index [0] of type [string] and defaults to ["Revolt!"]
    or the value of the environment variable [CHORUS_MSG] if the
    argument is unspecified on the command line. Here again [doc] and
    [docv] are used for the man page information.

    The term for executing [chorus] with these command line arguments
    is :
{[
let chorus_t = Term.(const chorus $ count $ msg)
]}
    and we are now ready to define our program:
{[
let info =
  let doc = "print a customizable message repeatedly" in
  let man = [ `S "BUGS"; `P "Email bug reports to <hehey at example.org>.";] in
  Term.info "chorus" ~version:"1.6.1" ~doc ~man

let () = match Term.eval (chorus_t, info) with `Error _ -> exit 1 | _ -> exit 0
]}
    The [info] value created with {!Term.info} gives more information
    about the term we execute and is used to generate the program's
    man page. Since we provided a [~version] string, the program will
    automatically respond to the [--version] option by printing this
    string.

    A program using {!Term.eval} always responds to the
    [--help] option by showing the man page about the program generated
    using the information you provided with {!Term.info} and {!Arg.info}.
    Here is the output generated by our example :
{v > ./chorus --help
NAME
       chorus - print a customizable message repeatedly

SYNOPSIS
       chorus [OPTION]... [MSG]

ARGUMENTS
       MSG (absent=Revolt! or CHORUS_MSG env)
           The message to print.

OPTIONS
       -c COUNT, --count=COUNT (absent=10)
           Repeat the message COUNT times.

       --help[=FMT] (default=pager)
           Show this help in format FMT (pager, plain or groff).

       --version
           Show version information.

BUGS
       Email bug reports to <hehey at example.org>.
v}

    If a pager is available, this output is written to a pager.
    This help is also available in plain text or in the
    {{:http://www.gnu.org/software/groff/groff.html}groff} man page format by
    invoking the program with the option [--help=plain] or [--help=groff].

    For examples of more complex command line definitions look and
    run the {{!examples}examples}.

    {2:multiterms Multiple terms}

    [Cmdliner] also provides support for programs like [darcs] or
    [git] that have multiple commands each with their own syntax:
    {[prog COMMAND [OPTION]... ARG...]}
    A command is defined by coupling a term with
    {{!Term.tinfo}term information}. The term information defines the
    command name and its man page. Given a list of commands the function
    {!Term.eval_choice} will execute the term corresponding to the
    [COMMAND] argument or or a specific "main" term if there is
    no [COMMAND] argument.

    {2:manual Manual}

    Man page sections are printed in the order specified by
    {!Term.info}. The man page information of an argument is listed in
    alphabetical order at the end of the text of the section specified
    by its {{!Arg.info}argument information}. Positional arguments are
    also listed iff both the [docv] and [doc] string is specified in
    their argument information.

    If an argument information mentions a section not specified in
    {!Term.info}, an empty section is created for it. This section is
    inserted just after the ["SYNOPSIS"] section or after a section
    named ["DESCRIPTION"] if there is one.

    The ["SYNOPSIS"] section of a man page is generated automatically
    from a term's information and its arguments. To substitute your
    own instead, start the term's information man page with
    a ["SYNOPSIS"] section.

    Ideally all manual strings should be UTF-8 encoded. However at the
    moment Groff (at least [1.19.2]) doesn't seem to cope with UTF-8
    input and UTF-8 characters beyond the ASCII set will look garbled.
    Regarding UTF-8 output, generating the man page with [-Tutf8] maps
    the hyphen-minus [U+002D] to the minus sign [U+2212] which makes it
    difficult to search it in the pager, so [-Tascii] is used for now.
    Conclusion is that it may be better to stick to the ASCII set for now.
    Please contact the author if something seems wrong in this reasoning
    or if you know a work around this.

    {2:misc Miscellaneous}

    {ul
    {- The option name [--help], (and [--version] if you specify a
       version string) is reserved by the module. Using it as a term or
       option name may result in undefined behaviour.}
    {- The evaluation of a term in which the same option name is defined
       by more than one argument is undefined.}}

    {1:cmdline Command line syntax}

    For programs evaluating a single term the most general form of invocation
    is:
    {ul{- [prog [OPTION]... [ARG]...]}}
    The program automatically reponds to the [--help] option by
    printing the help. If a version string is provided in
    the {{!Term.tinfo}term information}, it also automatically responds
    to the [--version] option by printing this string.

    Command line arguments are either {{!optargs}{e optional}} or
    {{!posargs}{e positional}}. Both can be freely interleaved but
    since [Cmdliner] accepts many optional forms this may result in
    ambiguities. The special {{!posargs} token [--]} can be used to resolve
    them.

    Programs evaluating multiple terms also add this form of invocation:
    {ul{- [prog COMMAND [OPTION]... [ARG]...]}}
    Commands automatically respond to the [--help] option
    by printing their help. The [COMMAND] string must
    be the first string following the program name and may be specified
    by a prefix as long as it is not ambiguous.

    {2:optargs Optional arguments}

    An optional argument is specified on the command line by a {e
    name} possibly followed by a {e value}.

    The name of an option can be short or long.
    {ul
    {- A {e short} name is a dash followed by a single alphanumeric
       character: ["-h"], ["-q"], ["-I"].}
    {- A {e long} name is two dashes followed by alphanumeric
       characters and dashes: ["--help"], ["--silent"], ["--ignore-case"].}}

    More than one name may refer to the same optional argument.  For
    example in a given program the names ["-q"], ["--quiet"] and
    ["--silent"] may all stand for the same boolean argument
    indicating the program to be quiet.  Long names
    can be specified by any non ambiguous prefix.

    The value of an option can be specified in three different ways.
    {ul
    {- As the next token on the command line: ["-o a.out"],
       ["--output a.out"].}
    {- Glued to a short name: ["-oa.out"].}
    {- Glued to a long name after an equal character:
    ["--output=a.out"].}}
    Glued forms are especially useful if
    the value itself starts with a dash as is the case for negative numbers,
    ["--min=-10"].

    An optional argument without a value is either a {e flag}
    (see {!Arg.flag}, {!Arg.vflag}) or an optional argument with an optional
    value (see the [~vopt] argument of {!Arg.opt}).

    Short flags can be grouped together to share a single dash and the group
    can end with a short option. For example assuming ["-v"] and ["-x"]
    are flags and ["-f"] is a short option:
    {ul
      {- ["-vx"] will be parsed as ["-v -x"].}
      {- ["-vxfopt"] will be parsed as ["-v -x -fopt"].}
      {- ["-vxf opt"] will be parsed as ["-v -x -fopt"].}
      {- ["-fvx"] will be parsed as ["-f=vx"].}}

    {2:posargs Positional arguments}

    Positional arguments are tokens on the command line that are not
    option names and are not the value of an optional argument. They
    are numbered from left to right starting with zero.

    Since positional arguments may be mistaken as the optional value
    of an optional argument or they may need to look like option
    names, anything that follows the special token ["--"] on the command
    line is considered to be a positional argument.

    {2:envlookup Environment variables}

    Non-required command line arguments can be backed up by an environment
    variable.  If the argument is absent from the command line and
    that the environment variable is defined, its value is parsed
    using the argument converter and defines the value of the
    argument.

    For {!Arg.flag} and {!Arg.flag_all} that do not have an argument
    converter a boolean is parsed from the lowercased variable value
    as follows:
    {ul
    {- [""], ["false"], ["no"], ["n"] or ["0"] is [false].}
    {- ["true"], ["yes"], ["y"] or ["1"] is [true].}
    {- Any other string is an error.}}

    Note that environment variables are not supported for {!Arg.vflag}
    and {!Arg.vflag_all}.

    {1:examples Examples}

    These examples are in the [test] directory of the distribution.

 {2:exrm A [rm] command}

    We define the command line interface of a
    [rm] command with the synopsis:
{[
rm [OPTION]... FILE...
]}
    The [-f], [-i] and [-I] flags define the prompt behaviour of [rm],
    represented in our program by the [prompt] type. If more than one
    of these flags is present on the command line the last one takes
    precedence.

    To implement this behaviour we map the presence of these flags
    to values of the [prompt] type by using {!Arg.vflag_all}.  This
    argument will contain all occurences of the flag on the command
    line and we just take the {!Arg.last} one to define our term value
    (if there's no occurence the last value of the default list [[Always]] is
    taken, i.e. the default is [Always]).
{[
(* Implementation of the command, we just print the args. *)

type prompt = Always | Once | Never
let prompt_str = function
| Always -> "always" | Once -> "once" | Never -> "never"

let rm prompt recurse files =
  Printf.printf "prompt = %s\nrecurse = %b\nfiles = %s\n"
    (prompt_str prompt) recurse (String.concat ", " files)

(* Command line interface *)

open Cmdliner;;

let files = Arg.(non_empty & pos_all file [] & info [] ~docv:"FILE")
let prompt =
  let doc = "Prompt before every removal." in
  let always = Always, Arg.info ["i"] ~doc in
  let doc = "Ignore nonexistent files and never prompt." in
  let never = Never, Arg.info ["f"; "force"] ~doc in
  let doc = "Prompt once before removing more than three files, or when
             removing recursively. Less intrusive than $(b,-i), while
             still giving protection against most mistakes."
  in
  let once = Once, Arg.info ["I"] ~doc in
  Arg.(last & vflag_all [Always] [always; never; once])

let recursive =
  let doc = "Remove directories and their contents recursively." in
  Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)

let cmd =
  let doc = "remove files or directories" in
  let man = [
    `S "DESCRIPTION";
    `P "$(tname) removes each specified $(i,FILE). By default it does not
        remove directories, to also remove them and their contents, use the
        option $(b,--recursive) ($(b,-r) or $(b,-R)).";
    `P "To remove a file whose name starts with a `-', for example
        `-foo', use one of these commands:";
    `P "rm -- -foo"; `Noblank;
    `P "rm ./-foo";
    `P "$(tname) removes symbolic links, not the files referenced by the
        links.";
    `S "BUGS"; `P "Report bugs to <hehey at example.org>.";
    `S "SEE ALSO"; `P "$(b,rmdir)(1), $(b,unlink)(2)" ]
  in
  Term.(const rm $ prompt $ recursive $ files),
  Term.info "rm" ~version:"1.6.1" ~doc ~man

let () = match Term.eval cmd with `Error _ -> exit 1 | _ -> exit 0
]}
    {2:excp A [cp] command}

    We define the command line interface of a
    [cp] command with the synopsis:
{[cp [OPTION]... SOURCE... DEST ]}
    The [DEST] argument must be a directory if there is more than
    one [SOURCE]. This constraint is too complex to be expressed by the
    combinators of {!Arg}. Hence we just give it the {!Arg.string} type
    and verify the constraint at the beginning of the [cp]
    implementation. If unsatisfied we return an [`Error] and
    by using {!Term.ret} on the lifted result [cp_t] of [cp],
    [Cmdliner] handles the error reporting.
{[
(* Implementation, we check the dest argument and print the args *)

let cp verbose recurse force srcs dest =
  if List.length srcs > 1 &&
  (not (Sys.file_exists dest) || not (Sys.is_directory dest))
  then
    `Error (false, dest ^ " is not a directory")
  else
    `Ok (Printf.printf
     "verbose = %b\nrecurse = %b\nforce = %b\nsrcs = %s\ndest = %s\n"
      verbose recurse force (String.concat ", " srcs) dest)

(* Command line interface *)

open Cmdliner;;

let verbose =
  let doc = "Print file names as they are copied." in
  Arg.(value & flag & info ["v"; "verbose"] ~doc)

let recurse =
  let doc = "Copy directories recursively." in
  Arg.(value & flag & info ["r"; "R"; "recursive"] ~doc)

let force =
  let doc = "If a destination file cannot be opened, remove it and try again."in
  Arg.(value & flag & info ["f"; "force"] ~doc)

let srcs =
  let doc = "Source file(s) to copy." in
  Arg.(non_empty & pos_left ~rev:true 0 file [] & info [] ~docv:"SOURCE" ~doc)

let dest =
  let doc = "Destination of the copy. Must be a directory if there is more
             than one $(i,SOURCE)." in
  Arg.(required & pos ~rev:true 0 (some string) None & info [] ~docv:"DEST"
         ~doc)

let cmd =
  let doc = "copy files" in
  let man = [
    `S "BUGS";
    `P "Email them to <hehey at example.org>.";
    `S "SEE ALSO";
    `P "$(b,mv)(1), $(b,scp)(1), $(b,umask)(2), $(b,symlink)(7)" ]
  in
  Term.(ret (const cp $ verbose $ recurse $ force $ srcs $ dest)),
  Term.info "cp" ~version:"1.6.1" ~doc ~man

let () = match Term.eval cmd with `Error _ -> exit 1 | _ -> exit 0
]}

{2:extail A [tail] command}

We define the command line interface of a [tail] command with the
synopsis:
{[tail [OPTION]... [FILE]...]}

The [--lines] option whose value specifies the number of last lines to
print has a special syntax where a [+] prefix indicates to start
printing from that line number. In the program this is represented by
the [loc] type. We define a custom [loc] {{!Arg.argconv}argument converter}
for this option.

The [--follow] option has an optional enumerated value. The argument
converter [follow], created with {!Arg.enum} parses the option value
into the enumeration. By using {!Arg.some} and the [~vopt] argument of
{!Arg.opt}, the term corresponding to the option [--follow] evaluates to
[None] if [--follow] is absent from the command line, to [Some Descriptor]
if present but without a value and to [Some v] if present with a value
[v] specified.

{[
(* Implementation of the command, we just print the args. *)

type loc = bool * int
type verb = Verbose | Quiet
type follow = Name | Descriptor

let str = Printf.sprintf
let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
let loc_str (rev, k) = if rev then str "%d" k else str "+%d" k
let follow_str = function Name -> "name" | Descriptor -> "descriptor"
let verb_str = function Verbose -> "verbose" | Quiet -> "quiet"

let tail lines follow verb pid files =
  Printf.printf "lines = %s\nfollow = %s\nverb = %s\npid = %s\nfiles = %s\n"
    (loc_str lines) (opt_str follow_str follow) (verb_str verb)
    (opt_str string_of_int pid) (String.concat ", " files)

(* Command line interface *)

open Cmdliner;;

let lines =
  let loc =
    let parse s = try
      if s <> "" && s.[0] <> '+' then `Ok (true, int_of_string s) else
      `Ok (false, int_of_string (String.sub s 1 (String.length s - 1)))
    with Failure _ -> `Error "unable to parse integer"
    in
    parse, fun ppf p -> Format.fprintf ppf "%s" (loc_str p)
  in
  Arg.(value & opt loc (true, 10) & info ["n"; "lines"] ~docv:"N"
   ~doc:"Output the last $(docv) lines or use $(i,+)$(docv) to start
         output after the $(i,N)-1th line.")
let follow =
  let doc = "Output appended data as the file grows. $(docv) specifies how the
             file should be tracked, by its `name' or by its `descriptor'." in
  let follow = Arg.enum ["name", Name; "descriptor", Descriptor] in
  Arg.(value & opt (some follow) ~vopt:(Some Descriptor) None &
       info ["f"; "follow"] ~docv:"ID" ~doc)

let verb =
  let doc = "Never output headers giving file names." in
  let quiet = Quiet, Arg.info ["q"; "quiet"; "silent"] ~doc in
  let doc = "Always output headers giving file names." in
  let verbose = Verbose, Arg.info ["v"; "verbose"] ~doc in
  Arg.(last & vflag_all [Quiet] [quiet; verbose])

let pid =
  let doc = "With -f, terminate after process $(docv) dies." in
  Arg.(value & opt (some int) None & info ["pid"] ~docv:"PID" ~doc)

let files = Arg.(value & (pos_all non_dir_file []) & info [] ~docv:"FILE")

let cmd =
  let doc = "display the last part of a file" in
  let man = [
    `S "DESCRIPTION";
    `P "$(tname) prints the last lines of each $(i,FILE) to standard output. If
        no file is specified reads standard input. The number of printed
        lines can be  specified with the $(b,-n) option.";
    `S "BUGS";
    `P "Report them to <hehey at example.org>.";
    `S "SEE ALSO";
    `P "$(b,cat)(1), $(b,head)(1)" ]
  in
  Term.(const tail $ lines $ follow $ verb $ pid $ files),
  Term.info "tail" ~version:"1.6.1" ~doc ~man

let () = match Term.eval cmd with `Error _ -> exit 1 | _ -> exit 0
]}

{2:exdarcs A [darcs] command}

We define the command line interface of a [darcs] command with the synopsis:
{[darcs [COMMAND] ...]}

The [--debug], [-q], [-v] and [--prehook] options are available in
each command.  To avoid having to pass them individually to each
command we gather them in a record of type [copts]. By lifting the
record constructor [copts] into the term [copts_t] we now have a term
that we can pass to the commands to stand for an argument of type
[copts]. These options are documented in a section called [COMMON
OPTIONS], since we also want to put [--help] and [--version] in this
section, the term information of commands makes a judicious use of the
[sdocs] parameter of {!Term.info}.

The [help] command shows help about commands or other topics. The help
shown for commands is generated by [Cmdliner] by making an approriate
use of {!Term.ret} on the lifted [help] function.

If the program is invoked without a command we just want to show the
help of the program as printed by [Cmdliner] with [--help]. This is
done by the [no_cmd] term.

{[
(* Implementations, just print the args. *)

type verb = Normal | Quiet | Verbose
type copts = { debug : bool; verb : verb; prehook : string option }

let str = Printf.sprintf
let opt_str sv = function None -> "None" | Some v -> str "Some(%s)" (sv v)
let opt_str_str = opt_str (fun s -> s)
let verb_str = function
  | Normal -> "normal" | Quiet -> "quiet" | Verbose -> "verbose"

let pr_copts oc copts = Printf.fprintf oc
    "debug = %b\nverbosity = %s\nprehook = %s\n"
    copts.debug (verb_str copts.verb) (opt_str_str copts.prehook)

let initialize copts repodir = Printf.printf
    "%arepodir = %s\n" pr_copts copts repodir

let record copts name email all ask_deps files = Printf.printf
    "%aname = %s\nemail = %s\nall = %b\nask-deps = %b\nfiles = %s\n"
    pr_copts copts (opt_str_str name) (opt_str_str email) all ask_deps
    (String.concat ", " files)

let help copts man_format cmds topic = match topic with
| None -> `Help (`Pager, None) (* help about the program. *)
| Some topic ->
    let topics = "topics" :: "patterns" :: "environment" :: cmds in
    let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in
    match conv topic with
    | `Error e -> `Error (false, e)
    | `Ok t when t = "topics" -> List.iter print_endline topics; `Ok ()
    | `Ok t when List.mem t cmds -> `Help (man_format, Some t)
    | `Ok t ->
        let page = (topic, 7, "", "", ""), [`S topic; `P "Say something";] in
        `Ok (Cmdliner.Manpage.print man_format Format.std_formatter page)

open Cmdliner;;

(* Help sections common to all commands *)

let copts_sect = "COMMON OPTIONS"
let help_secs = [
 `S copts_sect;
 `P "These options are common to all commands.";
 `S "MORE HELP";
 `P "Use `$(mname) $(i,COMMAND) --help' for help on a single command.";`Noblank;
 `P "Use `$(mname) help patterns' for help on patch matching."; `Noblank;
 `P "Use `$(mname) help environment' for help on environment variables.";
 `S "BUGS"; `P "Check bug reports at http://bugs.example.org.";]

(* Options common to all commands *)

let copts debug verb prehook = { debug; verb; prehook }
let copts_t =
  let docs = copts_sect in
  let debug =
    let doc = "Give only debug output." in
    Arg.(value & flag & info ["debug"] ~docs ~doc)
  in
  let verb =
    let doc = "Suppress informational output." in
    let quiet = Quiet, Arg.info ["q"; "quiet"] ~docs ~doc in
    let doc = "Give verbose output." in
    let verbose = Verbose, Arg.info ["v"; "verbose"] ~docs ~doc in
    Arg.(last & vflag_all [Normal] [quiet; verbose])
  in
  let prehook =
    let doc = "Specify command to run before this $(mname) command." in
    Arg.(value & opt (some string) None & info ["prehook"] ~docs ~doc)
  in
  Term.(const copts $ debug $ verb $ prehook)

(* Commands *)

let initialize_cmd =
  let repodir =
    let doc = "Run the program in repository directory $(docv)." in
    Arg.(value & opt file Filename.current_dir_name & info ["repodir"]
           ~docv:"DIR" ~doc)
  in
  let doc = "make the current directory a repository" in
  let man = [
    `S "DESCRIPTION";
    `P "Turns the current directory into a Darcs repository. Any
       existing files and subdirectories become ..."] @ help_secs
  in
  Term.(const initialize $ copts_t $ repodir),
  Term.info "initialize" ~sdocs:copts_sect ~doc ~man

let record_cmd =
  let pname =
    let doc = "Name of the patch." in
    Arg.(value & opt (some string) None & info ["m"; "patch-name"] ~docv:"NAME"
         ~doc)
  in
  let author =
    let doc = "Specifies the author's identity." in
    Arg.(value & opt (some string) None & info ["A"; "author"] ~docv:"EMAIL"
         ~doc)
  in
  let all =
    let doc = "Answer yes to all patches." in
    Arg.(value & flag & info ["a"; "all"] ~doc)
  in
  let ask_deps =
    let doc = "Ask for extra dependencies." in
    Arg.(value & flag & info ["ask-deps"] ~doc)
  in
  let files = Arg.(value & (pos_all file) [] & info [] ~docv:"FILE or DIR") in
  let doc = "create a patch from unrecorded changes" in
  let man =
    [`S "DESCRIPTION";
     `P "Creates a patch from changes in the working tree. If you specify
      a set of files ..."] @ help_secs
  in
  Term.(const record $ copts_t $ pname $ author $ all $ ask_deps $ files),
  Term.info "record" ~doc ~sdocs:copts_sect ~man

let help_cmd =
  let topic =
    let doc = "The topic to get help on. `topics' lists the topics." in
    Arg.(value & pos 0 (some string) None & info [] ~docv:"TOPIC" ~doc)
  in
  let doc = "display help about darcs and darcs commands" in
  let man =
    [`S "DESCRIPTION";
     `P "Prints help about darcs commands and other subjects..."] @ help_secs
  in
  Term.(ret
          (const help $ copts_t $ Term.man_format $ Term.choice_names $topic)),
  Term.info "help" ~doc ~man

let default_cmd =
  let doc = "a revision control system" in
  let man = help_secs in
  Term.(ret (const (fun _ -> `Help (`Pager, None)) $ copts_t)),
  Term.info "darcs" ~version:"1.6.1" ~sdocs:copts_sect ~doc ~man

let cmds = [initialize_cmd; record_cmd; help_cmd]

let () = match Term.eval_choice default_cmd cmds with
| `Error _ -> exit 1 | _ -> exit 0
]}
*)

(*---------------------------------------------------------------------------
   Copyright (c) 2011 Daniel C. Bünzli
   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:

   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

   3. Neither the name of Daniel C. Bünzli nor the names of
      contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ---------------------------------------------------------------------------*)

end = struct
#1 "vendored_cmdliner.ml"
(*---------------------------------------------------------------------------
   Copyright (c) 2011 Daniel C. Bünzli. All rights reserved.
   Distributed under a BSD3 license, see license at the end of the file.
   cmdliner release 0.9.8
  ---------------------------------------------------------------------------*)

let str = Printf.sprintf

(* Invalid_arg strings *)

let err_argv = "argv array must have at least one element"
let err_not_opt = "Option argument without name"
let err_not_pos = "Positional argument with a name"
let err_help s = "Term error, help requested for unknown command " ^ s
let err_empty_list = "Empty list"
let err_incomplete_enum = "Incomplete enumeration for the type"
let err_doc_string s =
  str "Variable substitution failed on documentation fragment `%s'" s

(* A few useful definitions. *)

let rev_compare n n' = compare n' n
let pr = Format.fprintf
let pr_str = Format.pp_print_string
let pr_char = Format.pp_print_char
let str_of_pp pp v = pp Format.str_formatter v; Format.flush_str_formatter ()
let quote s = str "`%s'" s
let alts_str ?(quoted = true) alts =
  let quote = if quoted then quote else (fun s -> s) in
  match alts with
  | [] -> invalid_arg err_empty_list
  | [a] -> (quote a)
  | [a; b] -> str "either %s or %s" (quote a) (quote b)
  | alts ->
      let rev_alts = List.rev alts in
      str "one of %s or %s"
        (String.concat ", " (List.rev_map quote (List.tl rev_alts)))
        (quote (List.hd rev_alts))

let pr_white_str spaces ppf s =  (* spaces and new lines with Format's funs *)
  let left = ref 0 and right = ref 0 and len = String.length s in
  let flush () =
    Format.pp_print_string ppf (String.sub s !left (!right - !left));
    incr right; left := !right;
  in
  while (!right <> len) do
    if s.[!right] = '\n' then (flush (); Format.pp_force_newline ppf ()) else
    if spaces && s.[!right] = ' ' then (flush (); Format.pp_print_space ppf ())
    else incr right;
  done;
  if !left <> len then flush ()

let pr_text = pr_white_str true
let pr_lines = pr_white_str false
let pr_to_temp_file pr v = try
  let exec = Filename.basename Sys.argv.(0) in
  let file, oc = Filename.open_temp_file exec "out" in
  let ppf = Format.formatter_of_out_channel oc in
  pr ppf v; Format.pp_print_flush ppf (); close_out oc;
  at_exit (fun () -> try Sys.remove file with Sys_error e -> ());
  Some file
with Sys_error _ -> None

(* Levenshtein distance, for making spelling suggestions in case of error. *)

let levenshtein_distance s t =
  (* As found here http://rosettacode.org/wiki/Levenshtein_distance#OCaml *)
  let minimum a b c = min a (min b c) in
  let m = String.length s in
  let n = String.length t in
  (* for all i and j, d.(i).(j) will hold the Levenshtein distance between
     the first i characters of s and the first j characters of t *)
  let d = Array.make_matrix (m+1) (n+1) 0 in
  for i = 0 to m do d.(i).(0) <- i done;
  for j = 0 to n do d.(0).(j) <- j done;
  for j = 1 to n do
    for i = 1 to m do
      if s.[i-1] = t.[j-1] then
        d.(i).(j) <- d.(i-1).(j-1)  (* no operation required *)
      else
        d.(i).(j) <- minimum
            (d.(i-1).(j) + 1)   (* a deletion *)
            (d.(i).(j-1) + 1)   (* an insertion *)
            (d.(i-1).(j-1) + 1) (* a substitution *)
    done;
  done;
  d.(m).(n)

let suggest s candidates =
  let add (min, acc) name =
    let d = levenshtein_distance s name in
    if d = min then min, (name :: acc) else
    if d < min then d, [name] else
    min, acc
  in
  let dist, suggs = List.fold_left add (max_int, []) candidates in
  if dist < 3 (* suggest only if not too far *) then suggs else []

(* Tries. This implementation also maps any non ambiguous prefix of a
   key to its value. *)

module Trie : sig
  type 'a t
  val empty : 'a t
  val is_empty : 'a t -> bool
  val add : 'a t -> string -> 'a -> 'a t
  val find : 'a t -> string -> [ `Ok of 'a | `Ambiguous | `Not_found ]
  val ambiguities : 'a t -> string -> string list
  val of_list : (string * 'a) list -> 'a t
end = struct
  module Cmap = Map.Make (Char)                           (* character maps. *)
  type 'a value =                         (* type for holding a bound value. *)
    | Pre of 'a                    (* value is bound by the prefix of a key. *)
    | Key of 'a                          (* value is bound by an entire key. *)
    | Amb                     (* no value bound because of ambiguous prefix. *)
    | Nil                            (* not bound (only for the empty trie). *)

  type 'a t = { v : 'a value; succs : 'a t Cmap.t }
  let empty = { v = Nil; succs = Cmap.empty }
  let is_empty t = t = empty

  (* N.B. If we replace a non-ambiguous key, it becomes ambiguous but it's
     not important for our use. Also the following is not tail recursive but
     the stack is bounded by key length. *)
  let add t k d =
    let rec aux t k len i d pre_d =
      if i = len then { v = Key d; succs = t.succs } else
      let v = match t.v with
      | Amb | Pre _ -> Amb | Key _ as v -> v | Nil -> pre_d
      in
      let succs =
        let t' = try Cmap.find k.[i] t.succs with Not_found -> empty in
        Cmap.add k.[i] (aux t' k len (i + 1) d pre_d) t.succs
      in
      { v; succs }
    in
    aux t k (String.length k) 0 d (Pre d (* allocate less *))

  let find_node t k =
    let rec aux t k len i =
      if i = len then t else
      aux (Cmap.find k.[i] t.succs) k len (i + 1)
    in
    aux t k (String.length k) 0

  let find t k =
    try match (find_node t k).v with
    | Key v | Pre v -> `Ok v | Amb -> `Ambiguous | Nil -> `Not_found
    with Not_found -> `Not_found

  let ambiguities t p =                        (* ambiguities of [p] in [t]. *)
    try
      let t = find_node t p in
      match t.v with
      | Key _ | Pre _ | Nil -> []
      | Amb ->
          let add_char s c = s ^ (String.make 1 c) in
          let rem_char s = String.sub s 0 ((String.length s) - 1) in
          let to_list m = Cmap.fold (fun k t acc -> (k,t) :: acc) m [] in
          let rec aux acc p = function
          | ((c, t) :: succs) :: rest ->
              let p' = add_char p c in
              let acc' = match t.v with
              | Pre _ | Amb -> acc
              | Key _ -> (p' :: acc)
              | Nil -> assert false
              in
              aux acc' p' ((to_list t.succs) :: succs :: rest)
          | [] :: [] -> acc
          | [] :: rest -> aux acc (rem_char p) rest
          | [] -> assert false
          in
          aux [] p (to_list t.succs :: [])
    with Not_found -> []

  let of_list l = List.fold_left (fun t (s, v) -> add t s v) empty l
end

(* The following types keep untyped information about arguments and
   terms. This data is used to parse the command line, report errors
   and format man page information. *)

type env_info =                (* information about an environment variable. *)
  { env_var : string;                                       (* the variable. *)
    env_doc : string;                                               (* help. *)
    env_docs : string; }              (* title of help section where listed. *)

type absence =        (* what happens if the argument is absent from the cl. *)
  | Error                                           (* an error is reported. *)
  | Val of string Lazy.t         (* if <> "", takes the given default value. *)

type opt_kind =                              (* kinds of optional arguments. *)
  | Flag                                      (* just a flag, without value. *)
  | Opt                                                (* value is required. *)
  | Opt_vopt of string     (* option value is optional, takes given default. *)

type pos_kind =                            (* kinds of positional arguments. *)
  | All                                         (* all positional arguments. *)
  | Nth of bool * int                                  (* specific position. *)
  | Left of bool * int                (* all args on the left of a position. *)
  | Right of bool * int              (* all args on the right of a position. *)

type arg_info =                (* information about a command line argument. *)
  { id : int;                               (* unique id for the argument. *)
    absent : absence;                              (* behaviour if absent. *)
    env_info : env_info option;                   (* environment variable. *)
    doc : string;                                                 (* help. *)
    docv : string;              (* variable name for the argument in help. *)
    docs : string;                  (* title of help section where listed. *)
    p_kind : pos_kind;                             (* positional arg kind. *)
    o_kind : opt_kind;                               (* optional arg kind. *)
    o_names : string list;                        (* names (for opt args). *)
    o_all : bool; }                          (* repeatable (for opt args). *)

let arg_id =        (* thread-safe UIDs, Oo.id (object end) was used before. *)
  let c = ref 0 in
  fun () ->
    let id = !c in
    incr c; if id > !c then assert false (* too many ids *) else id

let is_opt a = a.o_names <> []
let is_pos a = a.o_names = []

module Amap = Map.Make                                     (* arg info maps. *)
    (struct type t = arg_info let compare a a' = compare a.id a'.id end)

type arg =        (* unconverted argument data as found on the command line. *)
  | O of (int * string * (string option)) list (* (pos, name, value) of opt. *)
  | P of string list

type cmdline = arg Amap.t      (* command line, maps arg_infos to arg value. *)

type man_block = [                                 (* block of manpage text. *)
  | `S of string | `P of string | `Pre of string | `I of string * string
  | `Noblank ]

type term_info =
  { name : string;                                    (* name of the term. *)
    version : string option;                   (* version (for --version). *)
    tdoc : string;                        (* one line description of term. *)
    tdocs : string;       (* title of man section where listed (commands). *)
    sdocs : string;    (* standard options, title of section where listed. *)
    man : man_block list; }                              (* man page text. *)

type eval_info =                 (* informatin about the evaluation context. *)
  { term : term_info * arg_info list;               (* term being evaluated. *)
    main : term_info * arg_info list;                          (* main term. *)
    choices : (term_info * arg_info list) list;         (* all term choices. *)
    env : string -> string option }          (* environment variable lookup. *)

let eval_kind ei =                       (* evaluation with multiple terms ? *)
  if ei.choices = [] then `Simple else
  if (fst ei.term) == (fst ei.main) then `M_main else `M_choice

module Manpage = struct
  type title = string * int * string * string * string
  type block = man_block
  type t = title * block list

  let p_indent = 7                                  (* paragraph indentation. *)
  let l_indent = 4                                      (* label indentation. *)
  let escape subst esc buf s =
    let subst s =
      let len = String.length s in
      if not (len > 1 && s.[1] = ',') then (subst s) else
      if len = 2 then "" else
      esc s.[0] (String.sub s 2 (len - 2))
    in
    try
      Buffer.clear buf; Buffer.add_substitute buf subst s;
      let s = Buffer.contents buf in (* twice for $(i,$(mname)). *)
      Buffer.clear buf; Buffer.add_substitute buf subst s;
      Buffer.contents buf
    with Not_found -> invalid_arg (err_doc_string s)

  let pr_tokens ?(groff = false) ppf s =
    let is_space = function ' ' | '\n' | '\r' | '\t' -> true | _ -> false in
    let len = String.length s in
    let i = ref 0 in
    try while (true) do
        while (!i < len && is_space s.[!i]) do incr i done;
        let start = !i in
        if start = len then raise Exit;
        while (!i < len && not (is_space s.[!i]) && not (s.[!i] = '-')) do
          incr i
        done;
        pr_str ppf (String.sub s start (!i - start));
        if !i = len then raise Exit;
        if s.[!i] = '-' then
          (incr i; if groff then pr_str ppf "\\-" else pr_char ppf '-');
        if (!i < len && is_space s.[!i]) then
          (if groff then pr_char ppf ' ' else Format.pp_print_space ppf ())
      done with Exit -> ()

  (* Plain text output *)

  let plain_esc c s = match c with 'g' -> "" (* groff specific *) | _ ->  s
  let pr_indent ppf c = for i = 1 to c do pr_char ppf ' ' done
  let pr_plain_blocks subst ppf ts =
    let buf = Buffer.create 1024 in
    let escape t = escape subst plain_esc buf t in
    let pr_tokens ppf t = pr_tokens ppf (escape t) in
    let rec aux = function
    | [] -> ()
    | t :: ts ->
        begin match t with
        | `Noblank -> ()
        | `P s -> pr ppf "%a@[%a@]@," pr_indent p_indent pr_tokens s
        | `S s -> pr ppf "@[%a@]" pr_tokens s
        | `Pre s -> pr ppf "%a@[%a@]@," pr_indent p_indent pr_lines (escape s)
        | `I (label, s) ->
            let label = escape label in
            let ll = String.length label in
            pr ppf "@[%a@[%a@]" pr_indent p_indent pr_tokens label;
            if s = "" then () else
            if ll < l_indent then
              pr ppf "%a@[%a@]@]@," pr_indent (l_indent - ll) pr_tokens s
            else
            pr ppf "@\n%a@[%a@]@]@,"
              pr_indent (p_indent + l_indent) pr_tokens s
        end;
        begin match ts with
        | `Noblank :: ts -> aux ts
        | ts -> Format.pp_print_cut ppf (); aux ts
        end
    in
    aux ts

  let pr_plain_page subst ppf (_, text) =
    pr ppf "@[<v>%a@]" (pr_plain_blocks subst) text

  (* Groff output *)

  let groff_esc c s = match c with
  | 'i' -> (str "\\fI%s\\fR" s)
  | 'b' -> (str "\\fB%s\\fR" s)
  | 'p' -> "" (* plain text specific *)
  | _ -> s

  let pr_groff_lines ppf s =
    let left = ref 0 and right = ref 0 and len = String.length s in
    let flush () =
      Format.pp_print_string ppf (String.sub s !left (!right - !left));
      incr right; left := !right;
    in
    while (!right <> len) do
      if s.[!right] = '\n' then (flush (); Format.pp_force_newline ppf ()) else
      if s.[!right] = '-' then (flush (); pr_str ppf "\\-") else
      incr right;
    done;
    if !left <> len then flush ()

  let pr_groff_blocks subst ppf text =
    let buf = Buffer.create 1024 in
    let escape t = escape subst groff_esc buf t in
    let pr_tokens ppf t = pr_tokens ~groff:true ppf (escape t) in
    let pr_block = function
    | `P s -> pr ppf "@\n.P@\n%a" pr_tokens s
    | `Pre s -> pr ppf "@\n.P@\n.nf@\n%a@\n.fi" pr_groff_lines (escape s)
    | `S s -> pr ppf "@\n.SH %a" pr_tokens s
    | `Noblank -> pr ppf "@\n.sp -1"
    | `I (l, s) -> pr ppf "@\n.TP 4@\n%a@\n%a" pr_tokens l pr_tokens s
    in
    List.iter pr_block text

  let pr_groff_page subst ppf ((n, s, a1, a2, a3), t) =
    pr ppf ".\\\" Pipe this output to groff -man -Tutf8 | less@\n\
            .\\\"@\n\
            .TH \"%s\" %d \"%s\" \"%s\" \"%s\"@\n\
            .\\\" Disable hyphenation and ragged-right@\n\
            .nh@\n\
      .ad l\
      %a@?"
      n s a1 a2 a3 (pr_groff_blocks subst) t

  (* Printing to a pager *)

  let find_cmd cmds =
    let test, null = match Sys.os_type with
    | "Win32" -> "where", " NUL"
    | _ -> "type", "/dev/null"
    in
    let cmd c = Sys.command (str "%s %s 1>%s 2>%s" test c null null) = 0 in
    try Some (List.find cmd cmds) with Not_found -> None

  let pr_to_pager print ppf v =
    let pager =
      let cmds = ["less"; "more"] in
      let cmds = try (Sys.getenv "PAGER") :: cmds with Not_found -> cmds in
      let cmds = try (Sys.getenv "MANPAGER") :: cmds with Not_found -> cmds in
      find_cmd cmds
    in
    match pager with
    | None -> print `Plain ppf v
    | Some pager ->
        let cmd = match (find_cmd ["groff"; "nroff"]) with
        | None ->
            begin match pr_to_temp_file (print `Plain) v with
            | None -> None
            | Some f -> Some (str "%s < %s" pager f)
            end
        | Some c ->
            begin match pr_to_temp_file (print `Groff) v with
            | None -> None
            | Some f ->
                (* TODO use -Tutf8, but annoyingly maps U+002D to U+2212. *)
                let xroff = if c = "groff" then c ^ " -Tascii -P-c" else c in
                Some (str "%s -man < %s | %s" xroff f pager)
            end
        in
        match cmd with
        | None -> print `Plain ppf v
        | Some cmd -> if (Sys.command cmd) <> 0 then print `Plain ppf v

  let rec print ?(subst = fun x -> x) fmt ppf page = match fmt with
  | `Pager -> pr_to_pager (print ~subst) ppf page
  | `Plain -> pr_plain_page subst ppf page
  | `Groff -> pr_groff_page subst ppf page
end

module Help = struct
  let invocation ?(sep = ' ') ei = match eval_kind ei with
  | `Simple | `M_main -> (fst ei.main).name
  | `M_choice -> str "%s%c%s" (fst ei.main).name sep (fst ei.term).name

  let title ei =
    let prog = String.capitalize (fst ei.main).name in
    let name = String.uppercase (invocation ~sep:'-' ei) in
    let left_footer = prog ^ match (fst ei.main).version with
      | None -> "" | Some v -> str " %s" v
    in
    let center_header = str "%s Manual" prog in
    name, 1, "", left_footer, center_header

  let name_section ei =
    let tdoc d = if d = "" then "" else (str " - %s" d) in
    [`S "NAME"; `P (str "%s%s" (invocation ~sep:'-' ei)
                      (tdoc (fst ei.term).tdoc)); ]

  let synopsis ei = match eval_kind ei with
  | `M_main -> str "$(b,%s) $(i,COMMAND) ..." (invocation ei)
  | `Simple | `M_choice ->
      let rev_cmp (p, _) (p', _) = match p', p with        (* best effort. *)
      | p, All -> -1 | All, p -> 1
      | Left _, Right _ -> -1 | Right _, Left _ -> 1
      | Left (false, k), Nth (false, k')
      | Nth (false, k), Nth (false, k')
      | Nth (false, k), Right (false, k') -> if k <= k' then -1 else 1
      | Nth (false, k), Left (false, k')
      | Right (false, k), Nth (false, k') -> if k >= k' then 1 else -1
      | Left (true, k), Nth (true, k')
      | Nth (true, k), Nth (true, k')
      | Nth (true, k), Right (true, k') -> if k >= k' then -1 else 1
      | Nth (true, k), Left (true, k')
      | Right (true, k), Nth (true, k') -> if k <= k' then 1 else -1
      | p, p' -> compare p p'
      in
      let rec format_pos acc = function
      | a :: al ->
          if is_opt a then format_pos acc al else
          let v = if a.docv = "" then "$(i,ARG)" else str "$(i,%s)" a.docv in
          let v = if a.absent = Error then str "%s" v else str "[%s]" v in
          let v = v ^ match a.p_kind with Nth _ -> "" | _ -> "..." in
          format_pos ((a.p_kind, v) :: acc) al
      | [] -> acc
      in
      let args = List.sort rev_cmp (format_pos [] (snd ei.term)) in
      let args = String.concat " " (List.rev_map snd args) in
      str "$(b,%s) [$(i,OPTION)]... %s" (invocation ei) args

  let get_synopsis_section ei =
    let rec extract_synopsis syn = function
    | `S _ :: _ as man -> List.rev syn, man
    |  block :: rest -> extract_synopsis (block :: syn) rest
    | [] -> List.rev syn, []
    in
    match (fst ei.term).man with
    | `S "SYNOPSIS" as s :: rest -> extract_synopsis [s] rest (* user-defined *)
    | man -> [ `S "SYNOPSIS"; `P (synopsis ei); ], man           (* automatic *)

  let or_env a = match a.env_info with
  | None -> ""
  | Some v -> str " or $(i,%s) env" v.env_var

  let make_arg_label a =
    if is_pos a then str "$(i,%s)" a.docv else
    let fmt_name var = match a.o_kind with
    | Flag -> fun n -> str "$(b,%s)%s" n (or_env a)
    | Opt ->
        fun n ->
          if String.length n > 2 then str "$(b,%s)=$(i,%s)" n var else
          str "$(b,%s) $(i,%s)" n var
    | Opt_vopt _ ->
        fun n ->
          if String.length n > 2 then str "$(b,%s)[=$(i,%s)]" n var else
          str "$(b,%s) [$(i,%s)]" n var
    in
    let var = if a.docv = "" then "VAL" else a.docv in
    let names = List.sort compare a.o_names in
    let s = String.concat ", " (List.rev_map (fmt_name var) names) in
    s

  let arg_info_substs ~buf a doc =
    let subst = function
    | "docv" -> str "$(i,%s)" a.docv
    | "opt" when is_opt a ->
        let k = String.lowercase (List.hd (List.sort compare a.o_names)) in
        str "$(b,%s)" k
    | "env" when a.env_info <> None ->
        begin match a.env_info with
        | None -> assert false
        | Some v -> str "$(i,%s)" v.env_var
        end
    | s -> str "$(%s)" s in
    try
      Buffer.clear buf;
      Buffer.add_substitute buf subst doc;
      Buffer.contents buf
    with Not_found -> invalid_arg (err_doc_string doc)

  let make_arg_items ei =
    let buf = Buffer.create 200 in
    let cmp a a' =
      let c = compare a.docs a'.docs in
      if c <> 0 then c else
      match is_opt a, is_opt a' with
      | true, true ->
          let key names =
            let k = String.lowercase (List.hd (List.sort rev_compare names)) in
            if k.[1] = '-' then String.sub k 1 (String.length k - 1) else k
          in
          compare (key a.o_names) (key a'.o_names)
      | false, false ->
          compare (String.lowercase a.docv) (String.lowercase a'.docv)
      | true, false -> -1
      | false, true -> 1
    in
    let format a =
      let absent = match a.absent with
      | Error -> ""
      | Val v -> match Lazy.force v with
      | "" -> ""
      | v -> str "absent=%s%s" v (or_env a)
      in
      let optvopt = match a.o_kind with
      | Opt_vopt v -> str "default=%s" v
      | _ -> ""
      in
      let argvdoc = match optvopt, absent with
      | "", "" -> ""
      | s, "" | "", s -> str " (%s)" s
      | s, s' -> str " (%s) (%s)" s s'
      in
      (a.docs, `I (make_arg_label a ^ argvdoc, (arg_info_substs ~buf a a.doc)))
    in
    let is_arg_item a = not (is_pos a && (a.docv = "" || a.doc = "")) in
    let l = List.sort cmp (List.filter is_arg_item (snd ei.term)) in
    List.rev_map format l

  let make_env_items_rev ei =
    let buf = Buffer.create 200 in
    let cmp a a' =
      let e' = match a'.env_info with None -> assert false | Some a' -> a' in
      let e = match a.env_info with None -> assert false | Some a -> a in
      let c = compare e.env_docs e'.env_docs in
      if c <> 0 then c else
      compare e.env_var e'.env_var
    in
    let format a =
      let e = match a.env_info with None -> assert false | Some a -> a in
      (e.env_docs,
       `I (str "$(i,%s)" e.env_var, arg_info_substs ~buf a e.env_doc))
    in
    let is_env_item a = a.env_info <> None in
    let l = List.sort cmp (List.filter is_env_item (snd ei.term)) in
    List.rev_map format l

  let make_cmd_items ei = match eval_kind ei with
  | `Simple | `M_choice -> []
  | `M_main ->
      let add_cmd acc (ti, _) =
        (ti.tdocs, `I ((str "$(b,%s)" ti.name), ti.tdoc)) :: acc
      in
      List.sort rev_compare (List.fold_left add_cmd [] ei.choices)

  let text ei =                  (* man that code is particulary unreadable. *)
    let rec merge_items acc to_insert mark il = function
    | `S s as sec :: ts ->
        let acc = List.rev_append to_insert acc in
        let acc = if mark then sec :: `Orphan_mark :: acc else sec :: acc in
        let to_insert, il = List.partition (fun (n, _) -> n = s) il in
        let to_insert = List.rev_map (fun (_, i) -> i) to_insert in
        let to_insert = (to_insert :> [ `Orphan_mark | Manpage.block] list) in
        merge_items acc to_insert (s = "DESCRIPTION") il ts
    | t :: ts ->
        let t = (t :> [`Orphan_mark | Manpage.block]) in
        merge_items (t :: acc) to_insert mark il ts
    | [] ->
        let acc = List.rev_append to_insert acc in
        (if mark then `Orphan_mark :: acc else acc), il
    in
    let rec merge_orphans acc orphans = function
    | `Orphan_mark :: ts ->
        let rec merge acc s = function
        | [] -> (`S s) :: acc
        | (s', i) :: ss ->
            let i = (i :> Manpage.block) in
            if s = s' then merge (i :: acc) s ss else
            merge (i :: (`S s) :: acc) s' ss
        in
        let acc = match orphans with
        | [] -> acc | (s, _) :: _ -> merge acc s orphans
        in
        merge_orphans acc [] ts
    | (#Manpage.block as e) :: ts -> merge_orphans (e :: acc) orphans ts
    | [] -> acc
    in
    let cmds = make_cmd_items ei in
    let args = make_arg_items ei in
    let envs_rev = make_env_items_rev ei in
    let items_rev = List.rev_append cmds (List.rev_append args envs_rev) in
    let cmp (s, _) (s', _) = match s, s with
    | "ENVIRONMENT VARIABLES", _ -> 1  (* Put env vars at the end. *)
    | s, "ENVIRONMENT VARIABLES" -> -1
    | s, s' -> compare s s' (* other predefined sec. names order correctly *)
    in
    let items = List.rev (List.stable_sort cmp items_rev) in
    let synopsis, man = get_synopsis_section ei in
    let rev_text, orphans = merge_items [`Orphan_mark] [] false items man in
    synopsis @ merge_orphans [] orphans rev_text

  let ei_subst ei = function
  | "tname" -> (fst ei.term).name
  | "mname" -> (fst ei.main).name
  | s -> str "$(%s)" s

  let man ei =
    title ei, (name_section ei) @ (text ei)

  let print fmt ppf ei = Manpage.print ~subst:(ei_subst ei) fmt ppf (man ei)
  let pr_synopsis ppf ei =
    pr ppf "@[%s@]"
      (Manpage.escape (ei_subst ei)
         Manpage.plain_esc (Buffer.create 100) (synopsis ei))

  let pr_version ppf ei = match (fst ei.main).version with
  | None -> assert false
  | Some v -> pr ppf "@[%a@]@." pr_text v
end

(* Errors for the command line user *)

module Err = struct
  let invalid kind s exp = str "invalid %s %s, %s" kind (quote s) exp
  let invalid_val = invalid "value"
  let no kind s = str "no %s %s" (quote s) kind
  let not_dir s = str "%s is not a directory" (quote s)
  let is_dir s = str "%s is a directory" (quote s)
  let element kind s exp = str "invalid element in %s (`%s'): %s" kind s exp
  let sep_miss sep s = invalid_val s (str "missing a `%c' separator" sep)
  let unknown kind ?(hints = []) v =
    let did_you_mean s = str ", did you mean %s ?" s in
    let hints = match hints with [] -> "." | hs -> did_you_mean (alts_str hs) in
    str "unknown %s %s%s" kind (quote v) hints

  let ambiguous kind s ambs =
    str "%s %s ambiguous and could be %s" kind (quote s) (alts_str ambs)

  let pos_excess excess =
    str "too many arguments, don't know what to do with %s"
      (String.concat ", " (List.map quote excess))

  let flag_value f v =
    str "option %s is a flag, it cannot take the argument %s"
      (quote f) (quote v)

  let opt_value_missing f = str "option %s needs an argument" (quote f)
  let opt_parse_value f e = str "option %s: %s" (quote f) e
  let env_parse_value var e = str "environment variable %s: %s" (quote var) e
  let opt_repeated f f' =
    if f = f' then str "option %s cannot be repeated" (quote f) else
    str "options %s and %s cannot be present at the same time" (quote f)
      (quote f')

  let pos_parse_value a e =
    if a.docv = "" then e else match a.p_kind with
    | Nth _ -> str "%s argument: %s" a.docv e
    | _ -> str "%s... arguments: %s" a.docv e

  let arg_missing a =
    if is_opt a then
      let rec long_name = function
      | n :: l -> if (String.length n) > 2 || l = [] then n else long_name l
      | [] -> assert false
      in
      str "required option %s is missing" (long_name a.o_names)
    else
    if a.docv = "" then str "a required argument is missing" else
    str "required argument %s is missing" a.docv

  (* Error printers *)

  let print ppf ei e = pr ppf "%s: @[%a@]@." (fst ei.main).name pr_text e
  let pr_backtrace err ei e bt =
    let bt =
      let len = String.length bt in
      if len > 0 then String.sub bt 0 (len - 1) (* remove final '\n' *) else bt
    in
    pr err
      "%s: @[internal error, uncaught exception:@\n%a@]@."
      (fst ei.main).name pr_lines (str "%s\n%s" (Printexc.to_string e) bt)

  let pr_try_help ppf ei =
    let exec = Help.invocation ei in
    let main = (fst ei.main).name in
    if exec = main then
      pr ppf "@[<2>Try `%s --help' for more information.@]" exec
    else
    pr ppf "@[<2>Try `%s --help' or `%s --help' for more information.@]"
      exec main

  let pr_usage ppf ei e =
    pr ppf "@[<v>%s: @[%a@]@,@[Usage: @[%a@]@]@,%a@]@."
      (fst ei.main).name pr_text e Help.pr_synopsis ei pr_try_help ei
end

(* Command lines. A command line stores pre-parsed information about
   the command line's arguments in a more structured way. Given the
   [arg_info] values mentionned in a term and Sys.argv (whithout exec
   name) we parse the command line into a map of [arg_info] values to
   [arg] values. This map is used by the term's closures to retrieve
   and convert command line arguments (see the Arg module). *)

module Cmdline :sig
  exception Error of string
  val choose_term : term_info -> (term_info * 'a) list -> string list ->
    term_info * string list
  val create : ?peek_opts:bool -> arg_info list -> string list -> cmdline
  val opt_arg : cmdline -> arg_info -> (int * string * (string option)) list
  val pos_arg : cmdline -> arg_info -> string list
end = struct
  exception Error of string

  let opt_arg cl a = match try Amap.find a cl with Not_found -> assert false
  with O l -> l | _ -> assert false

  let pos_arg cl a = match try Amap.find a cl with Not_found -> assert false
  with P l -> l | _ -> assert false

  let choose_term ti choices = function
  | [] -> ti, []
  | maybe :: args' as args ->
      if String.length maybe > 1 && maybe.[0] = '-' then ti, args else
      let index =
        let add acc (choice, _) = Trie.add acc choice.name choice in
        List.fold_left add Trie.empty choices
      in
      match Trie.find index maybe with
      | `Ok choice -> choice, args'
      | `Not_found ->
        let all = Trie.ambiguities index "" in
        let hints = suggest maybe all in
        raise (Error (Err.unknown "command" ~hints maybe))
      | `Ambiguous ->
          let ambs = List.sort compare (Trie.ambiguities index maybe) in
          raise (Error (Err.ambiguous "command" maybe ambs))

  let arg_info_indexes al =
    (* from [al] returns a trie mapping the names of optional arguments to
       their arg_info, a list with all arg_info for positional arguments and
       a cmdline mapping each arg_info to an empty [arg]. *)
    let rec aux opti posi cl = function
    | a :: l ->
        if is_pos a then aux opti (a :: posi) (Amap.add a (P []) cl) l else
        let add t name = Trie.add t name a in
        aux (List.fold_left add opti a.o_names) posi (Amap.add a (O []) cl) l
    | [] -> opti, posi, cl
    in
    aux Trie.empty [] Amap.empty al

  let parse_opt_arg s =          (* (name,value) of opt arg, assert len > 1. *)
    let l = String.length s in
    if s.[1] <> '-' then
      if l = 2 then s, None else
      String.sub s 0 2, Some (String.sub s 2 (l - 2))
    else try
      let i = String.index s '=' in
      String.sub s 0 i, Some (String.sub s (i + 1) (l - i - 1))
    with Not_found -> s, None

  let parse_args ~peek_opts opti cl args =
    (* returns an updated [cl] cmdline according to the options found in [args]
       with the trie index [opti]. Positional arguments are returned in order
       in a list. *)
    let rec aux k opti cl pargs = function
    | [] -> cl, (List.rev pargs)
    | "--" :: args -> cl, (List.rev_append pargs args)
    | s :: args ->
        let is_opt s = String.length s > 1 && s.[0] = '-' in
        let is_short_opt s = String.length s = 2 && s.[0] = '-' in
        if not (is_opt s) then aux (k+1) opti cl (s :: pargs) args else
        let name, value = parse_opt_arg s in
        match Trie.find opti name with
        | `Ok a ->
            let value, args = match value, a.o_kind with
            | Some v, Flag when is_short_opt name -> None, ("-" ^ v) :: args
            | Some v, _ -> value, args
            | None, Flag -> value, args
            | None, _ ->
                match args with
                | v :: rest -> if is_opt v then None, args else Some v, rest
                | [] -> None, args
            in
            let arg = O ((k, name, value) :: opt_arg cl a) in
            aux (k+1) opti (Amap.add a arg cl) pargs args
        | `Not_found when peek_opts -> aux (k+1) opti cl pargs args (* skip *)
        | `Not_found ->
            let hints =
              if String.length s <= 2 then [] else
              let short_opt, long_opt =
                if s.[1] <> '-'
                then s, Printf.sprintf "-%s" s
                else String.sub s 1 (String.length s - 1), s
              in
              let short_opt, _ = parse_opt_arg short_opt in
              let long_opt, _ = parse_opt_arg long_opt in
              let all = Trie.ambiguities opti "-" in
              match List.mem short_opt all, suggest long_opt all with
              | false, [] -> []
              | false, l -> l
              | true, [] -> [short_opt]
              | true, l -> if List.mem short_opt l then l else short_opt :: l
            in
            raise (Error (Err.unknown "option" ~hints name))
        | `Ambiguous ->
            let ambs = List.sort compare (Trie.ambiguities opti name) in
            raise (Error (Err.ambiguous "option" name ambs))
    in
    aux 0 opti cl [] args

  let process_pos_args posi cl pargs =
    (* returns an updated [cl] cmdline in which each positional arg mentionned
       in the list index posi, is given a value according the list
       of positional arguments values [pargs]. *)
    if pargs = [] then cl else
    let rec take n acc l =
      if n = 0 then List.rev acc else
      take (n - 1) (List.hd l :: acc) (List.tl l)
    in
    let rec aux pargs last cl max_spec = function
    | a :: al ->
        let arg, max_spec = match a.p_kind with
        | All -> P pargs, last
        | Nth (rev, k) ->
            let k = if rev then last - k else k in
            let max_spec = max k max_spec in
            if k < 0 || k > last then P [], max_spec else
            P ([List.nth pargs k]), max_spec
        | Left (rev, k) ->
            let k = if rev then last - k else k in
            let max_spec = max k max_spec in
            if k <= 0 || k > last then P [], max_spec else
            P (take k [] pargs), max_spec
        | Right (rev, k) ->
            let k = if rev then last - k else k in
            if k < 0 || k >= last then P [], last else
            P (List.rev (take (last - k) [] (List.rev pargs))), last
        in
        aux pargs last (Amap.add a arg cl) max_spec al
    | [] -> cl, max_spec
    in
    let last = List.length pargs - 1 in
    let cl, max_spec = aux pargs last cl (-1) posi in
    if last <= max_spec then cl else
    let excess = List.rev (take (last - max_spec) [] (List.rev pargs)) in
    raise (Error (Err.pos_excess excess))

  let create ?(peek_opts = false) al args =
    let opti, posi, cl = arg_info_indexes al in
    let cl, pargs = parse_args ~peek_opts opti cl args in
    if peek_opts then cl (* skip positional arguments *) else
    process_pos_args posi cl pargs
end

module Arg = struct
  type 'a parser = string -> [ `Ok of 'a | `Error of string ]
  type 'a printer = Format.formatter -> 'a -> unit
  type 'a converter = 'a parser * 'a printer
  type env = env_info
  type 'a arg_converter = (eval_info -> cmdline -> 'a)
  type 'a t = arg_info list * 'a arg_converter
  type info = arg_info

  let env_var ?(docs = "ENVIRONMENT VARIABLES") ?(doc = "See option $(opt).")
      env_var
    =
    { env_var = env_var; env_doc = doc; env_docs = docs }

  let ( & ) f x = f x
  let parse_error e = raise (Cmdline.Error e)
  let some ?(none = "") (parse, print) =
    (fun s -> match parse s with `Ok v -> `Ok (Some v) | `Error _ as e -> e),
    (fun ppf v -> match v with None -> pr_str ppf none| Some v -> print ppf v)

  let info ?docs ?(docv = "") ?(doc = "") ?env names =
    let dash n = if String.length n = 1 then "-" ^ n else "--" ^ n in
    let docs = match docs with
    | None -> if names = [] then "ARGUMENTS" else "OPTIONS"
    | Some s -> s
    in
    { id = arg_id (); absent = Val (lazy "");
      env_info = env;
      doc = doc; docv = docv; docs = docs;
      p_kind = All; o_kind = Flag; o_names = List.rev_map dash names;
      o_all = false; }

  let env_bool_parse s = match String.lowercase s with
  | "" | "false" | "no" | "n" | "0" -> `Ok false
  | "true" | "yes" | "y" | "1" -> `Ok true
  | s -> `Error (Err.invalid_val s (alts_str ["true"; "yes"; "false"; "no" ]))

  let parse_to_list parser s = match parser s with
  | `Ok v -> `Ok [v]
  | `Error _ as e -> e

  let try_env ei a parse ~absent = match a.env_info with
  | None -> absent
  | Some env ->
      match ei.env env.env_var with
      | None -> absent
      | Some v ->
          match parse v with
          | `Ok v -> v
          | `Error e ->
              parse_error (Err.env_parse_value env.env_var e)

  let flag a =
    if is_pos a then invalid_arg err_not_opt else
    let convert ei cl = match Cmdline.opt_arg cl a with
    | [] -> try_env ei a env_bool_parse ~absent:false
    | [_, _, None] -> true
    | [_, f, Some v] -> parse_error (Err.flag_value f v)
    | (_, f, _) :: (_ ,g, _) :: _  -> parse_error (Err.opt_repeated f g)
    in
    [a], convert

  let flag_all a =
    if is_pos a then invalid_arg err_not_opt else
    let a = { a with o_all = true } in
    let convert ei cl = match Cmdline.opt_arg cl a with
    | [] -> try_env ei a (parse_to_list env_bool_parse) ~absent:[]
    | l ->
        let truth (_, f, v) = match v with
        | None -> true | Some v -> parse_error (Err.flag_value f v)
        in
        List.rev_map truth l
    in
    [a], convert

  let vflag v l =
    let convert _ cl =
      let rec aux fv = function
      | (v, a) :: rest ->
          begin match Cmdline.opt_arg cl a with
          | [] -> aux fv rest
          | [_, f, None] ->
              begin match fv with
              | None -> aux (Some (f, v)) rest
              | Some (g, _) -> parse_error (Err.opt_repeated g f)
              end
          | [_, f, Some v] -> parse_error (Err.flag_value f v)
          | (_, f, _) :: (_, g, _) :: _ -> parse_error (Err.opt_repeated g f)
          end
      | [] -> match fv with None -> v | Some (_, v) -> v
      in
      aux None l
    in
    let flag (_, a) = if is_pos a then invalid_arg err_not_opt else a in
    List.rev_map flag l, convert

  let vflag_all v l =
    let convert _ cl =
      let rec aux acc = function
      | (fv, a) :: rest ->
          begin match Cmdline.opt_arg cl a with
          | [] -> aux acc rest
          | l ->
              let fval (k, f, v) = match v with
              | None -> (k, fv) | Some v -> parse_error (Err.flag_value f v)
              in
              aux (List.rev_append (List.rev_map fval l) acc) rest
          end
      | [] ->
          if acc = [] then v else List.rev_map snd (List.sort rev_compare acc)
      in
      aux [] l
    in
    let flag (_, a) =
      if is_pos a then invalid_arg err_not_opt else { a with o_all = true }
    in
    List.rev_map flag l, convert

  let parse_opt_value parse f v = match parse v with
  | `Ok v -> v | `Error e -> parse_error (Err.opt_parse_value f e)

  let opt ?vopt (parse, print) v a =
    if is_pos a then invalid_arg err_not_opt else
    let a = { a with absent = Val (lazy (str_of_pp print v));
                     o_kind = match vopt with
                     | None -> Opt | Some dv -> Opt_vopt (str_of_pp print dv) }
    in
    let convert ei cl = match Cmdline.opt_arg cl a with
    | [] -> try_env ei a parse ~absent:v
    | [_, f, Some v] -> parse_opt_value parse f v
    | [_, f, None] ->
        begin match vopt with
        | None -> parse_error (Err.opt_value_missing f)
        | Some optv -> optv
        end
    | (_, f, _) :: (_, g, _) :: _ -> parse_error (Err.opt_repeated g f)
    in
    [a], convert

  let opt_all ?vopt (parse, print) v a =
    if is_pos a then invalid_arg err_not_opt else
    let a = { a with absent = Val (lazy ""); o_all = true;
                     o_kind = match vopt with
                     | None -> Opt | Some dv -> Opt_vopt (str_of_pp print dv) }
    in
    let convert ei cl = match Cmdline.opt_arg cl a with
    | [] -> try_env ei a (parse_to_list parse) ~absent:v
    | l ->
        let parse (k, f, v) = match v with
        | Some v -> (k, parse_opt_value parse f v)
        | None -> match vopt with
        | None -> parse_error (Err.opt_value_missing f)
        | Some dv -> (k, dv)
        in
        List.rev_map snd (List.sort rev_compare (List.rev_map parse l))
    in
    [a], convert

  (* Positional arguments *)

  let parse_pos_value parse a v = match parse v with
  | `Ok v -> v | `Error e -> parse_error (Err.pos_parse_value a e)

  let pos ?(rev = false) k (parse, print) v a =
    if is_opt a then invalid_arg err_not_pos else
    let a = { a with p_kind = Nth (rev, k);
                     absent = Val (lazy (str_of_pp print v)) }
    in
    let convert ei cl = match Cmdline.pos_arg cl a with
    | [] -> try_env ei a parse ~absent:v
    | [v] -> parse_pos_value parse a v
    | _ -> assert false
    in
    [a], convert

  let pos_list kind (parse, _) v a =
    if is_opt a then invalid_arg err_not_pos else
    let a = { a with p_kind = kind } in
    let convert ei cl = match Cmdline.pos_arg cl a with
    | [] -> try_env ei a (parse_to_list parse) ~absent:v
    | l -> List.rev (List.rev_map (parse_pos_value parse a) l)
    in
    [a], convert

  let pos_all c v a = pos_list All c v a
  let pos_left ?(rev = false) k = pos_list (Left (rev, k))
  let pos_right ?(rev = false) k = pos_list (Right (rev, k))

  (* Arguments as terms *)

  let absent_error al = List.rev_map (fun a -> { a with absent = Error }) al
  let value a = a
  let required (al, convert) =
    let al = absent_error al in
    let convert ei cl = match convert ei cl with
    | Some v -> v
    | None -> parse_error (Err.arg_missing (List.hd al))
    in
    al, convert

  let non_empty (al, convert) =
    let al = absent_error al in
    let convert ei cl = match convert ei cl with
    | [] -> parse_error (Err.arg_missing (List.hd al))
    | l -> l
    in
    al, convert

  let last (al, convert) =
    let convert ei cl = match convert ei cl with
    | [] -> parse_error (Err.arg_missing (List.hd al))
    | l -> List.hd (List.rev l)
    in
    al, convert

  (* Predefined converters. *)

  let bool =
    (fun s -> try `Ok (bool_of_string s) with Invalid_argument _ ->
        `Error (Err.invalid_val s (alts_str ["true"; "false"]))),
    Format.pp_print_bool

  let char =
    (fun s -> if String.length s = 1 then `Ok s.[0] else
      `Error (Err.invalid_val s "expected a character")),
    pr_char

  let parse_with t_of_str exp s =
    try `Ok (t_of_str s) with Failure _ -> `Error (Err.invalid_val s exp)

  let int =
    parse_with int_of_string "expected an integer", Format.pp_print_int

  let int32 =
    parse_with Int32.of_string "expected a 32-bit integer",
    (fun ppf -> pr ppf "%ld")

  let int64 =
    parse_with Int64.of_string "expected a 64-bit integer",
    (fun ppf -> pr ppf "%Ld")

  let nativeint =
    parse_with Nativeint.of_string "expected a processor-native integer",
    (fun ppf -> pr ppf "%nd")

  let float =
    parse_with float_of_string "expected a floating point number",
    Format.pp_print_float

  let string = (fun s -> `Ok s), pr_str
  let enum sl =
    if sl = [] then invalid_arg err_empty_list else
    let t = Trie.of_list sl in
    let parse s = match Trie.find t s with
    | `Ok _ as r -> r
    | `Ambiguous ->
        let ambs = List.sort compare (Trie.ambiguities t s) in
        `Error (Err.ambiguous "enum value" s ambs)
    | `Not_found ->
        let alts = List.rev (List.rev_map (fun (s, _) -> s) sl) in
        `Error (Err.invalid_val s ("expected " ^ (alts_str alts)))
    in
    let print ppf v =
      let sl_inv = List.rev_map (fun (s,v) -> (v,s)) sl in
      try pr_str ppf (List.assoc v sl_inv)
      with Not_found -> invalid_arg err_incomplete_enum
    in
    parse, print

  let file =
    (fun s -> if Sys.file_exists s then `Ok s else
      `Error (Err.no "file or directory" s)),
    pr_str

  let dir =
    (fun s ->
       if Sys.file_exists s then
         if Sys.is_directory s then `Ok s else `Error (Err.not_dir s)
       else
       `Error (Err.no "directory" s)),
    pr_str

  let non_dir_file =
    (fun s ->
       if Sys.file_exists s then
         if not (Sys.is_directory s) then `Ok s else `Error (Err.is_dir s)
       else
       `Error (Err.no "file" s)),
    pr_str

  let split_and_parse sep parse s =
    let parse sub = match parse sub with
    | `Error e -> failwith e | `Ok v -> v in
    let rec split accum j =
      let i = try String.rindex_from s j sep with Not_found -> -1 in
      if (i = -1) then
        let p = String.sub s 0 (j + 1) in
        if p <> "" then parse p :: accum else accum
      else
      let p = String.sub s (i + 1) (j - i) in
      let accum' = if p <> "" then parse p :: accum else accum in
      split accum' (i - 1)
    in
    split [] (String.length s - 1)

  let list ?(sep = ',') (parse, pr_e) =
    let parse s = try `Ok (split_and_parse sep parse s) with
    | Failure e -> `Error (Err.element "list" s e)
    in
    let rec print ppf = function
    | v :: l -> pr_e ppf v; if (l <> []) then (pr_char ppf sep; print ppf l)
    | [] -> ()
    in
    parse, print

  let array ?(sep = ',') (parse, pr_e) =
    let parse s = try `Ok (Array.of_list (split_and_parse sep parse s)) with
    | Failure e -> `Error (Err.element "array" s e)
    in
    let print ppf v =
      let max = Array.length v - 1 in
      for i = 0 to max do pr_e ppf v.(i); if i <> max then pr_char ppf sep done
    in
    parse, print

  let split_left sep s =
    try
      let i = String.index s sep in
      let len = String.length s in
      Some ((String.sub s 0 i), (String.sub s (i + 1) (len - i - 1)))
    with Not_found -> None

  let pair ?(sep = ',') (pa0, pr0) (pa1, pr1) =
    let parser s = match split_left sep s with
    | None -> `Error (Err.sep_miss sep s)
    | Some (v0, v1) ->
        match pa0 v0, pa1 v1 with
        | `Ok v0, `Ok v1 -> `Ok (v0, v1)
        | `Error e, _ | _, `Error e -> `Error (Err.element "pair" s e)
    in
    let printer ppf (v0, v1) = pr ppf "%a%c%a" pr0 v0 sep pr1 v1 in
    parser, printer

  let t2 = pair
  let t3 ?(sep = ',') (pa0, pr0) (pa1, pr1) (pa2, pr2) =
    let parse s = match split_left sep s with
    | None -> `Error (Err.sep_miss sep s)
    | Some (v0, s) ->
        match split_left sep s with
        | None -> `Error (Err.sep_miss sep s)
        | Some (v1, v2) ->
            match pa0 v0, pa1 v1, pa2 v2 with
            | `Ok v0, `Ok v1, `Ok v2 -> `Ok (v0, v1, v2)
            | `Error e, _, _ | _, `Error e, _ | _, _, `Error e ->
                `Error (Err.element "triple" s e)
    in
    let print ppf (v0, v1, v2) =
      pr ppf "%a%c%a%c%a" pr0 v0 sep pr1 v1 sep pr2 v2
    in
    parse, print

  let t4 ?(sep = ',') (pa0, pr0) (pa1, pr1) (pa2, pr2) (pa3, pr3) =
    let parse s = match split_left sep s with
    | None -> `Error (Err.sep_miss sep s)
    | Some(v0, s) ->
        match split_left sep s with
        | None -> `Error (Err.sep_miss sep s)
        | Some (v1, s) ->
            match split_left sep s with
            | None -> `Error (Err.sep_miss sep s)
            | Some (v2, v3) ->
                match pa0 v0, pa1 v1, pa2 v2, pa3 v3 with
                | `Ok v1, `Ok v2, `Ok v3, `Ok v4 -> `Ok (v1, v2, v3, v4)
                | `Error e, _, _, _ | _, `Error e, _, _ | _, _, `Error e, _
                | _, _, _, `Error e -> `Error (Err.element "quadruple" s e)
    in
    let print ppf (v0, v1, v2, v3) =
      pr ppf "%a%c%a%c%a%c%a" pr0 v0 sep pr1 v1 sep pr2 v2 sep pr3 v3
    in
    parse, print

  (* Documentation formatting helpers *)

  let doc_quote = quote
  let doc_alts = alts_str
  let doc_alts_enum ?quoted enum = alts_str ?quoted (List.map fst enum)
end

module Term = struct
  type info = term_info
  type +'a t = arg_info list * (eval_info -> cmdline -> 'a)
  type 'a result = [
    | `Ok of 'a | `Error of [`Parse | `Term | `Exn ] | `Version | `Help ]

  exception Term of
      [ `Help of [`Pager | `Plain | `Groff] * string option
      | `Error of bool * string ]

  let info  ?(sdocs = "OPTIONS") ?(man = []) ?(docs = "COMMANDS") ?(doc = "")
      ?version name =
    { name = name; version = version; tdoc = doc; tdocs = docs; sdocs = sdocs;
      man = man }

  let name ti = ti.name
  let const v = [], (fun _ _ -> v)
  let pure (* deprecated *) = const
  let app (al, f) (al', v) =
    List.rev_append al al',
    fun ei cl -> (f ei cl) (v ei cl)

  let ( $ ) = app

  type 'a ret =
    [ `Help of [`Pager | `Plain | `Groff] * string option
    | `Error of (bool * string)
    | `Ok of 'a ]

  let ret (al, v) =
    al, fun ei cl -> match v ei cl with
    | `Ok v -> v
    | `Error (u,e) -> raise (Term (`Error (u,e)))
    | `Help h -> raise (Term (`Help h))

  let main_name = [], (fun ei _ -> (fst ei.main).name)
  let choice_names =
    [], fun ei _ -> List.rev_map (fun e -> (fst e).name) ei.choices

  let man_format =
    let fmts = ["pager", `Pager; "groff", `Groff; "plain", `Plain] in
    let doc = "Show output in format $(docv) (pager, plain or groff)."in
    Arg.(value & opt (enum fmts) `Pager & info ["man-format"] ~docv:"FMT" ~doc)

  (* Evaluation *)

  let remove_exec argv =
    try List.tl (Array.to_list argv) with Failure _ -> invalid_arg err_argv

  let add_std_opts ei =
    let docs = (fst ei.term).sdocs in
    let args, v_lookup =
      if (fst ei.main).version = None then [], None else
      let (a, lookup) =
        Arg.flag (Arg.info ["version"] ~docs ~doc:"Show version information.")
      in
      a, Some lookup
    in
    let args, h_lookup =
      let (a, lookup) =
        let fmt = Arg.enum ["pager",`Pager; "groff",`Groff; "plain",`Plain] in
        let doc = "Show this help in format $(docv) (pager, plain or groff)."in
        let a = Arg.info ["help"] ~docv:"FMT" ~docs ~doc in
        Arg.opt ~vopt:(Some `Pager) (Arg.some fmt) None a
      in
      List.rev_append a args, lookup
    in
    h_lookup, v_lookup,
    { ei with term = (fst ei.term), List.rev_append args (snd ei.term) }

  let eval_term help err ei f args =
    let help_arg, vers_arg, ei = add_std_opts ei in
    try
      let cl = Cmdline.create (snd ei.term) args in
      match help_arg ei cl, vers_arg with
      | Some fmt, _ -> Help.print fmt help ei; `Help
      | None, Some v_arg when v_arg ei cl -> Help.pr_version help ei; `Version
      | _ -> `Ok (f ei cl)
    with
    | Cmdline.Error e -> Err.pr_usage err ei e; `Error `Parse
    | Term (`Error (usage, e)) ->
        if usage then Err.pr_usage err ei e else Err.print err ei e;
        `Error `Term
    | Term (`Help (fmt, cmd)) ->
        let ei = match cmd with
        | Some cmd ->
            let cmd =
              try List.find (fun (i, _) -> i.name = cmd) ei.choices
              with Not_found -> invalid_arg (err_help cmd)
            in
            {ei with term = cmd }
        | None -> { ei with term = ei.main }
        in
        let _, _, ei = add_std_opts ei in
        Help.print fmt help ei; `Help

  let env_default v = try Some (Sys.getenv v) with Not_found -> None

  let eval ?(help = Format.std_formatter) ?(err = Format.err_formatter)
      ?(catch = true) ?(env = env_default) ?(argv = Sys.argv) ((al, f), ti) =
    let term = ti, al in
    let ei = { term = term; main = term; choices = []; env = env } in
    try eval_term help err ei f (remove_exec argv) with
    | e when catch ->
        Err.pr_backtrace err ei e (Printexc.get_backtrace ()); `Error `Exn

  let eval_choice ?(help = Format.std_formatter) ?(err = Format.err_formatter)
      ?(catch = true) ?(env = env_default) ?(argv = Sys.argv)
      (((al, f) as t), ti) choices =
    let ei_choices = List.rev_map (fun ((al, _), ti) -> ti, al) choices in
    let main = (ti, al) in
    let ei = { term = main; main = main; choices = ei_choices; env = env } in
    try
      let chosen, args = Cmdline.choose_term ti ei_choices (remove_exec argv) in
      let find_chosen (_, ti) = ti = chosen in
      let (al, f), _ = List.find find_chosen ((t, ti) :: choices) in
      let ei = { ei with term = (chosen, al) } in
      eval_term help err ei f args
    with
    | Cmdline.Error e ->                    (* may be raised by choose_term. *)
        Err.pr_usage err ei e; `Error `Parse
    | e when catch ->
        Err.pr_backtrace err ei e (Printexc.get_backtrace ()); `Error `Exn

  let eval_peek_opts ?(version_opt = false) ?(env = env_default)
      ?(argv = Sys.argv) (al, f) =
    let args = remove_exec argv in
    let version = if version_opt then Some "dummy" else None in
    let term = info ?version "dummy", al in
    let ei = { term = term; main = term; choices = []; env = env } in
    let help_arg, vers_arg, ei = add_std_opts ei in
    try
      let cl = Cmdline.create ~peek_opts:true (snd ei.term) args in
      match help_arg ei cl, vers_arg with
      | Some fmt, _ ->
          (try (Some (f ei cl), `Help) with e -> None, `Help)
      | None, Some v_arg when v_arg ei cl ->
          (try (Some (f ei cl), `Version) with e -> None, `Version)
      | _ ->
          let v = f ei cl in
          Some v, `Ok v
    with
    | Cmdline.Error _ -> None, (`Error `Parse)
    | Term _ -> None, (`Error `Term)
    | e -> None, (`Error `Exn)
end

(*---------------------------------------------------------------------------
   Copyright (c) 2011 Daniel C. Bünzli
   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   are met:

   1. Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.

   2. Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.

   3. Neither the name of Daniel C. Bünzli nor the names of
      contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  ---------------------------------------------------------------------------*)

end
module Refmt_args
= struct
#1 "refmt_args.ml"
module Cmdliner = Vendored_cmdliner
open Cmdliner

let interface =
  let doc = "parse AST as an interface" in
  Arg.(value & opt (bool) false & info ["i"; "interface"] ~doc)

let recoverable =
  let doc = "enable recoverable parser" in
  Arg.(value & flag & info ["r"; "recoverable"] ~doc)

let explicit_arity =
  let doc =
    "if a constructor's argument is a tuple, always interpret it as \
     multiple arguments"
  in
  Arg.(value & flag & info ["e"; "assume-explicit-arity"] ~doc)

let parse_ast =
  let docv = "FORM" in
  let doc = "parse AST in FORM, which is one of: (ml | re | \
             binary (for compiler input) | \
             binary_reason (for interchange between Reason versions))"
  in
  let opts = Arg.enum ["ml", `ML; "re", `Reason; "binary", `Binary;
                       "binary_reason", `BinaryReason; "auto", `Auto]
  in
  Arg.(value & opt (some opts) None & info ["parse"] ~docv ~doc)

let print =
  let docv = "FORM" in
  let doc = "print AST in FORM, which is one of: (ml | re (default) | \
             binary (for compiler input) | \
             binary_reason (for interchange between Reason versions) | \
             ast (print human readable AST directly) | none)"
  in
  let opts = Arg.enum ["ml", `ML; "re", `Reason; "binary", `Binary;
                       "binary_reason", `BinaryReason; "ast", `AST;
                       "none", `None]
  in
  Arg.(value & opt opts `Reason & info ["p"; "print"] ~docv ~doc)

let print_width =
  let docv = "COLS" in
  let doc = "wrapping width for printing the AST" in
  Arg.(value & opt (int) (80) & info ["w"; "print-width"] ~docv ~doc)

let heuristics_file =
  let doc =
    "load path as a heuristics file to specify which constructors carry a tuple \
     rather than multiple arguments. Mostly used in removing [@implicit_arity] introduced from \
     OCaml conversion.\n\t\texample.txt:\n\t\tConstructor1\n\t\tConstructor2"
  in
  Arg.(value & opt (some file) None & info ["h"; "heuristics-file"] ~doc)

let in_place =
  let doc = "reformat a file in-place" in
  Arg.(value & flag & info ["in-place"] ~doc)

let input =
  let docv = "FILENAMES" in
  let doc = "input files; if empty, assume stdin" in
  Arg.(value & (pos_all non_dir_file []) & info [] ~docv ~doc)

end
#1 "refmt_impl.ml"
(*
 * Copyright (c) 2015-present, Facebook, Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *)

module Cmdliner = Vendored_cmdliner
open Cmdliner

let read_lines file =
  let list = ref [] in
  let chan = open_in_bin file in
  try
    while true do
      list := input_line chan :: !list
    done;
    []
  with End_of_file ->
    close_in chan;
    List.rev !list

let refmt
    interface
    is_recoverable
    explicit_arity
    parse_ast
    print
    print_width
    heuristics_file
    in_place
    input_files
  =
  let refmt_single input_file =
    let (use_stdin, input_file) = match input_file with
      | Some name -> (false, name)
      | None -> (true, "")
    in
    let eol = match use_stdin, input_file with
      | (true, _) -> Eol_detect.default_eol
      | (false, name) -> Eol_detect.get_eol_for_file name
    in
    let parse_ast = match parse_ast, use_stdin with
      | (Some x, _) -> x
      | (None, false) -> `Auto
      | (None, true) -> `Reason (* default *)
    in
    let constructorLists = match heuristics_file with
      | Some f_name -> read_lines f_name
      | None -> []
    in
    let interface = match interface with
      | true -> true
      | false -> (Filename.check_suffix input_file ".rei" || Filename.check_suffix input_file ".mli")
    in
    let output_file =
      match in_place, use_stdin with
      | (true, true) -> Printer_maker.err "Cannot write in place to stdin."
      | (true,    _) -> Some input_file
      | (false,   _) -> None
    in
    let (module Printer : Printer_maker.PRINTER) =
      if interface then (module Reason_interface_printer)
      else (module Reason_implementation_printer)
    in
    Reason_config.configure ~r:is_recoverable;
    Location.input_name := input_file;
    let _ = Reason_pprint_ast.configure
        ~width: print_width
        ~assumeExplicitArity: explicit_arity
        ~constructorLists
    in
    let (ast, parsedAsML) =
      Printer.parse ~use_stdin parse_ast input_file
    in
    let output_chan = Printer_maker.prepare_output_file output_file in
    (* If you run into trouble with this (or need to use std_formatter by
       itself at the same time for some reason), try breaking this out so that
       it's not possible to call Format.formatter_of_out_channel on stdout. *)
    let output_formatter = Eol_convert.get_formatter output_chan eol in
    (
      Printer.print print input_file parsedAsML output_chan output_formatter ast;
      (* Also closes all open boxes. *)
      Format.pp_print_flush output_formatter ();
      flush output_chan;
      Printer_maker.close_output_file output_file output_chan;
    )
  in
  try
    match input_files with
    | [] -> `Ok (refmt_single None)
    | _ -> `Ok (List.iter (fun file -> refmt_single (Some file)) input_files)
  with
  | Printer_maker.Invalid_config msg -> `Error (true, msg)
  | Reason_errors.Reason_error (error, loc) ->
    Reason_errors.report_error Format.err_formatter ~loc error;
    exit 1
  | exn ->
    prerr_endline (Printexc.to_string exn);
     (* FIXME: Reason_syntax_util.report_error Format.err_formatter exn; *)
    exit 1

let top_level_info =
  let doc = "Reason's Parser & Pretty-printer" in
  let man = [`S "DESCRIPTION"; `P "refmt lets you format Reason files, parse them, and convert them between OCaml syntax and Reason syntax."] in
let version = "Reason " ^ Package.version ^ " @ " ^ Package.git_short_version
  in
  Term.info "refmt" ~version ~doc ~man

let refmt_t =
  let open Term in
  let open Refmt_args in
  const refmt $ interface
              $ recoverable
              $ explicit_arity
              $ parse_ast
              $ print
              $ print_width
              $ heuristics_file
              $ in_place
              $ input

let () =
  match Term.eval ((Term.ret refmt_t), top_level_info) with
  | `Error _ -> exit 1
  | _ -> exit 0
